[C++-sig] Anyone tried BGL with BoostPython 2 yet?

eric jones eric at enthought.com
Tue Oct 1 10:14:30 CEST 2002


> 
> > From: "Robert Oschler" <robertoschler at hotmail.com>
> >> Anybody been adventurous enough to try the Boost Graph Library with
> Boost
> >> Python v 2?  Just wondering what I might be getting myself into
> >> (difficulty-wise).
> >>
> >> thx
> 
> From: "David Abrahams" <dave at boost-consulting.com>
> 
> 
> > People asked about this with Boost.Python v1, too. I think the
biggest
> > problem you'll find is that BGL is about compile-time genericity and
> Python
> > is about runtime genericity. You could easily  map the BGL's
genericity
> > into Python, but that'd be best done by rewriting it in Python. Of
> course,
> > then you'd give up most of the speed.
> >
> > Wrapping individual algorithms specialized to operate on specific
graph
> > structures with Boost.Python should be easy, of course, and the
> algorithms
> > would run fast. You could think about building graphs with internal
> > property maps that contain a boost::python::object for each
edge/vertex.
> > That might be an approach which allows some compromises.
> 
> Another interesting area to explore might be some kind of weave-like
> arrangement where C++ code for specific graph configurations is
generated
> and compiled on-the-fly as different Python graph structures are
passed to
> BGL algorithms.

This is likely possible.  I haven't look at BGL at all, but the process
you describe fits weave's mode of operation.

eric





More information about the Cplusplus-sig mailing list