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

Classes

class  blaze::StaticVector< typename, size_t, bool >
 Efficient implementation of a fixed-sized vector.The StaticVector class template is the representation of a fixed-size vector with statically allocated elements of arbitrary type. The type of the elements, the number of elements and the transpose flag of the vector can be specified via the three template parameters: More...
 

StaticVector operators

template<typename Type , size_t N, bool TF>
void blaze::reset (StaticVector< Type, N, TF > &v)
 Resetting the given static vector. More...
 
template<typename Type , size_t N, bool TF>
void blaze::clear (StaticVector< Type, N, TF > &v)
 Clearing the given static vector. More...
 
template<typename Type , size_t N, bool TF>
bool blaze::isDefault (const StaticVector< Type, N, TF > &v)
 Returns whether the given static vector is in default state. More...
 
template<typename Type , size_t N, bool TF>
void blaze::swap (StaticVector< Type, N, TF > &a, StaticVector< Type, N, TF > &b)
 Swapping the contents of two static vectors. More...
 
template<typename Type , bool TF>
const StaticVector< Type, 2UL, TF > blaze::perp (const StaticVector< Type, 2UL, TF > &v)
 Unary perp dot product operator for the calculation of a perpendicular vector ( $ \vec{a}=\vec{b}^\perp $). More...
 
template<typename Type , bool TF>
const StaticVector< Type, 3UL, TF > blaze::perp (const StaticVector< Type, 3UL, TF > &v)
 Creates a perpendicular vector b which satisfies $ \vec{a} \cdot \vec{b} = 0 $. More...
 

Detailed Description

Function Documentation

template<typename Type , size_t N, bool TF>
void blaze::clear ( StaticVector< Type, N, TF > &  v)
inline

Clearing the given static vector.

Parameters
vThe vector to be cleared.
Returns
void

Clearing a static vector is equivalent to resetting it via the reset() function.

template<typename Type , size_t N, bool TF>
bool blaze::isDefault ( const StaticVector< Type, N, TF > &  v)
inline

Returns whether the given static vector is in default state.

Parameters
vThe vector to be tested for its default state.
Returns
true in case the given vector is component-wise zero, false otherwise.

This function checks whether the static vector is in default state. For instance, in case the static vector is instantiated for a built-in integral or floating point data type, the function returns true in case all vector elements are 0 and false in case any vector element is not 0. Following example demonstrates the use of the isDefault function:

// ... Initialization
if( isDefault( a ) ) { ... }
template<typename Type , bool TF>
const StaticVector< Type, 2UL, TF > blaze::perp ( const StaticVector< Type, 2UL, TF > &  v)
inline

Unary perp dot product operator for the calculation of a perpendicular vector ( $ \vec{a}=\vec{b}^\perp $).

Parameters
vThe vector to be rotated.
Returns
The perpendicular vector.

The "perp dot product" $ \vec{a}^\perp \cdot b $ for the vectors $ \vec{a} $ and $ \vec{b} $ is a modification of the two-dimensional dot product in which $ \vec{a} $ is replaced by the perpendicular vector rotated 90 degrees to the left defined by Hill (1994).

template<typename Type , bool TF>
const StaticVector< Type, 3UL, TF > blaze::perp ( const StaticVector< Type, 3UL, TF > &  v)
inline

Creates a perpendicular vector b which satisfies $ \vec{a} \cdot \vec{b} = 0 $.

Parameters
vThe vector to be rotated.
Returns
The perpendicular vector.

Note: The perpendicular vector may have any length!

template<typename Type , size_t N, bool TF>
void blaze::reset ( StaticVector< Type, N, TF > &  v)
inline

Resetting the given static vector.

Parameters
vThe vector to be resetted.
Returns
void
template<typename Type , size_t N, bool TF>
void blaze::swap ( StaticVector< Type, N, TF > &  a,
StaticVector< Type, N, TF > &  b 
)
inline

Swapping the contents of two static vectors.

Parameters
aThe first vector to be swapped.
bThe second vector to be swapped.
Returns
void
Exceptions
no-throwguarantee.