[BGL] How to use an array in bundled property?

I defined an double array inside bundled vertex property, and have trouble
finding ways of accessing it.
Neither can I find any where in the document an example on it. Your input will
be much appreciated!
my graph is defined as follows:
struct Node
{
double mode[3];
// this is hard to access
};
struct Edge
{
double nPixels;
unsigned short nTh;
//no problem access them
};
typedef boost::adjacency_list<
boost::vecS, boost::vecS, boost::bidirectionalS,
Node, Edge> Graph;
Graph colGraph;
I have no problem with accessing the 'nPixels' in Edge property,
boost::property_map

Hi Shufei,
On 3/1/07, Shufei Fan
I defined an double array inside bundled vertex property, and have trouble finding ways of accessing it.
Neither can I find any where in the document an example on it. Your input
will be much appreciated!
Don't worry, there seems to be no example ;) Second, there seems to be no way of accesssing it. But this is what I did: [snipped declarations] struct Node
{ // this is hard to access double mode[3]; int test; };
compiler error here: boost::property_map
::type nm = get(&Node::mode, *colGraph);//node mode
I think the type of the property map should be:
boost::property_map

Using the replied method, my initial difficulty was resolved. However, when I
introduce more properties into my vertex bundle, I am baffled again. I figure
some fundamental understanding of bundle property is necessary for me(It is
appreciated, if someone can hint on this)
This time, my graph definition is:
/////////////////////////////////////////////////////////////////////
struct Node
{
int count;
int matched_to;
std::vector<int> absorb;
double mode[3];
double center[2];
int extremes[4];
};
struct Edge
{
double maxBoundaryPoints;
double eWeight;
unsigned short nTh;
};
//the following provided by Stephan
//For accessing Node::mode[3], etc:
//pointer to Node-Mode
//new specialization of property_map for bundles with arrays
namespace boost{
template

Hi Shufei,
On 4/9/07, Shufei Fan
Using the replied method, my initial difficulty was resolved. However, when I introduce more properties into my vertex bundle, I am baffled again.
I cannot reproduce your error here. Can you please extract a small testcase? Cheers, Stephan

In response to Stephan's requests for detail(sorry, I cannot find stephan's
reply on 'gmane.org', though i saw it on 'boost.org'. So I have to reply to my
own topic instead).
Thanks Stephan!
I found out later that a member defined in my class GA was causing the
compiling error:
class GA{
//data members
Graph* rg;//deine a pointer to Graph object
...
//after commenting out this line, it compiles
boost::property_map

Hi Shufei,
On 4/10/07, Shufei Fan
I found out later that a member defined in my class GA was causing the compiling error:
This seems to work for me (currently on apple's gcc 4.01):
struct GA {
Graph *rowGraph;
boost::property_map

Stephan Diederich
Hi Shufei,
On 4/10/07, Shufei Fan
wrote: [snip] I found out later that a member defined in my class GA was causing the compiling error:
This seems to work for me (currently on apple's gcc 4.01):
struct GA { Graph *rowGraph; boost::property_map
::type nmt; GA():rowGraph(0){ rowGraph = new Graph(); nmt = get(&Node::count, *rowGraph); };
~GA(){ if(rowGraph) delete rowGraph; } };
HTH, Stephan
Are you saying initialize the property-pointer in the class GA's constructor? I tried this, I am on windows vc2003.net, but that still doesnot compile. I've switched to using local variable instead(although more local definitions, but easier to get it work anyway) thanks Stephan! Shufei

On 4/15/07, Shufei Fan
Stephan Diederich
writes: Hi Shufei,
On 4/10/07, Shufei Fan
wrote: [snip] I found out later that a member defined in my class GA was causing the compiling error:
This seems to work for me (currently on apple's gcc 4.01):
struct GA { Graph *rowGraph; boost::property_map
::type nmt; GA():rowGraph(0){ rowGraph = new Graph(); nmt = get(&Node::count, *rowGraph); };
~GA(){ if(rowGraph) delete rowGraph; } };
HTH, Stephan
Are you saying initialize the property-pointer in the class GA's constructor?
I just wanted to get a working example ;)
I tried this, I am on windows vc2003.net, but that still doesnot compile. I've switched to using local variable instead(although more local definitions, but easier to get it work anyway)
Maybe we can get Doug (the one who made the Bundled Properties) to comment on this... Cheers, Stephan

Stephan Diederich
Are you saying initialize the property-pointer in the class GA's constructor?
I just wanted to get a working example ;)
I tried this, I am on windows vc2003.net, but that still doesnot compile. I've switched to using local variable instead(although more local definitions, but easier to get it work anyway)
Maybe we can get Doug (the one who made the Bundled Properties) to comment on this...
Cheers, Stephan
Simplified sample as follows, produced the error.
#include
participants (2)
-
Shufei Fan
-
Stephan Diederich