Article View: comp.lang.c++.leda
Article #29Bug with GRAPH for 3.1.2?
From: Ashvin Kannan
Date: Mon, 07 Aug 1995 21:25
Date: Mon, 07 Aug 1995 21:25
59 lines
1684 bytes
1684 bytes
Hello,
I'm having a problem for which I have ABSOLUTELY no clue on how to
solve/workaround. Maybe I'm making a mistake, which someone can spot.
Enclosed at the end of the mail is an example of code using GRAPH. When
"mytype" is "typedef"ed to int, I get the correct results:
------------
32 0 1
8 0 1
------------
However, if I typedef mytype to unsigned char (which is what I want),
I get the following:!!
------------
0 0 1
0 0 1
------------
I'm using LEDA 3.1.2 with g++ 2.6.3. Thanks for any input/help!
Ashvin
======================================================================
#include <LEDA/graph.h>
typedef unsigned char mytype;
class fooC
{
public:
mytype a;
};
int main()
{
GRAPH<int,fooC> G;
G.clear();
node *nodes = new node[2];
nodes[0] = G.new_node(0);
nodes[1] = G.new_node(1);
fooC *foos = new fooC[2];
foos[0].a = 32;
foos[1].a = 8;
G.new_edge(nodes[0], nodes[1], foos[0]);
G.new_edge(nodes[0], nodes[1], foos[1]);
edge e;
node n;
forall_nodes(n, G)
forall_adj_edges(e, n)
cout << (int) G[e].a << " " <<
"\t" << G[source(e)] << " " << G[target(e)] << "\n";
}
======================================================================
Technical Details
Message-ID:
<ASHVIN.95Aug7172536@parrot.bu.edu>Path:
arc1-ca.pugleaf.net!news.bu.edu!ashvinShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.bu.edu!ashvin From: ashvin@raven.bu.edu (Ashvin Kannan) Newsgroups: comp.lang.c++.leda Subject: Bug with GRAPH for 3.1.2? Followup-To: comp.lang.c++.leda Date: 07 Aug 1995 21:25:36 GMT Organization: Boston University Distribution: world Message-ID: <ASHVIN.95Aug7172536@parrot.bu.edu> Reply-To: ashvin@bu.edu NNTP-Posting-Host: parrot.bu.edu