dimnum 1.16 review

Download
by rbytes.net on

dimnum is a C++ template library for dimensional numbers. The dimnum C++ library provides templated classes for storage of dimensi

License: GPL (GNU General Public License)
File size: 182K
Developer: Kasper Peeters
0 stars award from rbytes.net

dimnum is a C++ template library for dimensional numbers.

The dimnum C++ library provides templated classes for storage of dimensional numbers, like lengths, masses, and so on. The classes are templated over the storage data type, and the base unit.

Output as well as input (with automatic recognition of the base unit) through standard C++ streams is supported. The dimension information is handled completely at compile time, so no additional memory is required for storage.

In both dimnum and SIunits, numbers are represented in a given base (ie. you can for instance declare a length object which is expressed in meters). In SIunits this base unit ("one meter") is fixed at compile time (ie. all values are represented in meters), while in dimnum it is a template parameter. In dimnum you can have (in one program) both values expressed in the SI basis and in, for instance, the British foot/inch/... basis, while in SIunits you have to make a choice.

Dimnum uses a different treatment of models in which dimensions 'merge' (for instance the 'high energy physics' model, in which the speed of light and Planck's constant are put equal to one). In dimnum models can be mixed, in SIunits you have to choose one.

Treatment of I/O differs (dimnum's method uses more static data where SIunits uses dynamical switches); a bit hard to explain in one or two lines.

Dimnum's actual code (i.e. excluding the constant lists and the dimensionful number declarations) is also a bit smaller.

dimnum 1.16 search tags