HyperspaceExplorer 0.7.1
Classes | Functions
Vector and Matrix algebra

Classes

class  VecMath::Matrix< D, N >
 Matrix<D, N>: a D x D matrix of numbers of type N. More...
class  VecMath::MultiDimensionalVector< T, D >
 A D -dimensionally nested std::vector of objects of type T. More...
struct  VecMath::NumAxes< D >
 Determine number of rotation axes in D-dimensional space. More...
class  VecMath::RotationAxes< D >
 How to generate a Rotation matrix from a Rotation component. More...
class  VecMath::Rotation< D, N >
 Rotation in D-dimensional space defined by angles about the main axes. More...
class  VecMath::Vector< D, N >
 Vector<D, N>: a D-dimensional vector of numbers of type N. More...

Functions

template<unsigned D, typename N >
Matrix< D, N > VecMath::operator* (const Matrix< D, N > &A, const Matrix< D, N > &B)
 Matrix multiplication.
template<unsigned D, typename N >
Vector< D, N > VecMath::operator* (const Matrix< D, N > &M, const Vector< D, N > &V)
 Apply the Matrix on a vector.
template<unsigned D, typename N >
std::ostreamVecMath::operator<< (std::ostream &, const Matrix< D, N > &)
 Matrix output operator.
template<typename T , unsigned D>
std::ostreamVecMath::operator<< (std::ostream &s, MultiDimensionalVector< T, D > const &v)
 Print a MultiDimensionalVector<T, D> on a std::ostream.
template<typename T , unsigned D>
MultiDimensionalVector< T, D >
::iterator 
VecMath::find (MultiDimensionalVector< T, D-1 > const &find_me, MultiDimensionalVector< T, D > &v)
 Find an element in a MultiDimensionalVector.
template<typename T >
std::ostreamVecMath::operator<< (std::ostream &s, MultiDimensionalVector< T, 1 > const &v)
 Print a MultiDimensionalVector<T, 1> on a std::ostream.
std::ostreamVecMath::operator<< (std::ostream &o, const RotationBase &)
 RotationBase output operator.
template<unsigned D, typename N >
std::ostreamVecMath::operator<< (std::ostream &o, const Rotation< D, N > &v)
 Rotation output operator.
template<unsigned D, typename N >
std::istringstreamVecMath::operator>> (std::istringstream &in, Rotation< D, N > &v)
 Rotation input operator.
template<unsigned D, typename N >
std::ostreamVecMath::operator<< (std::ostream &s, const Vector< D, N > &v)
 Vector output operator.
template<unsigned D, typename N >
std::istringstreamVecMath::operator>> (std::istringstream &in, Vector< D, N > &v)
 Vector input operator.
template<typename N >
Vector< 3, N > VecMath::vcross (Vector< 3, N > a, Vector< 3, N > b)
 Cross product of two 3-Vectors.
template<typename N >
Vector< 4, N > VecMath::vcross (Vector< 4, N > a, Vector< 4, N > b, Vector< 4, N > c)
 Cross product of three 4-Vectors.
template<unsigned D, typename N >
Vector< D, N > VecMath::vnormalize (const Vector< D, N > &x)
 Normalizes a 3-Vector out-of-place.
template<typename N >
Vector< 2, N > VecMath::makeVector (N const &x0, N const &x1)
 Generator function for a 2-dimensional Vector.
template<typename N >
Vector< 3, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2)
 Generator function for a 3-dimensional Vector.
template<typename N >
Vector< 4, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2, N const &x3)
 Generator function for a 4-dimensional Vector.
template<typename N >
Vector< 5, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2, N const &x3, N const &x4)
 Generator function for a 5-dimensional Vector.
template<typename N >
Vector< 6, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2, N const &x3, N const &x4, N const &x5)
 Generator function for a 6-dimensional Vector.
template<typename N >
Vector< 7, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2, N const &x3, N const &x4, N const &x5, N const &x6)
 Generator function for a 7-dimensional Vector.
template<typename N >
Vector< 8, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2, N const &x3, N const &x4, N const &x5, N const &x6, N const &x7)
 Generator function for a 8-dimensional Vector.
