Specialized information about Composite Numerical Types which allows us to define appropriate templatized classes using them.
More...
Classes |
struct | Result |
struct | Substitute |
Public Types |
enum | {
NRows = K::NRows,
NCols = K::NCols,
RowSpacing = K::RowSpacing,
ColSpacing = K::ColSpacing,
NPackedElements = K::NPackedElements,
NActualElements = K::NActualElements,
NActualScalars = K::NActualScalars,
ImagOffset = K::ImagOffset,
RealStrideFactor = K::RealStrideFactor,
ArgDepth = K::ArgDepth,
IsScalar = K::IsScalar,
IsULessScalar = K::IsULessScalar,
IsNumber = K::IsNumber,
IsStdNumber = K::IsStdNumber,
IsPrecision = K::IsPrecision,
SignInterpretation = K::SignInterpretation
} |
typedef K | T |
typedef K::TNeg | TNeg |
typedef K::TWithoutNegator | TWithoutNegator |
typedef K::TReal | TReal |
typedef K::TImag | TImag |
typedef K::TComplex | TComplex |
typedef K::THerm | THerm |
typedef K::TPosTrans | TPosTrans |
typedef K::TSqHermT | TSqHermT |
typedef K::TSqTHerm | TSqTHerm |
typedef K::TElement | TElement |
typedef K::TRow | TRow |
typedef K::TCol | TCol |
typedef K::TSqrt | TSqrt |
typedef K::TAbs | TAbs |
typedef K::TStandard | TStandard |
typedef K::TInvert | TInvert |
typedef K::TNormalize | TNormalize |
typedef K::Scalar | Scalar |
typedef K::ULessScalar | ULessScalar |
typedef K::Number | Number |
typedef K::StdNumber | StdNumber |
typedef K::Precision | Precision |
typedef K::ScalarNormSq | ScalarNormSq |
Static Public Member Functions |
static const Scalar * | getData (const T &t) |
static Scalar * | updData (T &t) |
static const TReal & | real (const T &t) |
static TReal & | real (T &t) |
static const TImag & | imag (const T &t) |
static TImag & | imag (T &t) |
static const TNeg & | negate (const T &t) |
static TNeg & | negate (T &t) |
static const THerm & | transpose (const K &t) |
static THerm & | transpose (K &t) |
static const TPosTrans & | positionalTranspose (const K &t) |
static TPosTrans & | positionalTranspose (K &t) |
static const TWithoutNegator & | castAwayNegatorIfAny (const T &t) |
static TWithoutNegator & | updCastAwayNegatorIfAny (T &t) |
static ScalarNormSq | scalarNormSqr (const K &t) |
static TSqrt | sqrt (const K &t) |
static TAbs | abs (const K &t) |
static TStandard | standardize (const K &t) |
static TNormalize | normalize (const K &t) |
static TInvert | invert (const K &t) |
static K | getInfinity () |
static K | getNaN () |
static bool | isNaN (const K &t) |
| This is true if any element contains a NaN anywhere.
|
static bool | isInf (const K &t) |
| This is true if at least one element contains a +Infinity or -Infinity and no element contains a NaN.
|
static bool | isFinite (const K &t) |
| This is true only if no element has any entry that it NaN or Infinity.
|
template<class K2 > |
static bool | isNumericallyEqual (const K &t1, const K2 &t2) |
| CNTs are expected to support an "==" operator for exact, bitwise equality.
|
template<class K2 > |
static bool | isNumericallyEqual (const K &t1, const K2 &t2, double tol) |
static double | getDefaultTolerance () |
template<class K>
class SimTK::CNT< K >
Specialized information about Composite Numerical Types which allows us to define appropriate templatized classes using them.
Transpose is particularly tricky -- we insist on Hermitian transpose meaning the elements must also be transposed and complex subelements must be conjugated.
This class exists because the built-in scalar types don't have the members we need. CNT<> is specialized for those types only; it is just a pass-through for the rest. The idea is to capture everything that has to be specialized here rather than in the template classes which use these types.
template<class K>
template<class K2 >
static bool SimTK::CNT< K >::isNumericallyEqual |
( |
const K & |
t1, |
|
|
const K2 & |
t2 |
|
) |
| [inline, static] |
CNTs are expected to support an "==" operator for exact, bitwise equality.
This method implements approximate, numerical equality. For scalar types, this should boil down to the isNumericallyEqual() scalar method. For 2D composite types, the default tolerance should be loosened from the element's default tolerance by the shorter of the two dimensions. For example, if element E's default numerical tolerance is tol, then a Mat<3,5,E>'s default tolerance should be 3*tol.