Boost logo

Boost :

From: Deane Yang (deane_yang_at_[hidden])
Date: 2004-01-04 21:44:23


David B. Held wrote:

> Isn't it about
> expressing the solution in the problem domain? Physicists write
> equations with Joules and Watts, not just N m and lbs.-ft./s.
>

I think this summarizes well what I am asking for and why I think
the physicists who are trying to build a dimensions/units library
are going off track.

It is certainly true that physicists have found that (almost?) all
physical quantities can be expressed in terms of 7 fundamental
dimensions and that this observation is very powerful when reconciling
calculations involving different physical quantities.

But it is NOT true that you need to know this for any physical
calculation. For example, a computation that involves only joules and
seconds and no other physical quantities requires no knowledge of
what the fundamental physical dimensions are and how they relate to
joules.

So if you are writing code carrying out this computation, using a
full-blown physical dimensions library is complete overkill.
And, given some of the implementations that have been proposed, there is
a real cost, too.

On the other hand, the units library I want would allow the programmer
to define ONLY the units joules and seconds, and it would make sure that
computations involving seconds, joules, joule-seconds, joules/second,
joules/second^2, etc. are logically consistent.

If this computational module needs to interact with another module that
for some reason uses minutes instead of seconds, then the units library
can make sure that the proper conversion is made in the interface.

This would be a much simpler library than the physical dimensions
library, but it would be much more useful and more widely applicable
library. It can also be used to build the physical dimensions library,
too. In fact, I believe that what I am asking for lies at the core of
every physical dimensions library being proposed. All I am asking is
that core piece be extracted and made into a standalone library. If you
do that, I believe that you will be doing the full C++ community a
service, instead of only those who write physics-related software.


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