template<typename N >
Vector< 9, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2, N const &x3, N const &x4, N const &x5, N const &x6, N const &x7, N const &x8)
 Generator function for a 9-dimensional Vector.
template<typename N >
Vector< 10, N > VecMath::makeVector (N const &x0, N const &x1, N const &x2, N const &x3, N const &x4, N const &x5, N const &x6, N const &x7, N const &x8, N const &x9)
 Generator function for a 10-dimensional Vector.

Function Documentation

template<typename T , unsigned D>
MultiDimensionalVector< T, D >::iterator VecMath::find ( MultiDimensionalVector< T, D-1 > const &  find_me,
MultiDimensionalVector< T, D > &  v 
)

Find an element in a MultiDimensionalVector.

Parameters:
find_meThe element to find in the vector v
vThe vector to search for element find_me
Returns:
The MultiDimensionalVector<T,D>::iterator pointing to the element or v.end() if it is not in v

References VecMath::MultiDimensionalVector< T, D >::begin(), and VecMath::MultiDimensionalVector< T, D >::end().

Here is the call graph for this function:

template<typename N >
Vector< 10, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2,
N const &  x3,
N const &  x4,
N const &  x5,
N const &  x6,
N const &  x7,
N const &  x8,
N const &  x9 
)

Generator function for a 10-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
x3fourth element of the Vector.
x4fifth element of the Vector.
x5sixth element of the Vector.
x6seventh element of the Vector.
x7eighth element of the Vector.
x8ninth element of the Vector.
x9tenth element of the Vector.
template<typename N >
Vector< 3, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2 
)

Generator function for a 3-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
template<typename N >
Vector< 4, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2,
N const &  x3 
)

Generator function for a 4-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
x3fourth element of the Vector.
template<typename N >
Vector< 5, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2,
N const &  x3,
N const &  x4 
)

Generator function for a 5-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
x3fourth element of the Vector.
x4fifth element of the Vector.
template<typename N >
Vector< 6, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2,
N const &  x3,
N const &  x4,
N const &  x5 
)

Generator function for a 6-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
x3fourth element of the Vector.
x4fifth element of the Vector.
x5sixth element of the Vector.
template<typename N >
Vector< 7, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2,
N const &  x3,
N const &  x4,
N const &  x5,
N const &  x6 
)

Generator function for a 7-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
x3fourth element of the Vector.
x4fifth element of the Vector.
x5sixth element of the Vector.
x6seventh element of the Vector.
template<typename N >
Vector< 8, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2,
N const &  x3,
N const &  x4,
N const &  x5,
N const &  x6,
N const &  x7 
)

Generator function for a 8-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
x3fourth element of the Vector.
x4fifth element of the Vector.
x5sixth element of the Vector.
x6seventh element of the Vector.
x7eighth element of the Vector.
template<typename N >
Vector< 9, N > VecMath::makeVector ( N const &  x0,
N const &  x1,
N const &  x2,
N const &  x3,
N const &  x4,
N const &  x5,
N const &  x6,
N const &  x7,
N const &  x8 
)

Generator function for a 9-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
x2third element of the Vector.
x3fourth element of the Vector.
x4fifth element of the Vector.
x5sixth element of the Vector.
x6seventh element of the Vector.
x7eighth element of the Vector.
x8ninth element of the Vector.
template<typename N >
Vector< 2, N > VecMath::makeVector ( N const &  x0,
N const &  x1 
)

Generator function for a 2-dimensional Vector.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
x0first element of the Vector.
x1second element of the Vector.
template<unsigned D, typename N >
Matrix< D, N > VecMath::operator* ( const Matrix< D, N > &  A,
const Matrix< D, N > &  B 
)

Matrix multiplication.

Template Parameters:
Ddimension of the matrix
Nnumerical type of the matrix elements
Parameters:
AMatrix that is multiplied upon
BMatrix to multiply with
Returns:
A * B
template<unsigned D, typename N >
Vector< D, N > VecMath::operator* ( const Matrix< D, N > &  M,
const Vector< D, N > &  V 
)

Apply the Matrix on a vector.

Template Parameters:
Ddimension of the matrix
Nnumerical type of the matrix elements
Parameters:
VVector to multiply with (project)
MMatrix to print
Returns:
M * V
template<unsigned D, typename N >
std::ostream & VecMath::operator<< ( std::ostream o,
const Vector< D, N > &  v 
)

