HyperspaceExplorer 0.7.1
Classes | Functions
VecMath Namespace Reference

Vector and Matrix algebra. More...

Classes

class  Matrix
 Matrix<D, N>: a D x D matrix of numbers of type N. More...
class  MultiDimensionalVector
 A D -dimensionally nested std::vector of objects of type T. More...
class  MultiDimensionalVector< T, 1 >
 Specialization of NestedVector<T, D> for D = 1. More...
struct  NumAxes
 Determine number of rotation axes in D-dimensional space. More...
struct  NumAxes< 0 >
 Specialization for zero-dimensional space (no rotation possible) More...
struct  NumAxes< 1 >
 Specialization for one-dimensional space (no rotation possible) More...
class  RotationAxes
 How to generate a Rotation matrix from a Rotation component. More...
class  RotationAxes< 3 >
 Rotation axes in three dimensions, manually specified. More...
class  RotationAxes< 4 >
 Rotation axes in four dimensions, manually specified. More...
class  RotationBase
 Interface Rotation<D, N> implements. More...
class  Rotation
 Rotation in D-dimensional space defined by angles about the main axes. More...
class  Vector
 Vector<D, N>: a D-dimensional vector of numbers of type N. More...

Functions

template<unsigned D, typename N >
Matrix< D, N > operator* (const Matrix< D, N > &A, const Matrix< D, N > &B)
 Matrix multiplication.
template<unsigned D, typename N >
Vector< D, N > operator* (const Matrix< D, N > &M, const Vector< D, N > &V)
 Apply the Matrix on a vector.
template<unsigned D, typename N >
std::ostreamoperator<< (std::ostream &, const Matrix< D, N > &)
 Matrix output operator.
