version 3.3

VRS::Mat< DIM, T > Class Template Reference

This template class represents a DIMxDIM matrix with component type T. More...

#include <vrs/mat.h>

List of all members.

Public Types

typedef T value_type
 STL style value_type declaration.

Public Member Functions

 Mat (T diag=T(1))
 Initialize the diagonal of the matrix with the given value.
 Mat (Vec< DIM, T > const &diag)
 Initialize the diagonal of the matrix with the values from the given vector.
 Mat (Vec< 4, T > const &column0, Vec< 4, T > const &column1, Vec< 4, T > const &column2, Vec< 4, T > const &column3)
 Initialize all 4 columns of the matrix with individual column values taken from 4 vectors.
 Mat (T c0r0, T c0r1, T c0r2, T c0r3, T c1r0, T c1r1, T c1r2, T c1r3, T c2r0, T c2r1, T c2r2, T c2r3, T c3r0, T c3r1, T c3r2, T c3r3)
 Initialize all 4x4 components of the matrix with individual values in column major order.
 Mat (Vec< 3, T > const &column0, Vec< 3, T > const &column1, Vec< 3, T > const &column2)
 Initialize all 3 columns of the matrix with individual column values taken from 3 vectors.
 Mat (T c0r0, T c0r1, T c0r2, T c1r0, T c1r1, T c1r2, T c2r0, T c2r1, T c2r2)
 Initialize all 3x3 components of the matrix with individual values in column major order.
 Mat (Vec< 2, T > const &column0, Vec< 2, T > const &column1)
 Initialize all 2 columns of the matrix with individual column values taken from 2 vectors.
 Mat (T c0r0, T c0r1, T c1r0, T c1r1)
 Initialize all 2x2 components of the matrix with individual values in column major order.
template<unsigned int DIM2, typename S>
 Mat (Mat< DIM2, S > const &other)
 Copy constructor with type conversion from type S to type T.
Vec< DIM, T > const & operator[] (size_t column) const
 Gives direct read access to the column-th column of the matrix.
Vec< DIM, T > & operator[] (size_t column)
 Gives direct read/write access to the column-th column of the matrix.
element (size_t column, size_t row) const
 Gives direct read access to the element of the matrix.
T & element (size_t column, size_t row)
 Gives direct read/write access to the element of the matrix.
Vec< DIM, T > const & column (size_t column) const
 Gives read access to the column-th column of the matrix.
Vec< DIM, T > row (size_t row) const
 Gives read access to the row-th row of the matrix.
Mat< DIM-1, T > minor (size_t column, size_t row) const
 Returns the minor matrix of x, i.e., the matrix without the given column and row.
bool operator== (Mat< DIM, T > const &other) const
 Operator ==.
bool operator< (Mat< DIM, T > const &other) const
 Operator < (lexicographic ordering of the vector columns).
Mat< DIM, T > & operator+= (Mat< DIM, T > const &other)
 Operator +=.
Mat< DIM, T > & operator-= (Mat< DIM, T > const &other)
 Operator -=.
Mat< DIM, T > & operator*= (Mat< DIM, T > const &mat)
 Operator *=.


Detailed Description

template<unsigned int DIM, typename T>
class VRS::Mat< DIM, T >

This template class represents a DIMxDIM matrix with component type T.

Implementation is based on GLSL found here: http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf


Member Typedef Documentation

template<unsigned int DIM, typename T>
typedef T VRS::Mat< DIM, T >::value_type

STL style value_type declaration.


Constructor & Destructor Documentation

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( diag = T(1)  )  [inline, explicit]

Initialize the diagonal of the matrix with the given value.

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( Vec< DIM, T > const &  diag  )  [inline, explicit]

Initialize the diagonal of the matrix with the values from the given vector.

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( Vec< 4, T > const &  column0,
Vec< 4, T > const &  column1,
Vec< 4, T > const &  column2,
Vec< 4, T > const &  column3 
) [inline]

Initialize all 4 columns of the matrix with individual column values taken from 4 vectors.

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( c0r0,
c0r1,
c0r2,
c0r3,
c1r0,
c1r1,
c1r2,
c1r3,
c2r0,
c2r1,
c2r2,
c2r3,
c3r0,
c3r1,
c3r2,
c3r3 
) [inline]

Initialize all 4x4 components of the matrix with individual values in column major order.

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( Vec< 3, T > const &  column0,
Vec< 3, T > const &  column1,
Vec< 3, T > const &  column2 
) [inline]

Initialize all 3 columns of the matrix with individual column values taken from 3 vectors.

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( c0r0,
c0r1,
c0r2,
c1r0,
c1r1,
c1r2,
c2r0,
c2r1,
c2r2 
) [inline]

Initialize all 3x3 components of the matrix with individual values in column major order.

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( Vec< 2, T > const &  column0,
Vec< 2, T > const &  column1 
) [inline]

Initialize all 2 columns of the matrix with individual column values taken from 2 vectors.

template<unsigned int DIM, typename T>
VRS::Mat< DIM, T >::Mat ( c0r0,
c0r1,
c1r0,
c1r1 
) [inline]

Initialize all 2x2 components of the matrix with individual values in column major order.

template<unsigned int DIM, typename T>
template<unsigned int DIM2, typename S>
VRS::Mat< DIM, T >::Mat ( Mat< DIM2, S > const &  other  )  [inline, explicit]

Copy constructor with type conversion from type S to type T.

Missing diagonal elements will be initialized by 1, other missing elements will be initialized with 0.


Member Function Documentation

template<unsigned int DIM, typename T>
Vec<DIM, T> const& VRS::Mat< DIM, T >::operator[] ( size_t  column  )  const [inline]

Gives direct read access to the column-th column of the matrix.

template<unsigned int DIM, typename T>
Vec<DIM, T>& VRS::Mat< DIM, T >::operator[] ( size_t  column  )  [inline]

Gives direct read/write access to the column-th column of the matrix.

template<unsigned int DIM, typename T>
T VRS::Mat< DIM, T >::element ( size_t  column,
size_t  row 
) const [inline]

Gives direct read access to the element of the matrix.

template<unsigned int DIM, typename T>
T& VRS::Mat< DIM, T >::element ( size_t  column,
size_t  row 
) [inline]

Gives direct read/write access to the element of the matrix.

template<unsigned int DIM, typename T>
Vec<DIM, T> const& VRS::Mat< DIM, T >::column ( size_t  column  )  const [inline]

Gives read access to the column-th column of the matrix.

template<unsigned int DIM, typename T>
Vec<DIM, T> VRS::Mat< DIM, T >::row ( size_t  row  )  const [inline]

Gives read access to the row-th row of the matrix.

template<unsigned int DIM, typename T>
Mat<DIM - 1, T> VRS::Mat< DIM, T >::minor ( size_t  column,
size_t  row 
) const [inline]

Returns the minor matrix of x, i.e., the matrix without the given column and row.

template<unsigned int DIM, typename T>
bool VRS::Mat< DIM, T >::operator== ( Mat< DIM, T > const &  other  )  const [inline]

Operator ==.

template<unsigned int DIM, typename T>
bool VRS::Mat< DIM, T >::operator< ( Mat< DIM, T > const &  other  )  const [inline]

Operator < (lexicographic ordering of the vector columns).

template<unsigned int DIM, typename T>
Mat<DIM, T>& VRS::Mat< DIM, T >::operator+= ( Mat< DIM, T > const &  other  )  [inline]

Operator +=.

template<unsigned int DIM, typename T>
Mat<DIM, T>& VRS::Mat< DIM, T >::operator-= ( Mat< DIM, T > const &  other  )  [inline]

Operator -=.

template<unsigned int DIM, typename T>
Mat<DIM, T>& VRS::Mat< DIM, T >::operator*= ( Mat< DIM, T > const &  mat  )  [inline]

Operator *=.


The documentation for this class was generated from the following file:

Generated on Tue May 22 06:00:22 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact