HI, I start looking at the Graph library and try the quick_tour.cpp on my machine. Here is something wrong I found out
gcc --vesion gcc (GCC) 3.3 (Gentoo Linux 1.4, PVR 3.3)
g++ -o test -O2 quick_tour.cpp ./test vertices(g) = A B C D E edges(g) = (A,B) (A,D) (C,A) (D,C) (C,E) (B,D) (D,E) vertex: 0 out-edges: (0,134545512) (0,134545536) in-edges: (2,0) adjacent vertices: 134545512 134545536 vertex: 1 out-edges: (1,134545632) in-edges: (0,1) adjacent vertices: 134545632 vertex: 2 out-edges: (2,134545560) (2,134545608) in-edges: (3,2) adjacent vertices: 134545560 134545608 vertex: 3 out-edges: (3,134545584) (3,134545656) in-edges: (0,3) (1,3) adjacent vertices: 134545584 134545656 vertex: 4 out-edges: in-edges: (2,4) (3,4) adjacent vertices: digraph G { graph [ rankdir="LR", ratio="fill", size="3,3"]; node [ shape="circle"]; 0[label="A"]; 1[label="B"]; 2[label="C"]; 3[label="D"]; 4[label="E"]; 0->1 [label="1.2"]; 0->3 [label="4.5"]; 2->0 [label="2.6"]; 3->2 [label="0.4"]; 2->4 [label="5.2"]; 1->3 [label="1.8"]; 3->4 [label="3.3"]; }
Note: the large numbers in the out-edges , like 134545512. Expected numbers are 0,1,2,3,4. Seems some fields are not initilized but read. Note: I tried gcc-3.2.3 and got same results Note: Without -O2 it is fine. My newbie questions are: 1) Is it compiler issue or BGL issue? Cannot we use optimization of gcc when using BGL? 2) I suppose gcc3.3 is good so if this is an BGL issue, where could the thing go wrong? How to fix it? Thanks, Michael