template<typename T , unsigned D>
std::ostreamoperator<< (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 
find (MultiDimensionalVector< T, D-1 > const &find_me, MultiDimensionalVector< T, D > &v)
 Find an element in a MultiDimensionalVector.
template<typename T1 , typename T2 , unsigned D, typename Function >
Function for_each (MultiDimensionalVector< T1, D > &v1, MultiDimensionalVector< T2, D > &v2, Function f)
 Loop over two MultiDimensionalVector s simultaneously, applying a function on both elements.
template<typename T1 , typename T2 , unsigned D, typename Function >
Function for_each (const MultiDimensionalVector< T1, D > &v1, const MultiDimensionalVector< T2, D > &v2, Function f)
 Loop over two MultiDimensionalVector s simultaneously, applying a const function on both elements.
template<typename T1 , typename T2 , typename T3 , unsigned D, typename Function >
Function for_each (MultiDimensionalVector< T1, D > &v1, MultiDimensionalVector< T2, D > &v2, MultiDimensionalVector< T3, D > &v3, Function f)
 Loop over three MultiDimensionalVector s simultaneously, applying a function on all elements.
template<typename T1 , typename T2 , typename T3 , unsigned D, typename Function >
Function for_each (const MultiDimensionalVector< T1, D > &v1, const MultiDimensionalVector< T2, D > &v2, const MultiDimensionalVector< T3, D > &v3, Function f)
 Loop over three MultiDimensionalVector s simultaneously, applying a const function on all elements.
template<typename T >
std::ostreamoperator<< (std::ostream &s, MultiDimensionalVector< T, 1 > const &v)
 Print a MultiDimensionalVector<T, 1> on a std::ostream.
template<typename T1 , typename T2 , typename Function >
Function for_each (MultiDimensionalVector< T1, 1 > &v1, MultiDimensionalVector< T2, 1 > &v2, Function f)
 Loop over two MultiDimensionalVector s simultaneously, applying a function on both elements.
template<typename T1 , typename T2 , typename Function >
Function for_each (const MultiDimensionalVector< T1, 1 > &v1, const MultiDimensionalVector< T2, 1 > &v2, Function f)
 Loop over two MultiDimensionalVector s simultaneously, applying a const function on both elements.
template<typename T1 , typename T2 , typename T3 , typename Function >
Function for_each (MultiDimensionalVector< T1, 1 > &v1, MultiDimensionalVector< T2, 1 > &v2, MultiDimensionalVector< T3, 1 > &v3, Function f)
 Loop over three MultiDimensionalVector s simultaneously, applying a function on all elements.
template<typename T1 , typename T2 , typename T3 , typename Function >
Function for_each (const MultiDimensionalVector< T1, 1 > &v1, const MultiDimensionalVector< T2, 1 > &v2, const MultiDimensionalVector< T3, 1 > &v3, Function f)
 Loop over three MultiDimensionalVector s simultaneously, applying a const function on all elements.
std::ostreamoperator<< (std::ostream &o, const RotationBase &)
 RotationBase output operator.
template<unsigned D, typename N >
Rotation< D, N > operator+ (const Rotation< D, N > &A, const Rotation< D, N > &B)
 Returns the sum of two Rotation s.
template<unsigned D, typename N >
std::ostreamoperator<< (std::ostream &o, const Rotation< D, N > &v)
 Rotation output operator.
template<unsigned D, typename N >
std::istringstreamoperator>> (std::istringstream &in, Rotation< D, N > &v)
 Rotation input operator.
template<typename N >
Rotation< 3, N > makeRotation (N const &r0, N const &r1, N const &r2)
 Generator function for a 3-dimensional Rotation.
template<typename N >
Rotation< 4, N > makeRotation (N const &r0, N const &r1, N const &r2, N const &r3, N const &r4, N const &r5)
 Generator function for a 4-dimensional Rotation.
template<unsigned D, typename N >
Vector< D, N > operator- (const Vector< D, N > &v)
 Unary minus.
template<unsigned D, typename N >
Vector< D, N > operator+ (const Vector< D, N > &x, const Vector< D, N > &y)
 Plus.
template<unsigned D, typename N >
Vector< D, N > operator- (const Vector< D, N > &x, const Vector< D, N > &y)
 Binary minus.
template<unsigned D, typename N >
Vector< D, N > operator* (const Vector< D, N > &x, const N &s)
template<unsigned D, typename N >
Vector< D, N > operator* (const N &s, const Vector< D, N > &x)
template<unsigned D, typename N >
operator* (const Vector< D, N > &x, const Vector< D, N > &y)
 scalar multiplication between two Vectors (dot product)
template<unsigned D, typename N >
Vector< D, N > operator/ (const Vector< D, N > &x, const N &s)
template<unsigned D, typename N >
Vector< D, N > operator/ (const Vector< D, N > &x, const Vector< D, N > &y)
 divide every component of one vector by same component of another
template<unsigned D, typename N >
Vector< D, N > scale (const Vector< D, N > &x, const Vector< D, N > &y)
 multiply every component of one vector with same component of another
template<unsigned D, typename N >
bool operator== (const Vector< D, N > &one, const Vector< D, N > &other)
 Comparison operator: Test for equality.
template<unsigned D, typename N >
bool operator!= (const Vector< D, N > &one, const Vector< D, N > &other)
 Comparison operator: Test for inequality.
template<unsigned D, typename N >
bool operator< (const Vector< D, N > &one, const Vector< D, N > &other)
 Ordering needed to use Vector as key for a std::map.
template<unsigned D, typename N >
sqnorm (const Vector< D, N > &x)
template<unsigned D, typename N >
std::ostreamoperator<< (std::ostream &s, const Vector< D, N > &v)
 Vector output operator.
template<unsigned D, typename N >
std::istringstreamoperator>> (std::istringstream &in, Vector< D, N > &v)
 Vector input operator.
template<typename N >
Vector< 3, N > vcross (Vector< 3, N > a, Vector< 3, N > b)
 Cross product of two 3-Vectors.
template<typename N >
Vector< 4, N > 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 > vnormalize (const Vector< D, N > &x)
 Normalizes a 3-Vector out-of-place.
template<typename N >
Vector< 2, N > makeVector (N const &x0, N const &x1)
 Generator function for a 2-dimensional Vector.
template<typename N >
Vector< 3, N > makeVector (N const &x0, N const &x1, N const &x2)
 Generator function for a 3-dimensional Vector.
template<typename N >
Vector< 4, N > 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 > 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 > 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 > 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 > 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 > 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 > 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.

Detailed Description

Vector and Matrix algebra.


Function Documentation

template<typename T1 , typename T2 , typename T3 , unsigned D, typename Function >
Function VecMath::for_each ( MultiDimensionalVector< T1, D > &  v1,
MultiDimensionalVector< T2, D > &  v2,
MultiDimensionalVector< T3, D > &  v3,
Function  f 
)

Loop over three MultiDimensionalVector s simultaneously, applying a function on all elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
v3The MultiDimensionalVector containing the third arguments going into f.
fThe function that is applied on every element of v1, v2 v2 and v3.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
T3Type of the elements in the third MultiDimensionalVector; type of the third argument to f.
DDimensionality (nesting depth) of both MultiDimensionalVector s.
FunctionA ternary function object or function taking a T1, const T1& or T1& as first argument, a T2, const T2& or T2& as second argument, and a T2, const T2& or T3& as third argument.

References for_each(), max_element(), std::min(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Here is the call graph for this function:

template<typename T1 , typename T2 , typename T3 , unsigned D, typename Function >
Function VecMath::for_each ( const MultiDimensionalVector< T1, D > &  v1,
const MultiDimensionalVector< T2, D > &  v2,
const MultiDimensionalVector< T3, D > &  v3,
Function  f 
)

Loop over three MultiDimensionalVector s simultaneously, applying a const function on all elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
v3The MultiDimensionalVector containing the third arguments going into f.
fThe function that is applied on every element of v1, v2 v2 and v3.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
T3Type of the elements in the third MultiDimensionalVector; type of the third argument to f.
DDimensionality (nesting depth) of both MultiDimensionalVector s.
FunctionA ternary function object or function taking a T1, const T1& or T1& as first argument, a T2, const T2& or T2& as second argument, and a T2, const T2& or T3& as third argument.

References for_each(), max_element(), std::min(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Here is the call graph for this function:

template<typename T1 , typename T2 , typename Function >
Function VecMath::for_each ( MultiDimensionalVector< T1, 1 > &  v1,
MultiDimensionalVector< T2, 1 > &  v2,
Function  f 
)

Loop over two MultiDimensionalVector s simultaneously, applying a function on both elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
fThe function that is applied on every element of v1 and v2.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
FunctionA binary function object or function taking a T1, const T1& or T1& as first argument, and a T2, const T2& or T2& as second argument.

References max_element(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Here is the call graph for this function:

template<typename T1 , typename T2 , unsigned D, typename Function >
Function VecMath::for_each ( MultiDimensionalVector< T1, D > &  v1,
MultiDimensionalVector< T2, D > &  v2,
Function  f 
)

Loop over two MultiDimensionalVector s simultaneously, applying a function on both elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
fThe function that is applied on every element of v1 and v2.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
DDimensionality (nesting depth) of both MultiDimensionalVector s.
FunctionA binary function object or function taking a T1, const T1& or T1& as first argument, and a T2, const T2& or T2& as second argument.

References max_element(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Referenced by for_each(), VertexHolder< N, P, NUM >::for_each_vertex_transformed(), and VertexHolder< N, P, NUM >::for_each_vertex_transformed_projected().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T1 , typename T2 , typename Function >
Function VecMath::for_each ( const MultiDimensionalVector< T1, 1 > &  v1,
const MultiDimensionalVector< T2, 1 > &  v2,
Function  f 
)

Loop over two MultiDimensionalVector s simultaneously, applying a const function on both elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
fThe function that is applied on every element of v1 and v2.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
FunctionA binary function object or function taking a T1 or const T1& as first argument, and a T2 or const T2& as second argument.

References max_element(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Here is the call graph for this function:

template<typename T1 , typename T2 , typename T3 , typename Function >
Function VecMath::for_each ( MultiDimensionalVector< T1, 1 > &  v1,
MultiDimensionalVector< T2, 1 > &  v2,
MultiDimensionalVector< T3, 1 > &  v3,
Function  f 
)

Loop over three MultiDimensionalVector s simultaneously, applying a function on all elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
v3The MultiDimensionalVector containing the third arguments going into f.
fThe function that is applied on every element of v1, v2 v2 and v3.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
T3Type of the elements in the third MultiDimensionalVector; type of the third argument to f.
FunctionA ternary function object or function taking a T1, const T1& or T1& as first argument, a T2, const T2& or T2& as second argument, and a T2, const T2& or T3& as third argument.

References max_element(), std::min(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Here is the call graph for this function:

template<typename T1 , typename T2 , unsigned D, typename Function >
Function VecMath::for_each ( const MultiDimensionalVector< T1, D > &  v1,
const MultiDimensionalVector< T2, D > &  v2,
Function  f 
)

Loop over two MultiDimensionalVector s simultaneously, applying a const function on both elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
fThe function that is applied on every element of v1 and v2.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
DDimensionality (nesting depth) of both MultiDimensionalVector s.
FunctionA binary function object or function taking a T1 or const T1& as first argument, and a T2 or const T2& as second argument.

References for_each(), max_element(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Here is the call graph for this function:

template<typename T1 , typename T2 , typename T3 , typename Function >
Function VecMath::for_each ( const MultiDimensionalVector< T1, 1 > &  v1,
const MultiDimensionalVector< T2, 1 > &  v2,
const MultiDimensionalVector< T3, 1 > &  v3,
Function  f 
)

Loop over three MultiDimensionalVector s simultaneously, applying a const function on all elements.

Parameters:
v1The MultiDimensionalVector containing the first arguments going into f.
v2The MultiDimensionalVector containing the second arguments going into f.
v3The MultiDimensionalVector containing the third arguments going into f.
fThe function that is applied on every element of v1, v2 v2 and v3.
Template Parameters:
T1Type of the elements in the first MultiDimensionalVector; type of the first argument to f.
T2Type of the elements in the second MultiDimensionalVector; type of the second argument to f.
T3Type of the elements in the third MultiDimensionalVector; type of the third argument to f.
FunctionA ternary function object or function taking a T1, const T1& or T1& as first argument, a T2, const T2& or T2& as second argument, and a T2, const T2& or T3& as third argument.

References max_element(), std::min(), min(), and VecMath::MultiDimensionalVector< T, D >::size().

Here is the call graph for this function:

template<unsigned D, typename N >
Vector< D, N > VecMath::operator* ( const Vector< D, N > &  x,
const N &  s 
)
Parameters:
xVector
sscalar type
Returns:
x*s
template<unsigned D, typename N >
Vector< D, N > VecMath::operator* ( const N &  s,
const Vector< D, N > &  x 
)
Parameters:
xVector
sscalar type
Returns:
x*s
template<unsigned D, typename N >
N VecMath::operator* ( const Vector< D, N > &  x,
const Vector< D, N > &  y 
)

scalar multiplication between two Vectors (dot product)

Parameters:
xFirst factor
ySecond factor
Returns:
dot product < x, y >
template<unsigned D, typename N >
Vector< D, N > VecMath::operator+ ( const Vector< D, N > &  x,
const Vector< D, N > &  y 
)

Plus.

Parameters:
xfirst operand
ysecond operand
Returns:
x+y
template<unsigned D, typename N >
Rotation< D, N > VecMath::operator+ ( const Rotation< D, N > &  A,
const Rotation< D, N > &  B 
)

Returns the sum of two Rotation s.

Parameters:
Afirst operand
Bsecond operand
Returns:
A+B
template<unsigned D, typename N >
Vector< D, N > VecMath::operator- ( const Vector< D, N > &  v)

Unary minus.

Returns:
-v
template<unsigned D, typename N >
Vector< D, N > VecMath::operator- ( const Vector< D, N > &  x,
const Vector< D, N > &  y 
)

Binary minus.

Parameters:
xfirst operand
ysecond operand
Returns:
x-y
template<unsigned D, typename N >
Vector< D, N > VecMath::operator/ ( const Vector< D, N > &  x,
const N &  s 
)
Parameters:
xDividend
sScalar divisor
Returns:
*this/s
template<unsigned D, typename N >
Vector< D, N > VecMath::operator/ ( const Vector< D, N > &  x,
const Vector< D, N > &  y 
)

divide every component of one vector by same component of another

Parameters:
XDividend
yDivisor
Returns:
scaled vector
template<unsigned D, typename N >
bool VecMath::operator< ( const Vector< D, N > &  one,
const Vector< D, N > &  other 
)

Ordering needed to use Vector as key for a std::map.

Returns:
whether absolute value of this is less than the other Vector's

References sqnorm().

Here is the call graph for this function:

template<unsigned D, typename N >
Vector< D, N > VecMath::scale ( const Vector< D, N > &  x,
const Vector< D, N > &  y 
)

multiply every component of one vector with same component of another

Parameters:
XDividend
yDivisor
Returns:
scaled vector
template<unsigned D, typename N >
N VecMath::sqnorm ( const Vector< D, N > &  x)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

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