[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

| Numeric and Promotion Traits |
--- | --- | ---

Meta-information about arithmetic types.

template<> struct NumericTraits<ArithmeticType>
  Unary traits for promotion, conversion, creation of arithmetic objects
template<> struct PromoteTraits<ArithmeticType1, ArithmeticType2>
  Binary traits for promotion of arithmetic objects template<> struct SquareRootTraits<ArithmeticType>
  Unary traits for the calculation of the square root of arithmetic objects template<> struct NormTraits<ArithmeticType>
  Unary traits for the calculation of the norm and squared norm of arithmetic objects

These traits classes contain information that is used by generic algorithms and data structures to determine intermediate and result types of numerical calculations, to convert between different representations of arithmetic types, and to create certain important constants of each type. Thus, algorithms and data structures operating that need arithmetic operations can be made more independent from the actual data representation.

NumericTraits are implemented as template specializations of one arithmetic type, while PromoteTraits are specialized for a pair of arithmetic types that shall be combined in one operation.

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)