[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | 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 (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.9.0 (Tue Nov 6 2012)