Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Matrix2 class is a template class that implements a generic 2x2 matrix, see also vl::dmat2, vl::fmat2, vl::umat2, vl::imat2. More...
#include <Matrix2.hpp>
Public Types | |
typedef T_Scalar | scalar_type |
Public Member Functions | |
template<typename T > | |
Matrix2 (const Matrix2< T > &m) | |
Matrix2 () | |
Matrix2 (T_Scalar n) | |
Matrix2 (T_Scalar e00, T_Scalar e01, T_Scalar e10, T_Scalar e11) | |
Matrix2 & | fill (T_Scalar val) |
T_Scalar | diff (const Matrix2 &other) const |
bool | operator== (const Matrix2 &m) const |
bool | operator!= (const Matrix2 &m) const |
Matrix2 & | operator= (const Matrix2 &m) |
Matrix2 | operator+ (const Matrix2 &m) const |
Matrix2 & | operator+= (const Matrix2 &m) |
Matrix2 | operator- (const Matrix2 &m) const |
Matrix2 & | operator-= (const Matrix2 &m) |
Matrix2 & | operator*= (const Matrix2 &m) |
Matrix2 | operator- () const |
Matrix2 | operator+ (T_Scalar d) const |
Matrix2 & | operator+= (T_Scalar d) |
Matrix2 | operator- (T_Scalar d) const |
Matrix2 & | operator-= (T_Scalar d) |
Matrix2 | operator* (T_Scalar d) const |
Matrix2 & | operator*= (T_Scalar d) |
Matrix2 | operator/ (T_Scalar d) const |
Matrix2 & | operator/= (T_Scalar d) |
bool | isIdentity () const |
T_Scalar * | ptr () |
const T_Scalar * | ptr () const |
Matrix2 & | transpose () |
Matrix2 | getTransposed () const |
Matrix2 & | getTransposed (Matrix2 &dest) const |
bool | isNull () const |
Matrix2 & | setNull () |
Matrix2 & | setIdentity () |
T_Scalar | getInverse (Matrix2 &dest) const |
Matrix2 | getInverse (T_Scalar *determinant=NULL) const |
Matrix2 & | invert (T_Scalar *determinant=NULL) |
Matrix2 & | postMultiply (const Matrix2 &m) |
Matrix2 & | preMultiply (const Matrix2 &m) |
const T_Scalar & | e (int i, int j) const |
T_Scalar & | e (int i, int j) |
Static Public Member Functions | |
static Matrix2 & | getNull (Matrix2 &out) |
static Matrix2 | getNull () |
static Matrix2 | getIdentity () |
static Matrix2 & | getIdentity (Matrix2 &out) |
static Matrix2 & | multiply (Matrix2 &out, const Matrix2 &p, const Matrix2 &q) |
Protected Attributes | |
Vector2< T_Scalar > | mVec [2] |
The Matrix2 class is a template class that implements a generic 2x2 matrix, see also vl::dmat2, vl::fmat2, vl::umat2, vl::imat2.
Definition at line 49 of file Matrix2.hpp.
typedef T_Scalar vl::Matrix2< T_Scalar >::scalar_type |
Definition at line 52 of file Matrix2.hpp.
vl::Matrix2< T_Scalar >::Matrix2 | ( | const Matrix2< T > & | m ) | [inline, explicit] |
Definition at line 55 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
vl::Matrix2< T_Scalar >::Matrix2 | ( | ) | [inline] |
Definition at line 61 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::setIdentity().
Referenced by vl::Matrix2< T_Scalar >::getIdentity(), vl::Matrix2< T_Scalar >::getInverse(), and vl::Matrix2< T_Scalar >::getNull().
vl::Matrix2< T_Scalar >::Matrix2 | ( | T_Scalar | n ) | [inline, explicit] |
Definition at line 66 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e(), and vl::Matrix2< T_Scalar >::setIdentity().
vl::Matrix2< T_Scalar >::Matrix2 | ( | T_Scalar | e00, |
T_Scalar | e01, | ||
T_Scalar | e10, | ||
T_Scalar | e11 | ||
) | [inline, explicit] |
Definition at line 72 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::fill | ( | T_Scalar | val ) | [inline] |
Definition at line 79 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Referenced by vl::Matrix2< T_Scalar >::getInverse(), vl::Matrix2< T_Scalar >::getNull(), and vl::Matrix2< T_Scalar >::setNull().
T_Scalar vl::Matrix2< T_Scalar >::diff | ( | const Matrix2< T_Scalar > & | other ) | const [inline] |
Definition at line 86 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
bool vl::Matrix2< T_Scalar >::operator== | ( | const Matrix2< T_Scalar > & | m ) | const [inline] |
Definition at line 98 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::mVec.
Referenced by vl::Matrix2< T_Scalar >::operator!=().
bool vl::Matrix2< T_Scalar >::operator!= | ( | const Matrix2< T_Scalar > & | m ) | const [inline] |
Definition at line 103 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::operator==().
Matrix2& vl::Matrix2< T_Scalar >::operator= | ( | const Matrix2< T_Scalar > & | m ) | [inline] |
Definition at line 108 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::mVec.
Matrix2 vl::Matrix2< T_Scalar >::operator+ | ( | const Matrix2< T_Scalar > & | m ) | const [inline] |
Definition at line 114 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::operator+= | ( | const Matrix2< T_Scalar > & | m ) | [inline] |
Definition at line 123 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2 vl::Matrix2< T_Scalar >::operator- | ( | const Matrix2< T_Scalar > & | m ) | const [inline] |
Definition at line 131 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::operator-= | ( | const Matrix2< T_Scalar > & | m ) | [inline] |
Definition at line 140 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::operator*= | ( | const Matrix2< T_Scalar > & | m ) | [inline] |
Definition at line 148 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::postMultiply().
Matrix2 vl::Matrix2< T_Scalar >::operator- | ( | ) | const [inline] |
Definition at line 153 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2 vl::Matrix2< T_Scalar >::operator+ | ( | T_Scalar | d ) | const [inline] |
Definition at line 162 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::operator+= | ( | T_Scalar | d ) | [inline] |
Definition at line 171 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2 vl::Matrix2< T_Scalar >::operator- | ( | T_Scalar | d ) | const [inline] |
Definition at line 179 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::operator-= | ( | T_Scalar | d ) | [inline] |
Definition at line 188 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2 vl::Matrix2< T_Scalar >::operator* | ( | T_Scalar | d ) | const [inline] |
Definition at line 196 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::operator*= | ( | T_Scalar | d ) | [inline] |
Definition at line 205 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2 vl::Matrix2< T_Scalar >::operator/ | ( | T_Scalar | d ) | const [inline] |
Definition at line 213 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::operator/= | ( | T_Scalar | d ) | [inline] |
Definition at line 223 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
bool vl::Matrix2< T_Scalar >::isIdentity | ( | ) | const [inline] |
Definition at line 232 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::ptr().
T_Scalar* vl::Matrix2< T_Scalar >::ptr | ( | ) | [inline] |
Definition at line 238 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Referenced by vl::Uniform::getUniform(), vl::GLSLProgram::getUniform(), vl::Matrix2< T_Scalar >::isIdentity(), vl::Matrix2< T_Scalar >::multiply(), and vl::Uniform::setUniform().
const T_Scalar* vl::Matrix2< T_Scalar >::ptr | ( | ) | const [inline] |
Definition at line 243 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::transpose | ( | ) | [inline] |
Definition at line 248 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2 vl::Matrix2< T_Scalar >::getTransposed | ( | ) | const [inline] |
Definition at line 261 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
Matrix2& vl::Matrix2< T_Scalar >::getTransposed | ( | Matrix2< T_Scalar > & | dest ) | const [inline] |
Definition at line 270 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e().
bool vl::Matrix2< T_Scalar >::isNull | ( | ) | const [inline] |
Definition at line 278 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::mVec.
Matrix2& vl::Matrix2< T_Scalar >::setNull | ( | ) | [inline] |
Definition at line 287 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::fill().
static Matrix2& vl::Matrix2< T_Scalar >::getNull | ( | Matrix2< T_Scalar > & | out ) | [inline, static] |
Definition at line 293 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::fill().
static Matrix2 vl::Matrix2< T_Scalar >::getNull | ( | ) | [inline, static] |
Definition at line 299 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::Matrix2().
Matrix2& vl::Matrix2< T_Scalar >::setIdentity | ( | ) | [inline] |
Definition at line 304 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::mVec.
Referenced by vl::Matrix2< T_Scalar >::getIdentity(), and vl::Matrix2< T_Scalar >::Matrix2().
static Matrix2 vl::Matrix2< T_Scalar >::getIdentity | ( | ) | [inline, static] |
Definition at line 315 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::Matrix2().
static Matrix2& vl::Matrix2< T_Scalar >::getIdentity | ( | Matrix2< T_Scalar > & | out ) | [inline, static] |
Definition at line 320 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::setIdentity().
T_Scalar vl::Matrix2< T_Scalar >::getInverse | ( | Matrix2< T_Scalar > & | dest ) | const [inline] |
Definition at line 326 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e(), vl::Matrix2< T_Scalar >::fill(), and vl::Matrix2< T_Scalar >::Matrix2().
Referenced by vl::Matrix2< T_Scalar >::getInverse(), and vl::Matrix2< T_Scalar >::invert().
Matrix2 vl::Matrix2< T_Scalar >::getInverse | ( | T_Scalar * | determinant = NULL ) |
const [inline] |
Definition at line 353 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::getInverse().
Matrix2& vl::Matrix2< T_Scalar >::invert | ( | T_Scalar * | determinant = NULL ) |
[inline] |
Definition at line 362 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::getInverse().
static Matrix2& vl::Matrix2< T_Scalar >::multiply | ( | Matrix2< T_Scalar > & | out, |
const Matrix2< T_Scalar > & | p, | ||
const Matrix2< T_Scalar > & | q | ||
) | [inline, static] |
Definition at line 370 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::e(), vl::Matrix2< T_Scalar >::ptr(), and VL_CHECK.
Referenced by vl::operator*(), vl::Matrix2< T_Scalar >::postMultiply(), and vl::Matrix2< T_Scalar >::preMultiply().
Matrix2& vl::Matrix2< T_Scalar >::postMultiply | ( | const Matrix2< T_Scalar > & | m ) | [inline] |
Definition at line 383 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::multiply().
Referenced by vl::Matrix2< T_Scalar >::operator*=().
Matrix2& vl::Matrix2< T_Scalar >::preMultiply | ( | const Matrix2< T_Scalar > & | m ) | [inline] |
Definition at line 389 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::multiply().
const T_Scalar& vl::Matrix2< T_Scalar >::e | ( | int | i, |
int | j | ||
) | const [inline] |
Definition at line 396 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::mVec.
Referenced by vl::Matrix2< T_Scalar >::diff(), vl::Matrix2< T_Scalar >::fill(), vl::Matrix3< T_Scalar >::get2x2(), vl::Matrix2< T_Scalar >::getInverse(), vl::Matrix2< T_Scalar >::getTransposed(), vl::Matrix2< T_Scalar >::Matrix2(), vl::matrixCompMult(), vl::Matrix2< T_Scalar >::multiply(), vl::operator*(), vl::Matrix2< T_Scalar >::operator*(), vl::Matrix2< T_Scalar >::operator*=(), vl::Matrix2< T_Scalar >::operator+(), vl::Matrix2< T_Scalar >::operator+=(), vl::Matrix2< T_Scalar >::operator-(), vl::Matrix2< T_Scalar >::operator-=(), vl::Matrix2< T_Scalar >::operator/(), vl::Matrix2< T_Scalar >::operator/=(), vl::outerProduct(), vl::Matrix2< T_Scalar >::ptr(), vl::Matrix3< T_Scalar >::set2x2(), vl::Matrix2< T_Scalar >::transpose(), and vl::transpose().
T_Scalar& vl::Matrix2< T_Scalar >::e | ( | int | i, |
int | j | ||
) | [inline] |
Definition at line 397 of file Matrix2.hpp.
References vl::Matrix2< T_Scalar >::mVec.
Vector2<T_Scalar> vl::Matrix2< T_Scalar >::mVec[2] [protected] |
Definition at line 404 of file Matrix2.hpp.
Referenced by vl::Matrix2< T_Scalar >::e(), vl::Matrix2< T_Scalar >::isNull(), vl::Matrix2< T_Scalar >::operator=(), vl::Matrix2< T_Scalar >::operator==(), and vl::Matrix2< T_Scalar >::setIdentity().