Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2007-11-01 12:16:30


Author: dgregor
Date: 2007-11-01 12:16:30 EDT (Thu, 01 Nov 2007)
New Revision: 40645
URL: http://svn.boost.org/trac/boost/changeset/40645

Log:
Use unsigned long long for the path count to avoid overflows. Fixes #1398
Text files modified:
   trunk/boost/graph/betweenness_centrality.hpp | 6 ++----
   1 files changed, 2 insertions(+), 4 deletions(-)

Modified: trunk/boost/graph/betweenness_centrality.hpp
==============================================================================
--- trunk/boost/graph/betweenness_centrality.hpp (original)
+++ trunk/boost/graph/betweenness_centrality.hpp 2007-11-01 12:16:30 EDT (Thu, 01 Nov 2007)
@@ -417,7 +417,6 @@
                                            WeightMap weight_map,
                                            VertexIndexMap vertex_index)
   {
- typedef typename graph_traits<Graph>::degree_size_type degree_size_type;
     typedef typename graph_traits<Graph>::vertex_descriptor vertex_descriptor;
     typedef typename graph_traits<Graph>::edge_descriptor edge_descriptor;
     typedef typename mpl::if_c<(is_same<CentralityMap,
@@ -432,7 +431,7 @@
     std::vector<std::vector<edge_descriptor> > incoming(V);
     std::vector<centrality_type> distance(V);
     std::vector<centrality_type> dependency(V);
- std::vector<degree_size_type> path_count(V);
+ std::vector<unsigned long long> path_count(V);
 
     brandes_betweenness_centrality(
       g, centrality, edge_centrality_map,
@@ -453,7 +452,6 @@
                                            EdgeCentralityMap edge_centrality_map,
                                            VertexIndexMap vertex_index)
   {
- typedef typename graph_traits<Graph>::degree_size_type degree_size_type;
     typedef typename graph_traits<Graph>::vertex_descriptor vertex_descriptor;
     typedef typename graph_traits<Graph>::edge_descriptor edge_descriptor;
     typedef typename mpl::if_c<(is_same<CentralityMap,
@@ -468,7 +466,7 @@
     std::vector<std::vector<edge_descriptor> > incoming(V);
     std::vector<centrality_type> distance(V);
     std::vector<centrality_type> dependency(V);
- std::vector<degree_size_type> path_count(V);
+ std::vector<unsigned long long> path_count(V);
 
     brandes_betweenness_centrality(
       g, centrality, edge_centrality_map,


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk