Simbody
|
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 <negator.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 TReal & | real () const |
TReal & | real () |
const TImag & | imag () const |
TImag & | imag () |
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). | |
bool | isNaN () const |
Returns true if the negated value contains a NaN. | |
bool | isInf () const |
Returns true if the negated value contains an Inf or -Inf and does not contain a NaN. | |
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. | |
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. | |
template<class T2 > | |
bool | isNumericallyEqual (const T2 &t2, double tol) const |
This is the generic case (see above) but with an explicitly-provided tolerance. | |
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. | |
negator () | |
negator (const negator &n) | |
negator & | operator= (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- () |
N | operator+ () const |
operator N () const | |
template<class P > | |
negator & | operator= (const P &t) |
template<class P > | |
negator & | operator+= (const P &t) |
template<class P > | |
negator & | operator-= (const P &t) |
template<class P > | |
negator & | operator*= (const P &t) |
template<class P > | |
negator & | operator/= (const P &t) |
template<class NN > | |
negator & | operator= (const negator< NN > &t) |
template<class NN > | |
negator & | operator+= (const negator< NN > &t) |
template<class NN > | |
negator & | operator-= (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 | |
class | negator |
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.
typedef negator<N> SimTK::negator< NUMBER >::T |
typedef NUMBER SimTK::negator< NUMBER >::TNeg |
typedef NUMBER SimTK::negator< NUMBER >::TWithoutNegator |
typedef CNT<NReal>::TNeg SimTK::negator< NUMBER >::TReal |
typedef CNT<NImag>::TNeg SimTK::negator< NUMBER >::TImag |
typedef CNT<NComplex>::TNeg SimTK::negator< NUMBER >::TComplex |
typedef CNT<NHerm>::TNeg SimTK::negator< NUMBER >::THerm |
typedef negator<N> SimTK::negator< NUMBER >::TPosTrans |
typedef NTraits<N>::TSqHermT SimTK::negator< NUMBER >::TSqHermT |
typedef NTraits<N>::TSqTHerm SimTK::negator< NUMBER >::TSqTHerm |
typedef negator<N> SimTK::negator< NUMBER >::TElement |
typedef negator<N> SimTK::negator< NUMBER >::TRow |
typedef negator<N> SimTK::negator< NUMBER >::TCol |
typedef NTraits<N>::TSqrt SimTK::negator< NUMBER >::TSqrt |
typedef NTraits<N>::TAbs SimTK::negator< NUMBER >::TAbs |
typedef NTraits<N>::TStandard SimTK::negator< NUMBER >::TStandard |
typedef CNT<NInvert>::TNeg SimTK::negator< NUMBER >::TInvert |
typedef NTraits<N>::TStandard SimTK::negator< NUMBER >::TNormalize |
typedef negator<N> SimTK::negator< NUMBER >::Scalar |
typedef negator<N> SimTK::negator< NUMBER >::ULessScalar |
typedef NUMBER SimTK::negator< NUMBER >::Number |
typedef NTraits<N>::StdNumber SimTK::negator< NUMBER >::StdNumber |
typedef NTraits<N>::Precision SimTK::negator< NUMBER >::Precision |
typedef NTraits<N>::ScalarNormSq SimTK::negator< NUMBER >::ScalarNormSq |
anonymous enum |
SimTK::negator< NUMBER >::negator | ( | ) | [inline] |
SimTK::negator< NUMBER >::negator | ( | const negator< NUMBER > & | n | ) | [inline] |
SimTK::negator< NUMBER >::negator | ( | int | t | ) | [inline] |
SimTK::negator< NUMBER >::negator | ( | const float & | t | ) | [inline] |
SimTK::negator< NUMBER >::negator | ( | const double & | t | ) | [inline] |
SimTK::negator< NUMBER >::negator | ( | const long double & | t | ) | [inline] |
SimTK::negator< NUMBER >::negator | ( | const std::complex< P > & | t | ) | [inline] |
SimTK::negator< NUMBER >::negator | ( | const conjugate< P > & | t | ) | [inline] |
const negator<N>* SimTK::negator< NUMBER >::getData | ( | ) | const [inline] |
negator<N>* SimTK::negator< NUMBER >::updData | ( | ) | [inline] |
const TReal& SimTK::negator< NUMBER >::real | ( | ) | const [inline] |
TReal& SimTK::negator< NUMBER >::real | ( | ) | [inline] |
const TImag& SimTK::negator< NUMBER >::imag | ( | ) | const [inline] |
TImag& SimTK::negator< NUMBER >::imag | ( | ) | [inline] |
ScalarNormSq SimTK::negator< NUMBER >::scalarNormSqr | ( | ) | const [inline] |
TSqrt SimTK::negator< NUMBER >::sqrt | ( | ) | const [inline] |
TAbs SimTK::negator< NUMBER >::abs | ( | ) | const [inline] |
TStandard SimTK::negator< NUMBER >::standardize | ( | ) | const [inline] |
TNormalize SimTK::negator< NUMBER >::normalize | ( | ) | const [inline] |
TInvert SimTK::negator< NUMBER >::invert | ( | ) | const [inline] |
static negator<N> SimTK::negator< NUMBER >::getNaN | ( | ) | [inline, static] |
static negator<N> SimTK::negator< NUMBER >::getInfinity | ( | ) | [inline, static] |
bool SimTK::negator< N >::isFinite | ( | ) | const [inline] |
Returns true if the negated value is finite (i.e., not NaN or Inf).
bool SimTK::negator< N >::isNaN | ( | ) | const [inline] |
Returns true if the negated value contains a NaN.
bool SimTK::negator< N >::isInf | ( | ) | const [inline] |
Returns true if the negated value contains an Inf or -Inf and does not contain a NaN.
static double SimTK::negator< NUMBER >::getDefaultTolerance | ( | ) | [inline, static] |
bool SimTK::negator< NUMBER >::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.
bool SimTK::negator< NUMBER >::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.
bool SimTK::negator< NUMBER >::isNumericallyEqual | ( | const T2 & | t2, |
double | tol | ||
) | const [inline] |
This is the generic case (see above) but with an explicitly-provided tolerance.
bool SimTK::negator< NUMBER >::isNumericallyEqual | ( | const negator< N2 > & | t2, |
double | tol | ||
) | const [inline] |
This is the partially specialized case again (see above) but with an explicitly-provided tolerance.
negator& SimTK::negator< NUMBER >::operator= | ( | const negator< NUMBER > & | n | ) | [inline] |
static const negator<N>& SimTK::negator< NUMBER >::recast | ( | const N & | val | ) | [inline, static] |
const N& SimTK::negator< NUMBER >::operator- | ( | ) | const [inline] |
N& SimTK::negator< NUMBER >::operator- | ( | ) | [inline] |
N SimTK::negator< NUMBER >::operator+ | ( | ) | const [inline] |
SimTK::negator< NUMBER >::operator N | ( | ) | const [inline] |
negator& SimTK::negator< NUMBER >::operator= | ( | const P & | t | ) | [inline] |
negator& SimTK::negator< NUMBER >::operator+= | ( | const P & | t | ) | [inline] |
negator& SimTK::negator< NUMBER >::operator-= | ( | const P & | t | ) | [inline] |
negator& SimTK::negator< NUMBER >::operator*= | ( | const P & | t | ) | [inline] |
negator& SimTK::negator< NUMBER >::operator/= | ( | const P & | t | ) | [inline] |
negator& SimTK::negator< NUMBER >::operator= | ( | const negator< NN > & | t | ) | [inline] |
negator& SimTK::negator< NUMBER >::operator+= | ( | const negator< NN > & | t | ) | [inline] |
negator& SimTK::negator< NUMBER >::operator-= | ( | const negator< NN > & | t | ) | [inline] |
friend class negator [friend] |