[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
Unary traits for the calculation of the square root of arithmetic objects.
#include <vigra/numerictraits.hxx>
This traits class is used to determine appropriate argument and result types for the function sqrt(). These traits are typically used like this:
ArithmeticType t = ...; SquareRootTraits<ArithmeticType>::SquareRootResult r = sqrt((SquareRootTraits<ArithmeticType>::SquareRootArgument)t);
This approach avoids 'ambigouos overload errors' when taking the square root of an integer type. It also takes care of determining the proper result of the sqrt() function of vigra::FixedPoint and of the norm() function, when it is implemented via sqrt(squaredNorm(x)). The following members are defined in SquareRootTraits<ArithmeticType>
:
| the type itself |
| required argument type for srqt(), i.e. |
| result of |
NormTraits for the built-in types are defined in #include <vigra/numerictraits.hxx>
Namespace: vigra
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|