Simbody  3.5
SimTK::CNT< K > Class Template Reference

Specialized information about Composite Numerical Types which allows us to define appropriate templatized classes using them. More...

+ Inheritance diagram for SimTK::CNT< K >:

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 ScalargetData (const T &t)
 
static ScalarupdData (T &t)
 
static const TRealreal (const T &t)
 
static TRealreal (T &t)
 
static const TImagimag (const T &t)
 
static TImagimag (T &t)
 
static const TNegnegate (const T &t)
 
static TNegnegate (T &t)
 
static const THermtranspose (const K &t)
 
static THermtranspose (K &t)
 
static const TPosTranspositionalTranspose (const K &t)
 
static TPosTranspositionalTranspose (K &t)
 
static const TWithoutNegatorcastAwayNegatorIfAny (const T &t)
 
static TWithoutNegatorupdCastAwayNegatorIfAny (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. More...
 
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. More...
 
static bool isFinite (const K &t)
 This is true only if no element has any entry that it NaN or Infinity. More...
 
template<class K2 >
static bool isNumericallyEqual (const K &t1, const K2 &t2)
 CNTs are expected to support an "==" operator for exact, bitwise equality. More...
 
template<class K2 >
static bool isNumericallyEqual (const K &t1, const K2 &t2, double tol)
 
static double getDefaultTolerance ()
 

Detailed Description

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.

Member Typedef Documentation

template<class K>
typedef K SimTK::CNT< K >::T
template<class K>
typedef K::TNeg SimTK::CNT< K >::TNeg
template<class K>
typedef K::TWithoutNegator SimTK::CNT< K >::TWithoutNegator
template<class K>
typedef K::TReal SimTK::CNT< K >::TReal
template<class K>
typedef K::TImag SimTK::CNT< K >::TImag
template<class K>
typedef K::TComplex SimTK::CNT< K >::TComplex
template<class K>
typedef K::THerm SimTK::CNT< K >::THerm
template<class K>
typedef K::TPosTrans SimTK::CNT< K >::TPosTrans
template<class K>
typedef K::TSqHermT SimTK::CNT< K >::TSqHermT
template<class K>
typedef K::TSqTHerm SimTK::CNT< K >::TSqTHerm
template<class K>
typedef K::TElement SimTK::CNT< K >::TElement
template<class K>
typedef K::TRow SimTK::CNT< K >::TRow
template<class K>
typedef K::TCol SimTK::CNT< K >::TCol
template<class K>
typedef K::TSqrt SimTK::CNT< K >::TSqrt
template<class K>
typedef K::TAbs SimTK::CNT< K >::TAbs
template<class K>
typedef K::TStandard SimTK::CNT< K >::TStandard
template<class K>
typedef K::TInvert SimTK::CNT< K >::TInvert
template<class K>
typedef K::TNormalize SimTK::CNT< K >::TNormalize
template<class K>
typedef K::Scalar SimTK::CNT< K >::Scalar
template<class K>
typedef K::ULessScalar SimTK::CNT< K >::ULessScalar
template<class K>
typedef K::Number SimTK::CNT< K >::Number
template<class K>
typedef K::StdNumber SimTK::CNT< K >::StdNumber
template<class K>
typedef K::Precision SimTK::CNT< K >::Precision
template<class K>
typedef K::ScalarNormSq SimTK::CNT< K >::ScalarNormSq

Member Enumeration Documentation

template<class K>
anonymous enum
Enumerator
NRows 
NCols 
RowSpacing 
ColSpacing 
NPackedElements 
NActualElements 
NActualScalars 
ImagOffset 
RealStrideFactor 
ArgDepth 
IsScalar 
IsULessScalar 
IsNumber 
IsStdNumber 
IsPrecision 
SignInterpretation 

Member Function Documentation

template<class K>
static const Scalar* SimTK::CNT< K >::getData ( const T t)
inlinestatic
template<class K>
static Scalar* SimTK::CNT< K >::updData ( T t)
inlinestatic
template<class K>
static const TReal& SimTK::CNT< K >::real ( const T t)
inlinestatic
template<class K>
static TReal& SimTK::CNT< K >::real ( T t)
inlinestatic
template<class K>
static const TImag& SimTK::CNT< K >::imag ( const T t)
inlinestatic
template<class K>
static TImag& SimTK::CNT< K >::imag ( T t)
inlinestatic
template<class K>
static const TNeg& SimTK::CNT< K >::negate ( const T t)
inlinestatic
template<class K>
static TNeg& SimTK::CNT< K >::negate ( T t)
inlinestatic
template<class K>
static const THerm& SimTK::CNT< K >::transpose ( const K &  t)
inlinestatic
template<class K>
static THerm& SimTK::CNT< K >::transpose ( K &  t)
inlinestatic
template<class K>
static const TPosTrans& SimTK::CNT< K >::positionalTranspose ( const K &  t)
inlinestatic
template<class K>
static TPosTrans& SimTK::CNT< K >::positionalTranspose ( K &  t)
inlinestatic
template<class K>
static const TWithoutNegator& SimTK::CNT< K >::castAwayNegatorIfAny ( const T t)
inlinestatic
template<class K>
static TWithoutNegator& SimTK::CNT< K >::updCastAwayNegatorIfAny ( T t)
inlinestatic
template<class K>
static ScalarNormSq SimTK::CNT< K >::scalarNormSqr ( const K &  t)
inlinestatic
template<class K>
static TSqrt SimTK::CNT< K >::sqrt ( const K &  t)
inlinestatic
template<class K>
static TAbs SimTK::CNT< K >::abs ( const K &  t)
inlinestatic
template<class K>
static TStandard SimTK::CNT< K >::standardize ( const K &  t)
inlinestatic
template<class K>
static TNormalize SimTK::CNT< K >::normalize ( const K &  t)
inlinestatic
template<class K>
static TInvert SimTK::CNT< K >::invert ( const K &  t)
inlinestatic
template<class K>
static K SimTK::CNT< K >::getInfinity ( )
inlinestatic
template<class K>
static K SimTK::CNT< K >::getNaN ( )
inlinestatic
template<class K>
static bool SimTK::CNT< K >::isNaN ( const K &  t)
inlinestatic

This is true if any element contains a NaN anywhere.

template<class K>
static bool SimTK::CNT< K >::isInf ( const K &  t)
inlinestatic

This is true if at least one element contains a +Infinity or -Infinity and no element contains a NaN.

template<class K>
static bool SimTK::CNT< K >::isFinite ( const K &  t)
inlinestatic

This is true only if no element has any entry that it NaN or Infinity.

template<class K>
template<class K2 >
static bool SimTK::CNT< K >::isNumericallyEqual ( const K &  t1,
const K2 &  t2 
)
inlinestatic

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.

template<class K>
template<class K2 >
static bool SimTK::CNT< K >::isNumericallyEqual ( const K &  t1,
const K2 &  t2,
double  tol 
)
inlinestatic
template<class K>
static double SimTK::CNT< K >::getDefaultTolerance ( )
inlinestatic

The documentation for this class was generated from the following file: