template <unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
class FixedPointTraits<FixedPoint<IntBits1, FracBits1>, FixedPoint<IntBits2, FracBits2> >
{
typedef FixedPoint<PlusMinusIntBits, MaxFracBits> PlusType;
typedef FixedPoint<PlusMinusIntBits, MaxFracBits> MinusType;
typedef FixedPoint<IntBits1 + IntBits2, FracBits1 + FracBits2> MultipliesType;
};
template <unsigned IntBits, unsigned FracBits>
struct NumericTraits<FixedPoint<IntBits, FracBits> >
{
typedef FixedPoint<IntBits, FracBits> Type;
typedef Type ValueType;
typedef VigraFalseType isIntegral;
typedef VigraTrueType isScalar;
typedef VigraTrueType isSigned;
typedef VigraTrueType isOrdered;
typedef VigraFalseType isComplex;
...
};
template <unsigned IntBits, unsigned FracBits>
struct SquareRootTraits<FixedPoint<IntBits, FracBits> >
{
typedef FixedPoint<IntBits, FracBits> Type;
typedef FixedPoint<SRIntBits, SRFracBits> SquareRootResult;
typedef Type SquareRootArgument;
};
template <unsigned IntBits, unsigned FracBits>
struct NormTraits<FixedPoint<IntBits, FracBits> >
{
typedef FixedPoint<IntBits, FracBits> Type;
typedef typename
FixedPointTraits<FixedPoint<IntBits, FracBits>, FixedPoint<IntBits, FracBits> >::MultipliesType
SquaredNormType;
typedef Type NormType;
};
template <unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
struct PromoteTraits<FixedPoint<IntBits1, FracBits1>,
FixedPoint<IntBits2, FracBits2> >
{
typedef typename
FixedPointTraits<FixedPoint<IntBits1, FracBits1>, FixedPoint<IntBits2, FracBits2> >::PlusType
Promote;
};