Simbody  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimTK::negator< N > Class Template Reference

negator<N>, where N is a number type (real, complex, conjugate), is represented in memory identically to N, but behaves as though multiplied by -1, though at zero cost. More...

#include <String.h>

Classes

struct  Result
 
struct  Substitute
 

Public Types

enum  {
  NRows = 1,
  NCols = 1,
  RowSpacing = 1,
  ColSpacing = 1,
  NPackedElements = 1,
  NActualElements = 1,
  NActualScalars = 1,
  ImagOffset = NTraits<N>::ImagOffset,
  RealStrideFactor = NTraits<N>::RealStrideFactor,
  ArgDepth = SCALAR_DEPTH,
  IsScalar = 1,
  IsULessScalar = 1,
  IsNumber = 0,
  IsStdNumber = 0,
  IsPrecision = 0,
  SignInterpretation = -1
}
 
typedef negator< N > T
 
typedef NUMBER TNeg
 
typedef NUMBER TWithoutNegator
 
typedef CNT< NReal >::TNeg TReal
 
typedef CNT< NImag >::TNeg TImag
 
typedef CNT< NComplex >::TNeg TComplex
 
typedef CNT< NHerm >::TNeg THerm
 
typedef negator< N > TPosTrans
 
typedef NTraits< N >::TSqHermT TSqHermT
 
typedef NTraits< N >::TSqTHerm TSqTHerm
 
typedef negator< N > TElement
 
typedef negator< N > TRow
 
typedef negator< N > TCol
 
typedef NTraits< N >::TSqrt TSqrt
 
typedef NTraits< N >::TAbs TAbs
 
typedef NTraits< N >::TStandard TStandard
 
typedef CNT< NInvert >::TNeg TInvert
 
typedef NTraits< N >::TStandard TNormalize
 
typedef negator< N > Scalar
 
typedef negator< N > ULessScalar
 
typedef NUMBER Number
 
typedef NTraits< N >::StdNumber StdNumber
 
typedef NTraits< N >::Precision Precision
 
typedef NTraits< N >::ScalarNormSq ScalarNormSq
 

Public Member Functions

const negator< N > * getData () const
 
negator< N > * updData ()
 
const TRealreal () const
 
TRealreal ()
 
const TImagimag () const
 
TImagimag ()
 
ScalarNormSq scalarNormSqr () const
 
TSqrt sqrt () const
 
TAbs abs () const
 
TStandard standardize () const
 
TNormalize normalize () const
 
TInvert invert () const
 
bool isFinite () const
 Returns true if the negated value is finite (i.e., not NaN or Inf). More...
 
bool isNaN () const
 Returns true if the negated value contains a NaN. More...
 
bool isInf () const
 Returns true if the negated value contains an Inf or -Inf and does not contain a NaN. More...
 
template<class T2 >
bool isNumericallyEqual (const T2 &t2) const
 In the generic case we'll perform the negation here to get a number, and then delegate to the other type which can be any CNT. More...
 
template<class N2 >
bool isNumericallyEqual (const negator< N2 > &t2) const
 In this partial specialization we know that both types have negators so we can just compare the underlying numbers, each of which has the reversed sign, using the global SimTK method available for comparing numbers. More...
 
template<class T2 >
bool isNumericallyEqual (const T2 &t2, double tol) const
 This is the generic case (see above) but with an explicitly-provided tolerance. More...
 
template<class N2 >
bool isNumericallyEqual (const negator< N2 > &t2, double tol) const
 This is the partially specialized case again (see above) but with an explicitly-provided tolerance. More...
 
 negator ()
 
 negator (const negator &n)
 
negatoroperator= (const negator &n)
 
 negator (int t)
 
 negator (const float &t)
 
 negator (const double &t)
 
 negator (const long double &t)
 
template<class P >
 negator (const std::complex< P > &t)
 
template<class P >
 negator (const conjugate< P > &t)
 
const N & operator- () const
 
N & operator- ()
 
operator+ () const
 
 operator N () const
 
template<class P >
negatoroperator= (const P &t)
 
