Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-01-14 14:28:21


On Thu, 10 Jan 2002, David Abrahams wrote:

david.> Shouldn't the adjacency_matrix documentation specify what the
david.> vertices_size_type is? For all I can tell, it's a unsigned char and I won't
david.> be able to create an adjacency_matrix with more than 256 nodes... ;-)
david.>
david.> But seriously, folks, even the standard containers use size_t by default...

adjacency_matrix uses the size_type of the std::vector that is used inside
for the implementation. The C++ std leaves the size_type of std::vector
implementation defined.

david.> Also, wouldn't this be one of the few good applications of vector<bool> in
david.> the case that there are no edge properties?

If you want to optimize for space instead of speed. I chose speed and
explicitly used char instead of bool in the case where there are no edge
properties. Another template parameter for adjacency_matrix would allow
the user to choose between the two options...

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