|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2006-08-16 09:46:23
Hi Eric,
"Eric Lemings" <lemings_at_[hidden]> wrote in message
news:D730FF7CEDDCA64483F9E99D999A158B41FFD3_at_qxvcexch01.ad.quovadx.com...
> Greetings,
>
> I have been working on a rather ambitious dimensional analysis framework
> and units of measurement library suitable for inclusion with the Boost
> libraries. The interface is probably quite different from anything
> previously seen but hopefully it is more intuitive, flexible,
> and...well...appealing.
I'm not quite sure which way to take this. Does this mean that you consider the
Quan UI unsatisfactory and beyond repair?
http://www.sourceforge.net/projects/quan
FWIW We have been doing extensive work on Quan, though it is not yet released
but the latest code ( on two_param-branch in CVS) is now stable and tested on
VC7.1 and gcc4.0 .
In the next release the major change is a move from having three template
parameters in the fixed_quantity to just two.
These consist of a Concept named StaticUnit and another called NumericType.
The signature now looks like this:
quan::fixed_quantity<StaticUnit,NumericType> .
The documentation for the new system is lagging but a Concept checking function
for the StaticUnit Concept can be seen here:
The StaticUnit is opaque and accessed solely via free metafunctions.
This allows for a great deal of flexibility in the implementation. As an example
a very simple implementaion using an mpl::vector can be seen here:
The implementation is loosely based on the dimensional analysis example in David
Abrahams and Alexei Gurtovoys TMP book
The implementation can be seen here:
This implementation is of course additional to the default implementation which
is much more comprehensive.
It would be interesting to try to plug your Boost.Units code in to see if it
would work too.
The design and implementation are still in flux
> but most of the functionality is in place. Several Boost developers
> have advised me to post it here to solicit comments and feedback.
>
> The "preview" release can be found in the Units folder of the Boost
> Vault. The filename is units-preview.zip.
>
> Some quick notes. The Tutorial section of the documentation is probably
> the most important and complete section. The header files contain only
> some of the most commonly-used units. Plenty more will be be added in
> the future.
>
> I would greatly appreciate questions, comments, and/or suggestions
> regarding the overall design and interface. I plan to keep working on
> this library until it is ready for a formal Boost Units library
> proposal.
Tested in VC7.1 and VC8.0 of vthe two examples gave compile errors. Testing in
gcc 4.0 gave a failed assertion at runtime
Is the structure of a unit / conversion factor based on that in quan?. It
certainly looks very
similar.
I will be interested in seeing the updated code, and hopefully to see if it is
possible to plug it in to Quan.
regards
Andy Little
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk