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 User Interface and Low Level Changes).
The present version additionally has been improved internally (see also User Interface and Low Level Changes).
We will define the term `user level interface changes' to changes done in such components of Quantities
that are mostly accessed by the end user of the package, while `low level interface changes' deal with improvements of functions that are not normally included in user code directly. Implementation changes leave the overall interface of the package intact. Changes to the build process do not change the code at all, but rather how the package is compiled before use.
Current stable version is version 1.2.2.
Current development version is version 1.2.2+.
This list is in reverse chronological order.
- Changes in Version 1.2.2+
- Implementation changes
- To be compatible with the installed file layout as defined in version 1.2.2, all include directives have been adapted to include the full path of the header file starting from
Quantities
. NameString
and SymbolString
are no longer static constants in QuantityTraits and DerivedQuantityTraits, but rather static functions to avoid static initialization problems.- Some name changes:
- ListUnitSymbols -> AllUnitSymbols
- CheckAgainstAllUnits -> ValidUnit
- Standardize -> Standard (the old template Standard was removed before; Standard better compares to Reverse)
- standardize -> standard (standrad better compares to reverse)
- ratio -> StandardFactor
- functionality with respect to Units (these changes make the unit implementation incompatible with earlier versions on a level below user level - used defined units must be adapted to the new implementation!):
- added UnitSymbols, keeping AllUnitSymbols; the first lists the non-expanded forms of all units, the latter lists all the units inclusively the expanded ones.
- added Prefixes typelist to Prefix.h; a typelist including all possible prefixes.
- added ExpandPrefixableSymbols templates; expands the symbol of a prefixable unit into all prefixed symbols.
- added ValidPrefixedUnit recursive template.
- dynamic_standardize() and dynamic_reverse() function templates changed into standardize() and reverse(). No longer using typeid(), rather identify unit by its symbol.
- removed DefaultUnitTemplate and UnitsTemplate; deleted superfluous double definitions of some types (DefaultUnit vs. DU, etc.).
- removed UnitIndexBySymbol
- removed CheckUnits, which did not work properly anyway. Units are statically checked as descendants of a base unit separately, e.g. when used as storage unit or default unit. Moreover, unit checking is done upon transformation (template ValidUnit).
- disentangled very involved specializations of Composed unit template; made into a recursive template.
- all unit combinations of the components can be used in a composed unit rather than a limited selection as before
- composed unit can have a composed component
- for dynamic standardization/reverse standardization, units symbols are parsed with boost::spirit. This allows more complex grammar. For example, in composed units, alternative formulations may be possible for components that can be interpreted in different ways: m^2 kg^-1 is interpreted as length unit squared divided by mass unit (m^2) kg^-1 is interpreted as area unit divided by mass unit for specific area units.
- various consistency checks within composition of units:
- number of elements and number of constituting units
- during dynamic use:
- correctness of exponents
- number of components in symbol
- `exactness' is a property of the unit, and no longer provided through template Standard<>; it can be accessed statically (static bool IsExact()) or dynamically (virtual function bool isExact(void) const)
- also, the standard ratio is now defined for a particular unit; presently, the ratio is defined as a double, for use with other storage types, it must possibly be converted. Renamed to StandardFactor.
- access to the StandardFactor is through static member function Factor only; dynamic access is no longer possible/
- access to the StandardFactor is through static member function Factor only; dynamic access is no longer possible/
- template Standard<> removed (and Standardized renamed to Standard).
- deleted superficial base classes Units and Quantities.
- moved all standardization code from namespace quantity to namespace unit
- unit symbol lists have been removed; this might reappear if we need some symbol information for the GUI in some way.
- functionality with respect to quantities
- special quantity values (unity, zero, not-a-number, and infinity) implemented
- Changes to the user interface
- VariableVector as a std::vector including iterators, with only a few differences.
- Quantities::Quantities::Version () is no longer available, use macro QUANTITIES_VERSION
- reduced run-time functionality, e.g., function isSI () has been deleted
- UnitMismatch has been moved to namespace unit::
- Changes to the build system
- To be consistent with the "file layout" mentioned in Implementation Changes, the include path in AM_CPPFLAGS now starts with
$(top_srcdir)/..
, which is one directory level above the Quantities
directory. - Added an --enable-onlydoc option to configure.
- Made the naming of configure options regarding BSUtilities consistent: --enable-BSUtilities_version and --enable-BSUtilities_libtag were changed to --enable-BSUtilities-version and --enable-BSUtilities-libtag, respectively.
- Changes from Version 1.2.1 to 1.2.2
- Implementation changes
- Various bug fixes detected by recent gcc versions (tested with gcc version 4.3.2).
- Traits template classes for base (QuantityTraits) and derived (DerivedQuantityTraits) quantities, listing details of the quantities, including name, symbol etc. This allows to distinguish between various derived quantities from a single base quantity by the traits class, but also to derived various UniqueConstants from a single base quantity. This also decreases the number of template parameters used considerably, and also the compiler time to process them.
- The traits templates also allow the definition of name and symbol in a flexible way: QuantityTraits defines name and symbol for the base quantities, which can be overwritten by DerivedQuantityTraits, depending on the values of OverwriteName and OverwriteSymbol.
- Deleted ABQ and PQ template parameters.
- New SameDimensioned implementation using a primary template (in Quantity.h). This is then specialized with Quantity<> or M<Quantity<>,...> parameters.
- Simplified class hierarchy in Dimension, base class deleted.
- Moved Equal into Dimension class.
- further details (to be written ...)
- new GenericUnitBase template
loki
included in #include
directives for loki headers.- Deleted some obsolete or superfluous
#include
directives. - Relocated exp/log/trigonometric functions to Variable.h, formulated as macros. These functions return a generated quantity to allow assignment to a pure number object - of course the return from each of these functions is a pure number.
- Macros are also used in PlaneAngle for specialized helpers (conversion into rad unit).
- Low level interface changes
- The names of templates AllUnits and Default Unit have been changed to AllUnitsTemplate and DefaultUnitTemplate, respectively, to avoid naming problems.
- new specialization of Standard<> template, to allow `in-line' definitions of Variable types without explicit definition of a new Standard<>.
- Several UniqueConstants can be derived from ONE base quantity, and they are defined by the DerivedQuantityTraits traits template.
- Dimension provides compile time acces to the defining rational numbers, numerators, and denominators in natural and canonical form.
- Extended comparison for Dynamic quantities:
- different storage type
- dynamic right-hand side
- Copy constructor from any source quantity to a generated target variable.
- User level interface changes
- Serialization of Quantities included. This substitutes the XML save/load mechanism started in Version 1.2.1.
- Dedimensionalization was deleted owing to its huge overhead when serializing.
- Deleted header PhysicalQuantities.h which included all header of the various physical quantities. Add individual quantity headers as needed in your code.
- Similar for Quantities.h and GeneralQuantities.h.
- Deleted Unit.cc and Dimension.cc which both contained only empty namespaces.
- Included a file version.h, which defines the Quantities version through a macro QUANTITIES_VERSION. Removed version member functions.
- Added MathematicalQuantities.
- Added TemperatureConversion.h with all conversion functions of temperature scales.
- Added new physical quantities: ElementaryCharge and ZeroOfCelsiusScale (both are UniqueConstants and closely related to ElectricCharge and ThermodynamicTemperature).
- Added a Variable constructor expecting the value, the name AND the symbol as arguments.
- Assignment to Variable from a C string and
std::string
. This only works if at least a value and a unit symbol are present in the string. If requested by ReadStatus, also a name, a symbol and an equal sign must be present. An InputError is thrown if these conditions are not fulfilled. - Pre- and postfix increment and decrement operators are included.
- Unary + and - operators have const return objects.
- Conversion within the set of derived quantities for a given base quantity can now be done by copy construction or by the use of the value (NU) member function (NU is a valid unit for this set).
- Special conversions between specified sets of quantities are supported through copy construction (e.g, for temperatures; given in TemperatureConversions.h). This also allows assignment and comparison.
- Changes of Concepts
- Strict adherence to the concept that values and units should always be used together. This results in the following changes
- no more value return with a unit type argument, rather a Variable based on the argument type is returned
- construction is only allowed from a value and unit information
- no more assignment from a double; use construction and assignment separately.
- assignment from a general object (non-quantity) is explicitly prohibited.
These changes may cause that some applications need program updates. - Removed concept of `parent quantity' in favor of `quantity type'. Deleted ABQ and PQ template parameters as a result.
- Changes to the Build System
- Test programs can be compiled with the -all-static flag generating statically linked executables. No dynamically linked test programs are then produced with
make check
. This does not affect the generation of shared and static libraries in parallel. Note that the test programs of the Quantities package can not be installed. The static test programs reside in the test directories, while dynamically linked programs are stored in the test/.libs directories with driver scripts in the respective test directory. - Improved detection of boost and loki headers and libraries, guided by --with-loki, --with-boost command line options to configure.
- BSUtilities path and version is also given on the configure command line with --with-BSUtilities and --with-BSUtilities_version.
- BSUtilities library features are indicated by --with-BSUtilities_libtag.
- Owing to the previous two changes, the environment variables LOKISRC, LOKILIB, BOOSTSRC, BOOSTLIB, BSUTILITIESSRC and BSUTILITIESLIB are now obsolete.
- During
make doc
links to the BSUtilities documentation are provided through the use of doxygen and the installdox utility, provided the BSUtilities documentation is installed in the place derived from the BSUtilities path and version information.
- Other changes
- The test programs have been divided into a number of smaller units owing to the excessive compilation time needed for all tests. New test programs were added.
- The test programs can be called to print a version.
- Installing headers.
- The user manual has been integrated into the main documentation tree generated by doxygen and the documentation has generally been updated and expanded. Also, the documentation has been largely expanded and upgraded.
- Changes from Version 1.2 to Version 1.2.1
- The code was adapted to gcc compiler version 4.1.2. An incompatibility with earlier compiler versions (for example, 3.3.3) makes two release versions (1-2-1 and 1-2-1-oldgcc) necessary. Make sure that you use the correct version for your compiler.
- The pow functions with static and dynamic exponents were re-implemented. No changes to the user interface should be introduced.
- Changes from Version 1.1 to Version 1.2
- Changed the quantity names of Digital and Empty (deleted `quantity').
- New compile time error message: VariableError.
- New compile time check: CheckVariableInVectorTuple.
- The concepts of parent quantity and abstract base quantity were more clearly separated. The former is the template parameter used for generation of a particular quantity. The quantities related to the parent quantity in this way have all different storage unit and different modes. The latter is the quantity used as base class for the derivation of a particular quantity. Thus, `abstract base quantity' is a purely technical concept, while `parent quantity' is a concept relating several quantities in a problem-specific way.
- Two extensions of the quantity concept were started: dedimensionalization and a save/load mechanism with XML support. Both are not yet usable and it is not recommended to rely on the code provided in the present version.
- bug fixes
- Changes from Version 1.0 to Version 1.1
- Concept changes
- An `abstract base quantity' is defined and distinguished from the `parent quantity'.
- Low level interface changes
- 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.
- 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.
- 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. - 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.
- 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.
- User level interface changes
- The installation procedure includes additional options and default settings:
- --disable-optimize, to switch off optimization; default: on; switching off is recommended during development.
- --enable-Werror, to switch on compiler option to regard warnings as errors; default: off; switching on is recommended during development, to get stricter testing and cleaner code.
- The static access to the information whether a quantity is dimensionless is now (consistent with other static status reporting facilities) a function.
- The namespace naming has been changed for PhysicalQuantities. The main namespace is Quantities, 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.
- The fmod function does now allow two generated transient quantity objects as arguments.
- The modf function does now allow two arguments of different type, as long as they are derived from the same parent quantity.
- The PlaneAngle physical quantity's trigonometric functions can be used for any storage type.
- 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.
- Direct assignment as from a char string is possible.
- The += and -= operators can not have generated quantity objects on the left hand side.
- 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.
- Other changes
- 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, however, for compiling Quantities, a version of Loki >= 0.1.3 will be needed.
- User interface changes with Version 1.0
- 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.
- The DimensionMismatch exception is now obsolete. Such mismatched are already detected at compile time, and can never occur in a running program.
- Input and output through functions in and out, and using pairs is now obsolete. Use VariableTuples constructs instead.
- If a unit is used in a constructor, such as in 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.
- 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.
- 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).
- The units named `atomic unit of ...' now have the common type name Atomic, each in its separate namespace, e.g. TimeUnits::Atomic.
- 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.
- The fabs() function is now obsolete. Use abs() instead, which is overloaded for various types in C++.
- 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.
- 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.
back to Quantities start page