Main Page | Related Pages

Changes to code the user interface since Versions < 1.0

User interphase changes with Version 1.0
  1. The package is configured for the use of the GNU autotools. Thus, configuration is more simple, and maybe even more platform independent. Makefile.am and configure.in as well as other necessary files are provided in the distribution.
  2. The DimensionMismatch exception is now obsolete. Such mismatched are already detected at compile time, and can never occur in a running program.
  3. Input and output through functions in and out, and using pairs is now obsolete. Use VariableTuples constructs instead.
  4. If a unit is used in a constructor, such as in
    Time t (5.0, Second ());
    where a variable of type Time and named t is defined to have the value 5 s (seconds), the unit must be given as an unnamed object of the unit type, in this case Second. Thus, the second argument to the Time constructor is generated by the unit's default constructor.
  5. The convention for type names of predefined units has slightly changed. Now all units start with a capital letter, as in Second, prefixed units have in addition the first letter of the base unit capitalized, as in MilliSecond.
  6. The name and the symbol of a quantity are no longer set by functions set_name and set_symbol. Rather use member functions name (string) and symbol (string).
  7. The units named `atomic unit of ...' now have the common type name Atomic, each in its separate namespace, e.g. TimeUnits::Atomic.
  8. The pow() function does now generate a result with the type generated automatically from the argument type, and the exponent. This is accomplished by compile time calculation of the result's dimension. In order to do this efficiently, the second argument of the pow function can no longer be a double variable. Rather a Rational<> number must be used (Rational<> numbers are defined in the BSUtilities header file TemplateTools.h, based on W. Brown's paper). A version of the pow() function with a double argument is currently being implemented.
  9. The fabs() function is now obsolete. Use abs() instead, which is overloaded for various types in C++.
  10. Natural constant, such as the Faraday constant are now SingletonConstants. There is need to construct these explicitly. They should only be accessed through the corresponsing macro, e.g. FARADAYCONSTANT.
  11. The syntax for enabling/disabling printing and reading of names and symbols (as well as reading of units) has changed. Use now objects of type PrintName<P> and PrintSymbol<P>, or ReadName<P>, ReadSymbol<P>, and ReadUnit<P> with P being true or false. Thus,
    cout << PrintSymbol<true>
    switches on symbol reading and
    cout << PrintSymbol<false>
    switches it off.

Changes from Version 1.0 to Version 1.1

  1. Low level interface changes
    1. The definition of factors for recalculation between units has been totally changed. These factors are now defined on the level of quantities rather than individual units. Consequently, code must be adapted. The standardization ratio is now given through a template Standard<>::ratio.
    2. There have been some name changes in Unit.h regarding the former compound units. These are now called ComposeBase, the former CompoundElements are now ComposeElements.
    3. The Dimension template has been changed. Rather than encoding the seven base rational numbers in a class Group, we have now seven template parameters, which must be BSUtilities::Rational<>s. The group type classes have been deleted alltogether.
      The Quantity template has a different order of parameters. The first parameter is now a Dimension, while the second is a dummy base unit class. This is internally used to distinguish various abstract unit base classes, from which the individual units are derived. Different Quantities should use different base unit classes.
    4. Various mathematical functions, which are not needed to have a this pointer and were up to now friends to the Variable, Constant, and UniqueConstant classes, have been moved to the level of namespace Quantities (e.g., abs, fmod, frexp, ldexp, ceil, floor). They can be employed for any Variable, Constant, or UniqueConstant, even for generated transient variables.
    5. In QuantityClusters, the name of the template RemVal (for erasing data from a VariableVectorTuple) was changed into EraVal. Also, the corresponding static member function's name was changed into eraval.
  2. User level interface changes
  3. The installation procedure includes additional options and default settings:
  4. The static access to the information whether a quantity is dimensionless is now (consistent with other static status reporting facilities) a function.
  5. The namespace naming has been changed for PhysicalQuantities. The main namespace is Quantites, but there is a separate namespace for each PhysicalQuantity. For PhysicalQuantity Xxx this is named xxx. This namespace contains the declarations and definitions of respective the Dimension, Units, and the Quantity. Declarations of the derived Variable, Constant, etc. classes is still in namespace quantity (formerly: Quantities). Note, that in general, it should only be necessary to change the scope qualifier for units from XxxUnit:: to xxx in user code.
  6. The fmod function does now allow two generated transient quantity objects as arguments.
  7. The modf function does now allow two arguments of different type, as long as they are derived from the same parent quantity.
  8. The PlaneAngle physical quantity's trigonometric functions can be used for any storage type.
  9. The pow function does now allow a second arguments of type int or double. Float exponents are also possible. The normal (use as
    pow(object, exp)
    ) and the alternative version (use as
    object.pow (exp)
    ) are provided. The type of the result of this function can not determined at compile time, but only at run time commensurability can be detected.
  10. Direct assignment like
    Time t = "1.0 s";
    from a char string is possible.
  11. The += and -= operators can not have generated quantity objects on the left hand side.
  12. In QuantityClusters, the QuantityVector access operations have been renamed to be compatible with the corresponding std:vector function names, in particular, the former add member function is now push_back or insert, respectively. The second form is invoked as insert (object, int). Also, member function length has been changed to size, and remove to erase.
  13. Other changes
    1. The use of version 0.1.3 of Alexandrescu's Loki library caused a rewrite of all typelist macros into LOKI_TYPELIST_NN. This should have no effect on outside users.

Generated on Sun Jan 15 14:05:19 2006 for Quantities by doxygen 1.3.6