Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2003-01-29 10:30:51


Hi Volodya,

On Wed, 29 Jan 2003, Vladimir Prus wrote:
ghost>
ghost> Oh.. I only now realized how to use ReabablePropertyGraph concept:
ghost>
ghost> function_requires< ReadablePropertyGraphConcept<G, edge, edge_weight_t> >();
ghost>
ghost> Are you suggesting that this become
ghost>
ghost> function_requires< EdgePropertyGraphConcept<G, edge_weight_t> >();
ghost>
ghost> and the same split done to PropertyGraphConcept and LvaluePropertyGraphConcept?

I'm not so sure that change is worth it because the Edge/Vertex versions
would look exactly the same except for name unless I am mistaken.

ghost> I agree. The type basically is a structure, which fields are not named in a
ghost> regular C++ way, but are identified by type. A subscript operator can take the
ghost> "tag" type and return the value (or reference to it). Lookings at the code,
ghost> it seems like this is actually implemented.
ghost> BTW the following code does not compile for me at the moment. Is it correct?
ghost>
ghost> typedef adjacency_list<vecS, vecS, property<vertex_name_t, int,
ghost> property<vertex_distance_t, int> > > G;
ghost>
ghost> vertex_property<G>::type p;
ghost> // p[vertex_edge_t()] = 10;

No, operator[] is not supported for the property class, though it is
supported for property maps (I know, the naming here is a bit confusing).

ghost> I think the best approach would be to make this concept explicit, and
ghost> independent from BGL. Something like
ghost>
ghost> type_indexed_container<
ghost> mpl::list<
ghost> pair<vertex_name_t, int >,
ghost> pair<vertex_distance_t, int> > > c;
ghost> c[vertex_name_t()] = 10;
ghost> I wonder if something like this already exists... I vaguely recall
ghost> someone was doing that.

Yes, Emily Winch was working on this, and I thought she was going to
submit to boost. The following URL has a paper she wrote about this.

http://www.oonumerics.org/tmpw01/schedule.html

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk