On Wed, Aug 11, 2010 at 12:24 PM, Szabolcs Nagy <nsz_AT_port70.net> wrote:
> * Chidambaram Annamalai <quantumelixir_AT_gmail.com> [2010-08-11 03:26:22
> +0530]:
> > I didn't argue BGL was simple. But I'd certainly consider it elegant. Of
>
> no it's not elegant
>
> graph algorithms are too versatile to do elegantly what boost tries to do
> (eg boost tries to operate on a generic graph type which cannot work
> as different graph representations often require different algorithms
> also space-time and other important tradoffs cannot be expressed this way)
>
Have you even bothered to look through the sources? You really have
absolutely NO idea what you're talking about. The whole idea behind BGL is
to decouple the storage schemes from the algorithms so that you can write
O(M + N) code to support O(M*N) template instances. And there is no point if
this abstraction had a severe penalty on the runtime performance. BGL
exactly knows which algorithm to use for a particular storage mode because
intelligence is built into it using traits. The hierarchial design (which is
conceptually like OO inheritance) is to elimiate code bloat almost entirely,
by only instantiating template classes that are absolutely essential.
RTFM: http://portal.acm.org/citation.cfm?id=320385.320428
in bgl a shortest path algorithm has 12 arguments some of them are type
> parameters some of them are objects with various methods defined on them
> generic programming is mixed with oo inheritence all over the place
>
Template metaprogramming uses static polymorphism which is an entirely
different beast from OO inheritance that uses dynamic polymorphism.
Received on Wed Aug 11 2010 - 09:42:46 CEST
This archive was generated by hypermail 2.2.0 : Wed Aug 11 2010 - 09:48:02 CEST