Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2004-01-08 15:30:42


> This looks very nice so far, but I have one question: Why is <Y>
> attached to SI instead of:
>
> template<class Y>
> typename SI::quantity<Y>
> idealGasLaw(typename SI::pressure<Y> P,
> typename SI::volume<Y> V,
> typename SI::temperature<Y> T)
> {
> return (P*V/(8.314*(_joules/(_kelvin*_mole))*T));
> }
>
> as it is AFAICS not part of the SI-model to define the number-type. Or
> was this just a typo?

Not a typo, but also no particular reason that I can think of off the
top of my head. Let me think about this for a while. From my
standpoint, the specific details of the syntax are not crucial (though
I _hate_ the non-namespace pq_ decorated approach and, as I already
mentioned, vastly prefer full names to weird, terse abbreviations).

> Another question: Have you looked at my constant library? I think it
> could make a good companion of your library, reducing the above to
>
> return P * V / ( boost::chemistry::G * T );
>
> with a properly defined boost::chemistry::G and now being truly
> generic as it would even works for types Y than don't mix with
> doubles. If you are interested in exploring this or have questions
> about the constant library, drop me a private mail.

I have tracked the thread with some interest but haven't had a chance
to get into the meat of the library itself. From my brief look, it
does seem like there would be much to be gained from synergy between
the two libraries as physical constants with units are an extremely
natural application. When I get a chance, I'll take a closer look and
maybe we can keep in touch. I'd be happy to lend a hand with YANL if
you have questions. BTW, small quibble : at least in the US the ideal
gas constant symbol commonly used is R. It would be great to be able
to use boost::chemistry::R and so on and have it DTRT...

Matthias

------------------------------------------------------------------------
---------------------------
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