Simbody  3.7
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

◆ T

template<class K>
typedef K SimTK::CNT< K >::T

◆ TNeg

template<class K>
typedef K::TNeg SimTK::CNT< K >::TNeg

◆ TWithoutNegator

template<class K>
typedef K::TWithoutNegator SimTK::CNT< K >::TWithoutNegator

◆ TReal

template<class K>
typedef K::TReal SimTK::CNT< K >::TReal

◆ TImag

template<class K>
typedef K::TImag SimTK::CNT< K >::TImag

◆ TComplex

template<class K>
typedef K::TComplex SimTK::CNT< K >::TComplex

◆ THerm

template<class K>
typedef K::THerm SimTK::CNT< K >::THerm

◆ TPosTrans

template<class K>
typedef K::TPosTrans SimTK::CNT< K >::TPosTrans

◆ TSqHermT

template<class K>
typedef K::TSqHermT SimTK::CNT< K >::TSqHermT

◆ TSqTHerm

template<class K>
typedef K::TSqTHerm SimTK::CNT< K >::TSqTHerm

◆ TElement

template<class K>
typedef K::TElement SimTK::CNT< K >::TElement

◆ TRow

template<class K>
typedef K::TRow SimTK::CNT< K >::TRow

◆ TCol

template<class K>
typedef K::TCol SimTK::CNT< K >::TCol

◆ TSqrt

template<class K>
typedef K::TSqrt SimTK::CNT< K >::TSqrt

◆ TAbs

template<class K>
typedef K::TAbs SimTK::CNT< K >::TAbs

◆ TStandard

template<class K>
typedef K::TStandard SimTK::CNT< K >::TStandard

◆ TInvert

template<class K>
typedef K::TInvert SimTK::CNT< K >::TInvert

◆ TNormalize

template<class K>
typedef K::TNormalize SimTK::CNT< K >::TNormalize

◆ Scalar

template<class K>
typedef K::Scalar SimTK::CNT< K >::Scalar

◆ ULessScalar

template<class K>
typedef K::ULessScalar SimTK::CNT< K >::ULessScalar

◆ Number

template<class K>
typedef K::Number SimTK::CNT< K >::Number

◆ StdNumber

template<class K>
typedef K::StdNumber SimTK::CNT< K >::StdNumber

◆ Precision

template<class K>
typedef K::Precision SimTK::CNT< K >::Precision

◆ ScalarNormSq

template<class K>
typedef K::ScalarNormSq SimTK::CNT< K >::ScalarNormSq

Member Enumeration Documentation

◆ anonymous enum

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

◆ getData()

template<class K>
static const Scalar* SimTK::CNT< K >::getData ( const T t)
inlinestatic

◆ updData()

template<class K>
static Scalar* SimTK::CNT< K >::updData ( T t)
inlinestatic

◆ real() [1/2]

template<class K>
static const TReal& SimTK::CNT< K >::real ( const T t)
inlinestatic

◆ real() [2/2]

template<class K>
static TReal& SimTK::CNT< K >::real ( T t)
inlinestatic

◆ imag() [1/2]

template<class K>
static const TImag& SimTK::CNT< K >::imag ( const T t)
inlinestatic

◆ imag() [2/2]

template<class K>
static TImag& SimTK::CNT< K >::imag ( T t)
inlinestatic

◆ negate() [1/2]

template<class K>
static const TNeg& SimTK::CNT< K >::negate ( const T t)
inlinestatic

◆ negate() [2/2]

template<class K>
static TNeg& SimTK::CNT< K >::negate ( T t)
inlinestatic

◆ transpose() [1/2]

template<class K>
static const THerm& SimTK::CNT< K >::transpose ( const K &  t)
inlinestatic

◆ transpose() [2/2]

template<class K>
static THerm& SimTK::CNT< K >::transpose ( K &  t)
inlinestatic

◆ positionalTranspose() [1/2]

template<class K>
static const TPosTrans& SimTK::CNT< K >::positionalTranspose ( const K &  t)
inlinestatic

◆ positionalTranspose() [2/2]

template<class K>
static TPosTrans& SimTK::CNT< K >::positionalTranspose ( K &  t)
inlinestatic

◆ castAwayNegatorIfAny()

template<class K>
static const TWithoutNegator& SimTK::CNT< K >::castAwayNegatorIfAny ( const T t)
inlinestatic

◆ updCastAwayNegatorIfAny()

template<class K>
static TWithoutNegator& SimTK::CNT< K >::updCastAwayNegatorIfAny ( T t)
inlinestatic

◆ scalarNormSqr()

template<class K>
static ScalarNormSq SimTK::CNT< K >::scalarNormSqr ( const K &  t)
inlinestatic

◆ sqrt()

template<class K>
static TSqrt SimTK::CNT< K >::sqrt ( const K &  t)
inlinestatic

◆ abs()

template<class K>
static TAbs SimTK::CNT< K >::abs ( const K &  t)
inlinestatic

◆ standardize()

template<class K>
static TStandard SimTK::CNT< K >::standardize ( const K &  t)
inlinestatic

◆ normalize()

template<class K>
static TNormalize SimTK::CNT< K >::normalize ( const K &  t)
inlinestatic

◆ invert()

template<class K>
static TInvert SimTK::CNT< K >::invert ( const K &  t)
inlinestatic

◆ getInfinity()

template<class K>
static K SimTK::CNT< K >::getInfinity ( )
inlinestatic

◆ getNaN()

template<class K>
static K SimTK::CNT< K >::getNaN ( )
inlinestatic

◆ isNaN()

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

This is true if any element contains a NaN anywhere.

◆ isInf()

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.

◆ isFinite()

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.

◆ isNumericallyEqual() [1/2]

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.

◆ isNumericallyEqual() [2/2]

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

◆ getDefaultTolerance()

template<class K>
static double SimTK::CNT< K >::getDefaultTolerance ( )
inlinestatic

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