iso::math::Math Class Reference

singleton class that provides handy math functions and constants More...

#include <iso_math.h>

Collaboration diagram for iso::math::Math:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int powi (int pBase, int pExponent) const
 integer power function
template<class t>
min (t p1, t p2)
 returns the smaller of the two supplied values
template<class t>
max (t p1, t p2)
 returns the larger of the two supplied values
unsigned int factorial (unsigned int pValue)
 returns factorial of an positive integer
bool checkPowerOfTwo (unsigned int pValue)
 checks whether number is power of two
void powerOfTwoRatio (real pFixValue, real &pVarValue)
 transforms second input value into a (larger) number that's related to the first input value by a power of two
real random ()
 return uniform random number (in between 0 - 1)
real random (real pUpValue)
 return uniform random number (in between 0 - pUpValue)
real random (real pLowValue, real pUpValue)
 return uniform random number (in between pLowValue - pUpValue)
real uniformRandom ()
 return uniform random number (in between 0 - 1)
real uniformRandom (real pUpValue)
 return uniform random number (in between 0 - pUpValue)
real uniformRandom (real pLowValue, real pUpValue)
 return uniform random number (in between pLowValue - pUpValue)
real radian (real pValue)
 converts degrees to radians
real degree (real pValue)
 converts radians to degrees
real degreeToRadian (real pValue)
 converts degrees to radians
real radianToDegree (real pValue)
 converts radians to degrees
real complexToPhase (real aValue, real bValue)
 transforms complex number into polar angle
real gaussian (real pXValue, real pMean, real pStd)
 gaussian function
real hamming (real pXValue)
 hamming function
real hann (real pXValue)
 hann function
real kaiser (real pXValue)
 hann function
real sigmoid (real pXValue, real pA)
 sigmoid function
real nSigmoid (real pXValue, real pA)
 normalized sigmoid function
unsigned int index (const Vector< unsigned int > &pSubdivisions, const Vector< unsigned int > &pPosition) throw (MathException)
 calculate index into n-dimensional array

Static Public Member Functions

static Mathget ()
 get singleton instance
static void destroy ()
 destroy singleton instance

Static Public Attributes

static const real PI

Protected Member Functions

 Math ()
 PI default constructor.
 ~Math ()
 destructor

Protected Attributes

NEWRAN::Uniform * mUniformRandom
NEWRAN::MotherOfAll * mURNG
 random number variable

Static Protected Attributes

static MathsMath
 newran generator

Detailed Description

singleton class that provides handy math functions and constants

that provides handy math functions and constants

Created by Daniel Bisig on 5/17/06. Copyright 2006 Daniel Bisig All rights reserved.


Constructor & Destructor Documentation

Math::Math (  )  [protected]

PI default constructor.

Math::~Math (  )  [protected]

destructor


Member Function Documentation

Math & Math::get (  )  [static]

get singleton instance

Returns:
reference to instance

void Math::destroy (  )  [static]

destroy singleton instance

int Math::powi ( int  pBase,
int  pExponent 
) const [inline]

integer power function

Parameters:
pBase base
pExponent exponent
Returns:
pBase ^ pExponent

template<class t>
t iso::math::Math::min ( p1,
p2 
) [inline]

returns the smaller of the two supplied values

Parameters:
p1 first value
p2 second value

template<class t>
t iso::math::Math::max ( p1,
p2 
) [inline]

returns the larger of the two supplied values

Parameters:
p1 first value
p2 second value

unsigned int iso::math::Math::factorial ( unsigned int  pValue  )  [inline]

returns factorial of an positive integer

Parameters:
pValue positive integer
Returns:
factorial

bool Math::checkPowerOfTwo ( unsigned int  pValue  ) 

checks whether number is power of two

Returns:
true if number is power of two, false otherwise

void Math::powerOfTwoRatio ( real  pFixValue,
real pVarValue 
)

transforms second input value into a (larger) number that's related to the first input value by a power of two

Parameters:
pFixValue fixed input value
pVarValue variable input value

real Math::random (  ) 

return uniform random number (in between 0 - 1)

Returns:
uniform random number

real Math::random ( real  pUpValue  ) 

return uniform random number (in between 0 - pUpValue)

Parameters:
pUpValue upper random number limit
Returns:
uniform random number

real Math::random ( real  pLowValue,
real  pUpValue 
)

return uniform random number (in between pLowValue - pUpValue)

Parameters:
pLowValue lower random number limit
pUpValue upper random number limit
Returns:
uniform random number

real Math::uniformRandom (  ) 

return uniform random number (in between 0 - 1)

Returns:
uniform random number

real Math::uniformRandom ( real  pUpValue  ) 

return uniform random number (in between 0 - pUpValue)

Parameters:
pUpValue upper random number limit
Returns:
uniform random number

real Math::uniformRandom ( real  pLowValue,
real  pUpValue 
)

return uniform random number (in between pLowValue - pUpValue)

Parameters:
pLowValue lower random number limit
pUpValue upper random number limit
Returns:
uniform random number

real Math::radian ( real  pValue  ) 

converts degrees to radians

real Math::degree ( real  pValue  ) 

converts radians to degrees

real Math::degreeToRadian ( real  pValue  ) 

converts degrees to radians

real Math::radianToDegree ( real  pValue  ) 

converts radians to degrees

real Math::complexToPhase ( real  aValue,
real  bValue 
)

transforms complex number into polar angle

Parameters:
aValue aValue
bValue bValue
Returns:
angle in radians

real Math::gaussian ( real  pXValue,
real  pMean,
real  pStd 
)

gaussian function

Parameters:
pXValue x value
pMean mean
pStd standard deviation /return y value

real Math::hamming ( real  pXValue  ) 

hamming function

Parameters:
pXValue x value /return y value
runs from 0.0 to 1.0

real Math::hann ( real  pXValue  ) 

hann function

Parameters:
pXValue x value /return y value
runs from 0.0 to 1.0

real iso::math::Math::kaiser ( real  pXValue  ) 

hann function

Parameters:
pXValue x value /return y value
runs from 0.0 to 1.0

real Math::sigmoid ( real  pXValue,
real  pA 
)

sigmoid function

Parameters:
pXValue x value
pA a value
Returns:
y value

real Math::nSigmoid ( real  pXValue,
real  pA 
)

normalized sigmoid function

Parameters:
pXValue x value
pA a value
Returns:
y value
the normal function input range from -6 to +6 has been rescaled and shifted to the range of 0 to 1

unsigned int Math::index ( const Vector< unsigned int > &  pSubdivisions,
const Vector< unsigned int > &  pPosition 
) throw (MathException)

calculate index into n-dimensional array

Parameters:
pSubdivisions array subdivisions
pPosition position into array
Returns:
index
Exceptions:
MathException dimensions of subdivisons and position don't match or if positition is out of bounds


Member Data Documentation

const real Math::PI [static]

NEWRAN::Uniform* iso::math::Math::mUniformRandom [protected]

NEWRAN::MotherOfAll* iso::math::Math::mURNG [protected]

random number variable

Math * Math::sMath [static, protected]

newran generator


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:04:06 2011 for iso_math by  doxygen 1.5.1