Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-01-30 18:16:40


Terje Slettebø wrote:
> What's a dimension library? I.e. how might
> it look like, and be used (preferably a code example)? I've searched
> the Boost list for "dimension library"/"dimensions library", but your
> posting is the only one coming up.

This whole thread was started by question about
...\libs\mpl\doc\tutorial\dimensional-analysis.html which uses dimensional
analysis as an example of a possible application of mpl. In my view, this
tutorial is makes a great case for the utility of such a library and
explanation of how it might be implemented

> For example, if it only takes care of dimensional analysis (i.e.
> dimension calculations), how many dimensions should it have, if it's
> independent of units? If the answer is "user-configurable through
> typelists/vectors", have anyone done any compile-time timing of
> dimension calulation-heavy code using this approach, compared to a
> fixed set of dimensions?

I would expect that number of dimensions would be fixed a compile time.
Compile time will be noticebly slower for program modules that use such a
library. For applications where this presents a problem, a dimenstions
library along the lines discussed above wouldn't be helpful.

> Won't this bring us right back to the "how
> many dimensions"-discussion of a unit/quantity library?

if it were user configurable, I wouldn't think so. I would expect that such
a library would have a base implementation along with a higher layer
specifying a common set of dimensions. Anyone not happy the the chosen set,
he could just use the base layer and use his own set of dimensions. After
all, the base algorithms don't depend on what the dimensions mean.

Robert Ramey


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