Vector output operator.

Template Parameters:
Ddimension of the vector
Nnumerical type of the vector elements
Parameters:
oostream to push into
vVector to print
Returns:
o; a new ostream to push Vectors and stuff into

References std::setprecision().

Here is the call graph for this function:

template<unsigned D, typename N >
std::ostream & VecMath::operator<< ( std::ostream o,
const Rotation< D, N > &  v 
)

Rotation output operator.

Parameters:
oostream to push into
vRotation to print
Returns:
a new ostream to push Rotations and stuff into
template<typename T , unsigned D>
std::ostream & VecMath::operator<< ( std::ostream s,
MultiDimensionalVector< T, D > const &  v 
)

Print a MultiDimensionalVector<T, D> on a std::ostream.

Parameters:
sThe ostream to which v is sent
vThe vector to print
Returns:
s

References copy().

Here is the call graph for this function:

std::ostream & VecMath::operator<< ( std::ostream o,
const RotationBase &  r 
)

RotationBase output operator.

This operator is not intended to be used in a production environment. It is defined so it can be overridden using late binding by a Rotation. In fact, it simply prints the typeid of the class.

Parameters:
oostream to push into
rthe RotationBase to print
Returns:
a new ostream to push Rotations and stuff into
template<typename T >
std::ostream & VecMath::operator<< ( std::ostream s,
MultiDimensionalVector< T, 1 > const &  v 
)

Print a MultiDimensionalVector<T, 1> on a std::ostream.

Parameters:
sThe ostream to which v is sent
vThe vector to print
Returns:
s

References copy().

Here is the call graph for this function:

template<unsigned D, typename N >
std::ostream & VecMath::operator<< ( std::ostream o,
const Matrix< D, N > &  M 
)

Matrix output operator.

Template Parameters:
Ddimension of the matrix
Nnumerical type of the matrix elements
Parameters:
oostream to push into
MMatrix to print
Returns:
a new ostream to push Matrices and stuff into

References std::endl(), std::setprecision(), and std::setw().

Here is the call graph for this function:

template<unsigned D, typename N >
std::istringstream & VecMath::operator>> ( std::istringstream in,
Vector< D, N > &  v 
)

Vector input operator.

Template Parameters:
Ddimension of the vector
Nnumerical type of the vector elements
Parameters:
inistringstream to read from
vVector to read
Returns:
in - a new istringstream to read stuff from

References VecMath::Vector< D, N >::dimension().

Here is the call graph for this function:

template<unsigned D, typename N >
std::istringstream & VecMath::operator>> ( std::istringstream in,
Rotation< D, N > &  v 
)

Rotation input operator.

Parameters:
inistringstream to read from
vRotation to read
Returns:
a new istringstream to read stuff from

References VecMath::Rotation< D, N >::r().

Here is the call graph for this function:

template<typename N >
Vector< 3, N > VecMath::vcross ( Vector< 3, N >  a,
Vector< 3, N >  b 
)

Cross product of two 3-Vectors.

Specialization of the function template for D = 3.

Template Parameters:
Nnumerical type of the vector elements
Parameters:
afirst operand of cross product
bsecond operand of cross product
Returns:
a x b

Referenced by RealFunction::normal().

Here is the caller graph for this function:

template<typename N >
Vector< 4, N > VecMath::vcross ( Vector< 4, N >  a,
Vector< 4, N >  b,
Vector< 4, N >  c 
)

Cross product of three 4-Vectors.

Specialization of the function template for D = 4.

Template Parameters:
Nnumerical type of the vector elements.
Parameters:
afirst operand of cross product.
bsecond operand of cross product.
cthird operand of cross product.
Returns:
a x b x c
template<unsigned D, typename N >
Vector< D, N > VecMath::vnormalize ( const Vector< D, N > &  x)

Normalizes a 3-Vector out-of-place.

Template Parameters:
Ddimension of the vector
Nnumerical type of the vector elements
Parameters:
xVector to be normalized
Returns:
its normalized value

References norm(), sqnorm(), and sqrt().

Referenced by RealFunction::normal().

Here is the call graph for this function:

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:16 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo