negator.h File Reference

This file defines the negator<N> template which is an adaptor for the numeric types N (Real, Complex, conjugate). More...

#include <iostream>

Go to the source code of this file.

Classes

class  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. More...
struct  Result< P >
struct  Substitute< P >

Namespaces

namespace  SimTK
 

This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with other symbols.


Functions

bool isNaN (const negator< float > &x)
bool isNaN (const negator< double > &x)
bool isNaN (const negator< long double > &x)
template<class P >
bool isNaN (const negator< std::complex< P > > &x)
template<class P >
bool isNaN (const negator< conjugate< P > > &x)
bool isFinite (const negator< float > &x)
bool isFinite (const negator< double > &x)
bool isFinite (const negator< long double > &x)
template<class P >
bool isFinite (const negator< std::complex< P > > &x)
template<class P >
bool isFinite (const negator< conjugate< P > > &x)
bool isInf (const negator< float > &x)
bool isInf (const negator< double > &x)
bool isInf (const negator< long double > &x)
template<class P >
bool isInf (const negator< std::complex< P > > &x)
template<class P >
bool isInf (const negator< conjugate< P > > &x)
template<class A , class B >
negator< A >::template Result
< B >::Add 
operator+ (const negator< A > &l, const B &r)
template<class A , class B >
CNT< A >::template Result
< negator< B > >::Add 
operator+ (const A &l, const negator< B > &r)
template<class A , class B >
negator< A >::template Result
< negator< B > >::Add 
operator+ (const negator< A > &l, const negator< B > &r)
template<class A , class B >
negator< A >::template Result
< B >::Sub 
operator- (const negator< A > &l, const B &r)
template<class A , class B >
CNT< A >::template Result
< negator< B > >::Sub 
operator- (const A &l, const negator< B > &r)
template<class A , class B >
negator< A >::template Result
< negator< B > >::Sub 
operator- (const negator< A > &l, const negator< B > &r)
template<class A , class B >
negator< A >::template Result
< B >::Mul 
operator* (const negator< A > &l, const B &r)
template<class A , class B >
CNT< A >::template Result
< negator< B > >::Mul 
operator* (const A &l, const negator< B > &r)
template<class A , class B >
negator< A >::template Result
< negator< B > >::Mul 
operator* (const negator< A > &l, const negator< B > &r)
template<class A , class B >
negator< A >::template Result
< B >::Dvd 
operator/ (const negator< A > &l, const B &r)
template<class A , class B >
CNT< A >::template Result
< negator< B > >::Dvd 
operator/ (const A &l, const negator< B > &r)
template<class A , class B >
negator< A >::template Result
< negator< B > >::Dvd 
operator/ (const negator< A > &l, const negator< B > &r)
template<class A , class B >
bool operator== (const negator< A > &l, const B &r)
template<class A , class B >
bool operator== (const A &l, const negator< B > &r)
template<class A , class B >
bool operator== (const negator< A > &l, const negator< B > &r)
template<class A , class B >
bool operator!= (const negator< A > &l, const B &r)
template<class A , class B >
bool operator!= (const A &l, const negator< B > &r)
template<class A , class B >
bool operator!= (const negator< A > &l, const negator< B > &r)
template<class NUM , class CHAR , class TRAITS >
std::basic_istream< CHAR,
TRAITS > & 
operator>> (std::basic_istream< CHAR, TRAITS > &is, negator< NUM > &nn)
template<class NUM , class CHAR , class TRAITS >
std::basic_ostream< CHAR,
TRAITS > & 
operator<< (std::basic_ostream< CHAR, TRAITS > &os, const negator< NUM > &nn)

Detailed Description

This file defines the negator<N> template which is an adaptor for the numeric types N (Real, Complex, conjugate).

negator must NOT be instantiated for anything other than these three types (each of which comes in three precisions). negator<N> is guaranteed to have the same memory layout as N, except that the stored values represent the *negative* value of that number.

This is part of the SimTK Scalar package, which forms the basis for composite numerical types like vectors and matrices. The negator class allows negation to be performed by reinterpretation rather than by computation.

 *
 * The Scalar Types
 * ----------------
 * Here is a complete taxonomy of the scalar types we support.
 *
 * <scalar>    ::= <number> | negator< <number> >
 * <number>    ::= <standard> | <conjugate>
 * <standard>  ::= <real> | <complex>
 *
 * <real>      ::= float | double | long double
 * <complex>   ::= std::complex< <real> >
 * <conjugate> ::= SimTK::conjugate< <real> >
 *
 * 

Generated on Thu Aug 12 16:37:41 2010 for SimTKcore by  doxygen 1.6.1