Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-12-12 10:23:58

Phil Richards <news_at_[hidden]> writes:

> On 2003-12-12, David Abrahams <dave_at_[hidden]> wrote:
> [in reply to me saying:]
>> > The one worry I still have with the MPL approach when combined
>> > with the dimension-tagging approach you've taken is the compile-time
>> > performance - in its current form it is, frankly, unusable.
>> Did you try using mpl::vector instead of mpl::list?
> The problem isn't with mpl::list vs mpl::vector, I think.

If you're trying to use a fixed set of dimensions, mpl::vector can be
a *lot* more efficient than mpl::set, especially on implementations
with typeof() support.

> The problem is using a sequence type to do set operations -
> which is basically what Matthias does with his tagged
> rationals. I suspect most of his algorithms drop into
> O(n^2) (or worse) at compile time.
> The MPL list/vector is (probably) going to be fine for the fixed
> size dimensional analysis version but there is a bit of a
> learning curve involved... and I would have most likely used it
> if I could have got it to work. I just didn't have the patience,
> I'm afraid. (And I suspect it would be not much difference
> in compile-time performance to my current implementation.)

There is a set implementation in CVS; at least enough of one to get
some work done. See libs/mpl/test/set.cpp for usage.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at