template<class P >
negatoroperator+= (const P &t)
 
template<class P >
negatoroperator-= (const P &t)
 
template<class P >
negatoroperator*= (const P &t)
 
template<class P >
negatoroperator/= (const P &t)
 
template<class NN >
negatoroperator= (const negator< NN > &t)
 
template<class NN >
negatoroperator+= (const negator< NN > &t)
 
template<class NN >
negatoroperator-= (const negator< NN > &t)
 

Static Public Member Functions

static negator< N > getNaN ()
 
static negator< N > getInfinity ()
 
static double getDefaultTolerance ()
 
static const negator< N > & recast (const N &val)
 

Friends

template<class N2 >
class negator
 

Detailed Description

template<class N>
class SimTK::negator< N >

negator<N>, where N is a number type (real, complex, conjugate), is represented in memory identically to N, but behaves as though multiplied by -1, though at zero cost.

Only negators instantiated with the nine number types (real, complex, conjugate) are allowed.

Member Typedef Documentation

template<class N>
typedef negator<N> SimTK::negator< N >::T
template<class N>
typedef NUMBER SimTK::negator< N >::TNeg
template<class N>
typedef NUMBER SimTK::negator< N >::TWithoutNegator
template<class N>
typedef CNT<NReal>::TNeg SimTK::negator< N >::TReal
template<class N>
typedef CNT<NImag>::TNeg SimTK::negator< N >::TImag
template<class N>
typedef CNT<NComplex>::TNeg SimTK::negator< N >::TComplex
template<class N>
typedef CNT<NHerm>::TNeg SimTK::negator< N >::THerm
template<class N>
typedef negator<N> SimTK::negator< N >::TPosTrans
template<class N>
typedef NTraits<N>::TSqHermT SimTK::negator< N >::TSqHermT
template<class N>
typedef NTraits<N>::TSqTHerm SimTK::negator< N >::TSqTHerm
template<class N>
typedef negator<N> SimTK::negator< N >::TElement
template<class N>
typedef negator<N> SimTK::negator< N >::TRow
template<class N>
typedef negator<N> SimTK::negator< N >::TCol
template<class N>
typedef NTraits<N>::TSqrt SimTK::negator< N >::TSqrt
template<class N>
typedef NTraits<N>::TAbs SimTK::negator< N >::TAbs
template<class N>
typedef NTraits<N>::TStandard SimTK::negator< N >::TStandard
template<class N>
typedef CNT<NInvert>::TNeg SimTK::negator< N >::TInvert
template<class N>
typedef NTraits<N>::TStandard SimTK::negator< N >::TNormalize
template<class N>
typedef negator<N> SimTK::negator< N >::Scalar
template<class N>
typedef negator<N> SimTK::negator< N >::ULessScalar
template<class N>
typedef NUMBER SimTK::negator< N >::Number
template<class N>
typedef NTraits<N>::StdNumber SimTK::negator< N >::StdNumber
template<class N>
typedef NTraits<N>::Precision SimTK::negator< N >::Precision
template<class N>
typedef NTraits<N>::ScalarNormSq SimTK::negator< N >::ScalarNormSq

Member Enumeration Documentation

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

Constructor & Destructor Documentation

template<class N>
SimTK::negator< N >::negator ( )
inline
template<class N>
SimTK::negator< N >::negator ( const negator< N > &  n)
inline
template<class N>
SimTK::negator< N >::negator ( int  t)
inline
template<class N>
SimTK::negator< N >::negator ( const float &  t)
inline
template<class N>
SimTK::negator< N >::negator ( const double &  t)
inline
template<class N>
SimTK::negator< N >::negator ( const long double &  t)
inline
template<class N>
template<class P >
SimTK::negator< N >::negator ( const std::complex< P > &  t)
inline
template<class N>
template<class P >
SimTK::negator< N >::negator ( const conjugate< P > &  t)
inline

Member Function Documentation

