Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2006-01-23 15:57:07


Hi Robert,

On Jan 3, 2006, at 5:02 PM, Robert McCullough wrote:
> I have tried to compile the example boost_file_dependencies.cpp using
> version 1.33.1 under Linux (gcc) and Windows XP (VC 7.1) and get the
> same errors.
> It does not like the following call to
> dijkstra_shortest_paths_no_init(). If I commit this function out it
> compiles fine.
> Any ideas on how to fix this?

Here's the patch that fixes this example:

Index: file_dependencies.cpp
===================================================================
RCS file:
/cvsroot/boost/boost/libs/graph/example/file_dependencies.cpp,v
retrieving revision 1.16
diff -u -r1.16 file_dependencies.cpp
--- file_dependencies.cpp 24 Mar 2005 14:54:10 -0000 1.16
+++ file_dependencies.cpp 23 Jan 2006 20:56:18 -0000
@@ -133,7 +133,7 @@
    // grouped together
    {
      // Set up the necessary graph properties.
- vector<int> time(N);
+ vector<int> time(N, (std::numeric_limits<int>::max)());
      typedef vector<int>::iterator Time;
      property_map<Graph, edge_weight_t>::type weight = get(edge_weight,
g);

@@ -157,8 +157,8 @@
            indexmap = get(vertex_index, g);
          dijkstra_shortest_paths_no_init
            (g, *i, &pred[0], &time[0], weight, indexmap,
- compare, combine, 0, // Since we are using > instead of >,
we
- (std::numeric_limits<int>::max)(), // flip 0 and inf.
+ compare, combine, 0, // Since we are using > instead of <,
we
+ // flip 0 and inf.
             default_dijkstra_visitor());
        }
      }

It's also corrected in Boost CVS. Thanks for reporting this, and my
apologies for the looooooooong delay.

        Doug



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net