Main Page | Related Pages

Documentation of Quantities - A Collection of C++ Classes to Handle Quantity Calculus in C++ (preliminary)

Version 1.2.1

Author:
Bernd Speiser, Institut für Organische Chemie, Universität Tübingen, Auf der Morgenstelle 18, D-72076 Tübingen, Germany; e-mail: bernd.speiser@uni-tuebingen.de

Introduction

This is at present only a VERY limited documentation. Work is in progress to give more details.

Some more information can be found in the README files, and in the user manual.

Please contact the author of the program at bernd.speiser@uni-tuebingen.de if you have specific questions about the software.

Quantities is a package of classes and some test programs which implement quantity calculus within C++ classes. The classes provide the ability to use objects that do not only have a value but also (among others) a dimension and a unit in calculations just a you can use doubles or ints in a classical C++ program.

Such an ability should be advantageous in various types of scientific calculations, where the value of a quantity is given in a certain unit. This value does change if we substitute the unit to another one, which is conventionally used for this type of quantity. Furthermore, with these constructs it can be assured that the result of a calculation with certain quantities is commensurable with the quantity to which it is desired to be assigned. Commensurability takes into account the dimension of the target quantity and the dimensions of the source quantities.

The basis for Quantities is the SI (Système International d'Unités).

Related software: units, SIUnits, ...

The Quantities package consists of two parts:

How to Get Quantities

You can download the code of Quantities from the sourceforge web site (http://sourceforge.net) through project quantity (http://sourceforge.net/projects/quantity).

The repository provides both packages and cvs development code.

The packages represent various stages of the software. After installation they should work without major problems, although these can never be excluded totally.

The cvs code is under development. New versions are uploaded frequently. Although it does contain additional features, it must also be expected that there are major bugs. Thus, the cvs code should only be downloaded by experienced users.

For both packages and cvs code you will need the Quantities package AND the BSUtilities package. The latter does provide some basic utility functions.

Prerequisites for the Installation

You will need to have installed A. Alexandrescu's Loki library (see http://www.sourceforge.net/projects/loki-lib). Version 0.1.3 is recommended. Make sure that you use the library (libloki) generated by the Loki make process, since the .cpp of the Loki code are NOT added to the makefile (see Loki README).

You will need some utility tools, which are collected in a package BSUtilities (version >= 0.5). Download (http://sourceforge.net/projects/quantity) and install this package according to the instructions given there.

Installation

  1. Meet the prerequisites listed above.
  2. Set the environment variables according to your BSUtilities installation (see above) and to point to your Loki library installation (see above). The suffix 'LIB' means the location of libraries, the suffix 'SRC' means the location of headers. For example, with the tcsh shell use a command such as setenv BSUTILITIESLIB /home/user1/software/lib. These environment variables have to be set to sensible values whenever you compile the package. As a developer you may want to set the environment variable in your .cshrc file.
  3. Download to any directory of your choice. If using the package and this directory is _dir_, the distribution will later reside in _dir_/Quantities-${VERSION}.
  4. In _dir_, set a link to the version specific directory:
    ln -s Quantities-${VERSION} Quantities
    If such a link already exists, remove it before creating the new link.
  5. If using the package, uncompress (gunzip) and unpack (tar xf) the file. You may use "tar xzf".
  6. Go to the main distribution directory.
  7. Configure the makefiles for the installation (see also generic installation instructions in the file INSTALL in the distribution directory):

    ./configure options

    some options are noted here:

    ./configure --prefix=/<installDirectory> to choose a installation directory (default is /usr/local ).

    ./configure --enable-debug to build the libraries and tests with debugging informations. Default is to build without debugging information.

    ./configure --enable-optimize to build the libraries and tests with optimized code. Default is to build non-optimized code. Optimization my take a long time, especially if one compiles the QuantityTest program.

    ./configure --enable-Werror to build the libraries and tests with warnings regarded as errors. This should result in much cleaner code and is recommended during development. Default is to build without this stricter testing of code.

    type ./configure --help for more options,

    Note that you can (and possibly should) combine several of these options, e.g. you can type

    ./configure --prefix=/<installDirectory> --enable-optimize

    to create optimized code which is installed in the given installDirectory.

  8. compile the package

    make

  9. compile the local documentation (optional, but strongly recommended)

    make doc (optional, but strongly recommended)

    You need an installation of the doxygen program for this, see http://www.doxygen.org. This will invoke doxygen to generate a html and latex documentation. The files are then located in the respective documentation directories of the source tree. Point your browser at file:///_dir_/Quantities-${VERSION}/documentation/html/index.html

    If the documentation resides on a remote machine which has a web server running, and you have access to your user public_html directory, set a link in public_html to _dir_/Quantities-${VERSION}. Then point your browser at http://remote_machine/~user/link_name/documentation/html/index.html.

    If you work with a package, you may access on line documentation through (to be written)

  10. complete the installation

    make install

    this will install the libraries and binaries into the install directory specified with the --prefix option to configure (default /usr/local)

  11. clean up (optional)

Current Version

Current version (in work) is version 1.2.

Version 1.1 was a revised update of Version 1.0, with many extensions.

Version 1.0 was a major update from earlier versions. In particular many runtime improvements have been added by moving checks to compile time. This has been accomplished using static metaprogramming constructs. The GNU mp package for multiprecision arithmetic is no longer needed. Unfortunately, some changes in the user interface had to be introduced (see Changes to the user interface and low level changes).

The present version additionally has been improved internally (see also Changes to the user interface and low level changes).

Some limitations of the code are discussed at limitations.

You can see some parts of the package at work in the EChem++ software, for example the ExcitationFunction classes.

Further Documentation

The user manual describes the practical use of the package, while the technical descriptions of Quantity and PhysicalQuantities give details of the design and implementation.

The user manual is also generated when making the doxygen documentation.

Acknowledgements

Thanks to Kai Ludwig for many helpful discussions and contributions to the code.
Generated on Mon Feb 12 18:48:36 2007 for Quantities by doxygen 1.3.6