All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions

Functions

template<typename Type >
void blaze::clear (Type &clearable)
 Clearing the given value/object to the default state. More...
 
template<typename T1 , typename T2 >
bool blaze::equal (const T1 &a, const T2 &b)
 Generic equality check. More...
 
float blaze::inv (float a)
 Inverting the given single precision value. More...
 
double blaze::inv (double a)
 Inverting the given double precision value. More...
 
long double blaze::inv (long double a)
 Inverting the given long double value. More...
 
template<typename Type >
bool blaze::isDefault (const Type &v)
 Returns whether the given value/object is in default state. More...
 
template<typename T >
bool blaze::isnan (T a)
 Platform independent implementation of the C99 isnan function. More...
 
template<typename Type >
void blaze::reset (Type &resettable)
 Resetting the given value/object to the default value. More...
 
template<typename T >
const MultExprTrait< T, T >::Type blaze::sq (const T &a)
 Squaring the given value/object. More...
 

Detailed Description

Function Documentation

template<typename Type >
void blaze::clear ( Type &  clearable)
inline

Clearing the given value/object to the default state.

Parameters
clearableThe value/object to be cleared.
Returns
void

The clear shim represents an abstract interface for clearing a value/object of any given data type to its default state. Values of built-in data type are reset to zero.

template<typename T1 , typename T2 >
bool blaze::equal ( const T1 &  a,
const T2 &  b 
)
inline

Generic equality check.

Parameters
aFirst value/object.
bSecond value/object.
Returns
true if the two values/objects are equal, false if not.

The equal shim represents an abstract interface for testing two values/objects for equality. In case the two values/objects are equal, the function returns true, otherwise it returns false. Per default, the comparison of the two values/objects uses the equality operator operator==(). For built-in floating point data types a special comparison is selected that takes the limited machine accuracy into account.

float blaze::inv ( float  a)
inline

Inverting the given single precision value.

Parameters
aThe single precision value to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type. For single precision floating point values this results in $ \frac{1}{a} $.

double blaze::inv ( double  a)
inline

Inverting the given double precision value.

Parameters
aThe double precision value to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type. For double precision floating point values this results in $ \frac{1}{a} $.

long double blaze::inv ( long double  a)
inline

Inverting the given long double value.

Parameters
aThe long double value to be inverted.
Returns
The inverse of the given value.

The invert shim represents an abstract interface for inverting a value/object of any given data type. For long double floating point values this results in $ \frac{1}{a} $.

template<typename Type >
bool blaze::isDefault ( const Type &  v)
inline

Returns whether the given value/object is in default state.

Parameters
vThe value/object to be tested for its default state.
Returns
true in case the given value/object is in its default state, false otherwise.

The isDefault shim represents an abstract interface for testing a value/object whether it is in its default state or not. In case the value/object is in its default state, the function returns true, otherwise it returns false. For built-in data types, the function returns true in case the current value is zero.

const int i = 0; // isDefault( i ) returns true
double d = 2.0; // isDefault( d ) returns false
Vec3 v1; // isDefault( v1 ) returns true
Vec3 v2( 0, 0, 0 ); // isDefault( v2 ) returns true since (0,0,0) is the default state
Vec3 v3( 1, 2, 3 ); // isDefault( v3 ) returns false
template<typename T >
bool blaze::isnan ( a)
inline

Platform independent implementation of the C99 isnan function.

Parameters
aFloating point value to be checked.
Returns
Non-zero value if a is a not a number (NaN).

This function provides a platform independent check for NaN values since some compilers don't support the isnan function (although is is part of the latest C standard library).

Note: Since NaN values are only defined for floating point types, this isnan can only be used for floating point types. The attempt to use this function for an integral data type results in a compile time error.

template<typename Type >
void blaze::reset ( Type &  resettable)
inline

Resetting the given value/object to the default value.

Parameters
resettableThe value/object to be resetted.
Returns
void

The reset shim represents an abstract interface for the resetting of a value/object of any given data type to its default value. Values of built-in data type are reset to zero.

template<typename T >
const MultExprTrait<T,T>::Type blaze::sq ( const T &  a)
inline

Squaring the given value/object.

Parameters
aThe value/object to be squared.
Returns
The result of the square operation.

The square shim represents an abstract interface for squaring a value/object of any given data type. For values of built-in data type this results in a plain multiplication.