template<class N>
const negator<N>* SimTK::negator< N >::getData ( ) const
inline
template<class N>
negator<N>* SimTK::negator< N >::updData ( )
inline
template<class N>
const TReal& SimTK::negator< N >::real ( ) const
inline
template<class N>
TReal& SimTK::negator< N >::real ( )
inline
template<class N>
const TImag& SimTK::negator< N >::imag ( ) const
inline
template<class N>
TImag& SimTK::negator< N >::imag ( )
inline
template<class N>
ScalarNormSq SimTK::negator< N >::scalarNormSqr ( ) const
inline
template<class N>
TSqrt SimTK::negator< N >::sqrt ( ) const
inline
template<class N>
TAbs SimTK::negator< N >::abs ( ) const
inline
template<class N>
TStandard SimTK::negator< N >::standardize ( ) const
inline
template<class N>
TNormalize SimTK::negator< N >::normalize ( ) const
inline
template<class N>
TInvert SimTK::negator< N >::invert ( ) const
inline
template<class N>
static negator<N> SimTK::negator< N >::getNaN ( )
inlinestatic
template<class N>
static negator<N> SimTK::negator< N >::getInfinity ( )
inlinestatic
template<class N >
bool SimTK::negator< N >::isFinite ( ) const
inline

Returns true if the negated value is finite (i.e., not NaN or Inf).

template<class N >
bool SimTK::negator< N >::isNaN ( ) const
inline

Returns true if the negated value contains a NaN.

template<class N >
bool SimTK::negator< N >::isInf ( ) const
inline

Returns true if the negated value contains an Inf or -Inf and does not contain a NaN.

template<class N>
static double SimTK::negator< N >::getDefaultTolerance ( )
inlinestatic
template<class N>
template<class T2 >
bool SimTK::negator< N >::isNumericallyEqual ( const T2 &  t2) const
inline

In the generic case we'll perform the negation here to get a number, and then delegate to the other type which can be any CNT.

template<class N>
template<class N2 >
bool SimTK::negator< N >::isNumericallyEqual ( const negator< N2 > &  t2) const
inline

In this partial specialization we know that both types have negators so we can just compare the underlying numbers, each of which has the reversed sign, using the global SimTK method available for comparing numbers.

template<class N>
template<class T2 >
bool SimTK::negator< N >::isNumericallyEqual ( const T2 &  t2,
double  tol 
) const
inline

This is the generic case (see above) but with an explicitly-provided tolerance.

template<class N>
template<class N2 >
bool SimTK::negator< N >::isNumericallyEqual ( const negator< N2 > &  t2,
double  tol 
) const
inline

This is the partially specialized case again (see above) but with an explicitly-provided tolerance.

template<class N>
negator& SimTK::negator< N >::operator= ( const negator< N > &  n)
inline
template<class N>
static const negator<N>& SimTK::negator< N >::recast ( const N &  val)
inlinestatic
template<class N>
const N& SimTK::negator< N >::operator- ( ) const
inline
template<class N>
N& SimTK::negator< N >::operator- ( )
inline
template<class N>
N SimTK::negator< N >::operator+ ( ) const
inline
template<class N>
SimTK::negator< N >::operator N ( ) const
inline
template<class N>
template<class P >
negator& SimTK::negator< N >::operator= ( const P &  t)
inline
template<class N>
template<class P >
negator& SimTK::negator< N >::operator+= ( const P &  t)
inline
template<class N>
template<class P >
negator& SimTK::negator< N >::operator-= ( const P &  t)
inline
template<class N>
template<class P >
negator& SimTK::negator< N >::operator*= ( const P &  t)
inline
template<class N>
template<class P >
negator& SimTK::negator< N >::operator/= ( const P &  t)
inline
template<class N>
template<class NN >
negator& SimTK::negator< N >::operator= ( const negator< NN > &  t)
inline
template<class N>
template<class NN >
negator& SimTK::negator< N >::operator+= ( const negator< NN > &  t)
inline
template<class N>
template<class NN >
negator& SimTK::negator< N >::operator-= ( const negator< NN > &  t)
inline

Friends And Related Function Documentation

template<class N>
template<class N2 >
friend class negator
friend

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