negator< NUMBER > 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 <negator.h>
List of all members.
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 |
Detailed Description
template<class NUMBER>
class SimTK::negator< NUMBER >
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
Member Enumeration Documentation
- Enumerator:
NRows |
|
NCols |
|
RowSpacing |
|
ColSpacing |
|
NPackedElements |
|
NActualElements |
|
NActualScalars |
|
ImagOffset |
|
RealStrideFactor |
|
ArgDepth |
|
IsScalar |
|
IsULessScalar |
|
IsNumber |
|
IsStdNumber |
|
IsPrecision |
|
SignInterpretation |
|
Constructor & Destructor Documentation
negator |
( |
const float & |
t |
) |
[inline] |
negator |
( |
const double & |
t |
) |
[inline] |
negator |
( |
const long double & |
t |
) |
[inline] |
negator |
( |
const std::complex< P > & |
t |
) |
[inline] |
Member Function Documentation
TAbs abs |
( |
|
) |
const [inline] |
const negator<N>* getData |
( |
|
) |
const [inline] |
static double getDefaultTolerance |
( |
|
) |
[inline, static] |
static negator<N> getInfinity |
( |
|
) |
[inline, static] |
static negator<N> getNaN |
( |
|
) |
[inline, static] |
const TImag& imag |
( |
|
) |
const [inline] |
bool isFinite |
( |
|
) |
const [inline] |
Returns true if the negated value is finite (i.e., not NaN or Inf).
bool isInf |
( |
|
) |
const [inline] |
Returns true if the negated value contains an Inf or -Inf and does not contain a NaN.
bool isNaN |
( |
|
) |
const [inline] |
Returns true if the negated value contains a NaN.
bool isNumericallyEqual |
( |
const negator< N2 > & |
t2, |
|
|
double |
tol | |
|
) |
| | const [inline] |
This is the partially specialized case again (see above) but with an explicitly-provided tolerance.
References SimTK::isNumericallyEqual().
bool isNumericallyEqual |
( |
const T2 & |
t2, |
|
|
double |
tol | |
|
) |
| | const [inline] |
bool 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.
References SimTK::isNumericallyEqual().
bool 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.
References SimTK::isNumericallyEqual().
operator N |
( |
|
) |
const [inline] |
negator& operator*= |
( |
const P & |
t |
) |
[inline] |
N operator+ |
( |
|
) |
const [inline] |
negator& operator+= |
( |
const P & |
t |
) |
[inline] |
N& operator- |
( |
|
) |
[inline] |
const N& operator- |
( |
|
) |
const [inline] |
negator& operator-= |
( |
const P & |
t |
) |
[inline] |
negator& operator/= |
( |
const P & |
t |
) |
[inline] |
negator& operator= |
( |
const P & |
t |
) |
[inline] |
const TReal& real |
( |
|
) |
const [inline] |
static const negator<N>& recast |
( |
const N & |
val |
) |
[inline, static] |
TSqrt sqrt |
( |
|
) |
const [inline] |
Friends And Related Function Documentation
The documentation for this class was generated from the following file: