Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2003-11-18 18:29:59


> Hi Matt I have had a look at your code and compiled on VC7.1 MSos with
> a
> couple of mods.

Cool - that's good news. Metrowerks pukes on it; a little too much
MPL, I guess.
I'm still mystified by the asymmetry between the normal and assignment
forms of the
constructor (commented out in test_units.cpp. Could you try
uncommenting those
statements in VC7.1 to see what pops out? I don't have access to that
compiler...

> template<class T>
> void write_typeid()
> {
> // std::system((std::string("c++filt ")+
> // std::string(typeid(T).name())).c_str());
> std::cout << typeid(T).name()<< std::endl;
> }

Yeah, sorry about that - gcc's typeid gives the mangled class name
which is about useless
for debugging complex MPL sequences.

> As far as the rest goes, the MPL stuff looks very impressive
> and I like the removal of dimensions with power 0.
> On that subject it would be nice once having arrived at a
> dimensionless pq
> to convert to the value_type direct.
> ie ideally a dimensionless pq is never constructed

Glad you like it; some parts were a bear to get right. At the moment,
I allow dimensionless
quantities to be implicitly converted to/from the underlying value
type. I like preserving
the dimensionlessness (d15s?) so that you can distinguish between raw
values and
types which result from evaluation of expressions containing
dimensioned quantities...

> If you wrote up documentation on that I would be interested and
> comparing my stuff with yours I have to admit that most on Boost will
> probably prefer yours... because its nice and technical :-)
> but to convey what youre doing it obviously needs documentation.

At this point I feel like the dimensional analysis part is pretty much
stable,
but I'm still working on schemes for the dimensioned quantities which
will
maximize flexibility. In particular, I'm trying to concoct a good way
to take
two disparate models and merge them - say you have one model with
length_tag, time_tag, and mass_tag and another with angle_tag, it would
be nice to be able to easily create a meta-model encompassing both...
I'm
also interested to hear what others are looking for in such a library.

> If you do set up a working group on units/d.a./pqs whatever I would be
> interested.

Will do.

> What I am trying to achieve is best summed up in this previous post.
>
> http://lists.boost.org/MailArchives/boost/msg55344.php
>
> Would be interesting to see how it would look with your scheme ?

I'm personally on the explicit conversion only side of the fence - the
idea of
setting up a system for intelligently determining the minimum required
precision
for the result of an arbitrary unit-containing expression sounds like
it would be
an interesting application for expression templates, though I suspect
it will be
very difficult to accomplish for general (rather than POD) value
types...

------------------------------------------------------------------------
---------------------------
Matthias Schabel, Ph.D.
Utah Center for Advanced Imaging Research
729 Arapeen Drive
Salt Lake City, UT 84108
801-587-9413 (work)
801-585-3592 (fax)
801-706-5760 (cell)
801-484-0811 (home)
mschabel at ucair med utah edu


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