Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
vl::Matrix2< T_Scalar > Class Template Reference

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 (const Matrix2 &other)
 
 Matrix2 ()
 
 Matrix2 (T_Scalar n)
 
 Matrix2 (T_Scalar e00, T_Scalar e01, T_Scalar e10, T_Scalar e11)
 
Matrix2fill (T_Scalar val)
 
T_Scalar diff (const Matrix2 &other) const
 
bool operator== (const Matrix2 &m) const
 
bool operator!= (const Matrix2 &m) const
 
Matrix2operator= (const Matrix2 &m)
 
Matrix2 operator+ (const Matrix2 &m) const
 
Matrix2operator+= (const Matrix2 &m)
 
Matrix2 operator- (const Matrix2 &m) const
 
Matrix2operator-= (const Matrix2 &m)
 
Matrix2operator*= (const Matrix2 &m)
 
Matrix2 operator- () const
 
Matrix2 operator+ (T_Scalar d) const
 
Matrix2operator+= (T_Scalar d)
 
Matrix2 operator- (T_Scalar d) const
 
Matrix2operator-= (T_Scalar d)
 
Matrix2 operator* (T_Scalar d) const
 
Matrix2operator*= (T_Scalar d)
 
Matrix2 operator/ (T_Scalar d) const
 
Matrix2operator/= (T_Scalar d)
 
bool isIdentity () const
 
T_Scalar * ptr ()
 
const T_Scalar * ptr () const
 
Matrix2transpose ()
 
Matrix2 getTransposed () const
 
Matrix2getTransposed (Matrix2 &dest) const
 
bool isNull () const
 
Matrix2setNull ()
 
Matrix2setIdentity ()
 
T_Scalar getInverse (Matrix2 &dest) const
 
Matrix2 getInverse (T_Scalar *determinant=NULL) const
 
Matrix2invert (T_Scalar *determinant=NULL)
 
Matrix2postMultiply (const Matrix2 &m)
 
Matrix2preMultiply (const Matrix2 &m)
 
const T_Scalar & e (int i, int j) const
 
T_Scalar & e (int i, int j)
 

Static Public Member Functions

static Matrix2getNull (Matrix2 &out)
 
static Matrix2 getNull ()
 
static Matrix2 getIdentity ()
 
static Matrix2getIdentity (Matrix2 &out)
 
static Matrix2multiply (Matrix2 &out, const Matrix2 &p, const Matrix2 &q)
 

Protected Attributes

Vector2< T_Scalar > mVec [2]
 

Detailed Description

template<typename T_Scalar>
class vl::Matrix2< T_Scalar >

The Matrix2 class is a template class that implements a generic 2x2 matrix, see also vl::dmat2, vl::fmat2, vl::umat2, vl::imat2.

See also
Vector4, Vector3, Vector2, Matrix4, Matrix3

Definition at line 49 of file Matrix2.hpp.

Member Typedef Documentation

◆ scalar_type

template<typename T_Scalar>
typedef T_Scalar vl::Matrix2< T_Scalar >::scalar_type

Definition at line 52 of file Matrix2.hpp.

Constructor & Destructor Documentation

◆ Matrix2() [1/5]

template<typename T_Scalar>
template<typename T >
vl::Matrix2< T_Scalar >::Matrix2 ( const Matrix2< T > &  m)
inlineexplicit

Definition at line 55 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ Matrix2() [2/5]

template<typename T_Scalar>
vl::Matrix2< T_Scalar >::Matrix2 ( const Matrix2< T_Scalar > &  other)
inline

Definition at line 61 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::operator=().

◆ Matrix2() [3/5]

template<typename T_Scalar>
vl::Matrix2< T_Scalar >::Matrix2 ( )
inline

◆ Matrix2() [4/5]

template<typename T_Scalar>
vl::Matrix2< T_Scalar >::Matrix2 ( T_Scalar  n)
inlineexplicit

◆ Matrix2() [5/5]

template<typename T_Scalar>
vl::Matrix2< T_Scalar >::Matrix2 ( T_Scalar  e00,
T_Scalar  e01,
T_Scalar  e10,
T_Scalar  e11 
)
inlineexplicit

Definition at line 77 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

Member Function Documentation

◆ diff()

template<typename T_Scalar>
T_Scalar vl::Matrix2< T_Scalar >::diff ( const Matrix2< T_Scalar > &  other) const
inline

Definition at line 91 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ e() [1/2]

template<typename T_Scalar>
const T_Scalar& vl::Matrix2< T_Scalar >::e ( int  i,
int  j 
) const
inline

◆ e() [2/2]

template<typename T_Scalar>
T_Scalar& vl::Matrix2< T_Scalar >::e ( int  i,
int  j 
)
inline

Definition at line 404 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::mVec, and VL_CHECK.

◆ fill()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::fill ( T_Scalar  val)
inline

◆ getIdentity() [1/2]

template<typename T_Scalar>
static Matrix2 vl::Matrix2< T_Scalar >::getIdentity ( )
inlinestatic

Definition at line 322 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::Matrix2().

◆ getIdentity() [2/2]

template<typename T_Scalar>
static Matrix2& vl::Matrix2< T_Scalar >::getIdentity ( Matrix2< T_Scalar > &  out)
inlinestatic

Definition at line 327 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::setIdentity().

◆ getInverse() [1/2]

template<typename T_Scalar>
T_Scalar vl::Matrix2< T_Scalar >::getInverse ( Matrix2< T_Scalar > &  dest) const
inline

◆ getInverse() [2/2]

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::getInverse ( T_Scalar *  determinant = NULL) const
inline

Definition at line 360 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::getInverse().

◆ getNull() [1/2]

template<typename T_Scalar>
static Matrix2& vl::Matrix2< T_Scalar >::getNull ( Matrix2< T_Scalar > &  out)
inlinestatic

Definition at line 300 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::fill().

◆ getNull() [2/2]

template<typename T_Scalar>
static Matrix2 vl::Matrix2< T_Scalar >::getNull ( )
inlinestatic

Definition at line 306 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::Matrix2().

◆ getTransposed() [1/2]

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::getTransposed ( ) const
inline

Definition at line 268 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ getTransposed() [2/2]

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::getTransposed ( Matrix2< T_Scalar > &  dest) const
inline

Definition at line 277 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ invert()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::invert ( T_Scalar *  determinant = NULL)
inline

Definition at line 369 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::getInverse().

◆ isIdentity()

template<typename T_Scalar>
bool vl::Matrix2< T_Scalar >::isIdentity ( ) const
inline

Definition at line 237 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::ptr().

◆ isNull()

template<typename T_Scalar>
bool vl::Matrix2< T_Scalar >::isNull ( ) const
inline

Definition at line 285 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::mVec.

◆ multiply()

template<typename T_Scalar>
static Matrix2& vl::Matrix2< T_Scalar >::multiply ( Matrix2< T_Scalar > &  out,
const Matrix2< T_Scalar > &  p,
const Matrix2< T_Scalar > &  q 
)
inlinestatic

◆ operator!=()

template<typename T_Scalar>
bool vl::Matrix2< T_Scalar >::operator!= ( const Matrix2< T_Scalar > &  m) const
inline

Definition at line 108 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::operator==().

◆ operator*()

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::operator* ( T_Scalar  d) const
inline

Definition at line 201 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator*=() [1/2]

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator*= ( const Matrix2< T_Scalar > &  m)
inline

Definition at line 153 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::postMultiply().

◆ operator*=() [2/2]

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator*= ( T_Scalar  d)
inline

Definition at line 210 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator+() [1/2]

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::operator+ ( const Matrix2< T_Scalar > &  m) const
inline

Definition at line 119 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator+() [2/2]

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::operator+ ( T_Scalar  d) const
inline

Definition at line 167 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator+=() [1/2]

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator+= ( const Matrix2< T_Scalar > &  m)
inline

Definition at line 128 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator+=() [2/2]

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator+= ( T_Scalar  d)
inline

Definition at line 176 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator-() [1/3]

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::operator- ( const Matrix2< T_Scalar > &  m) const
inline

Definition at line 136 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator-() [2/3]

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::operator- ( ) const
inline

Definition at line 158 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator-() [3/3]

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::operator- ( T_Scalar  d) const
inline

Definition at line 184 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator-=() [1/2]

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator-= ( const Matrix2< T_Scalar > &  m)
inline

Definition at line 145 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator-=() [2/2]

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator-= ( T_Scalar  d)
inline

Definition at line 193 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator/()

template<typename T_Scalar>
Matrix2 vl::Matrix2< T_Scalar >::operator/ ( T_Scalar  d) const
inline

Definition at line 218 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator/=()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator/= ( T_Scalar  d)
inline

Definition at line 228 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ operator=()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::operator= ( const Matrix2< T_Scalar > &  m)
inline

Definition at line 113 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::mVec.

Referenced by vl::Matrix2< T_Scalar >::Matrix2().

◆ operator==()

template<typename T_Scalar>
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 >::mVec.

Referenced by vl::Matrix2< T_Scalar >::operator!=().

◆ postMultiply()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::postMultiply ( const Matrix2< T_Scalar > &  m)
inline

Definition at line 390 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::multiply().

Referenced by vl::Matrix2< T_Scalar >::operator*=().

◆ preMultiply()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::preMultiply ( const Matrix2< T_Scalar > &  m)
inline

Definition at line 396 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::multiply().

◆ ptr() [1/2]

template<typename T_Scalar>
T_Scalar* vl::Matrix2< T_Scalar >::ptr ( )
inline

◆ ptr() [2/2]

template<typename T_Scalar>
const T_Scalar* vl::Matrix2< T_Scalar >::ptr ( ) const
inline

Definition at line 248 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

◆ setIdentity()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::setIdentity ( )
inline

◆ setNull()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::setNull ( )
inline

Definition at line 294 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::fill().

◆ transpose()

template<typename T_Scalar>
Matrix2& vl::Matrix2< T_Scalar >::transpose ( )
inline

Definition at line 253 of file Matrix2.hpp.

References vl::Matrix2< T_Scalar >::e().

Member Data Documentation

◆ mVec

template<typename T_Scalar>
Vector2<T_Scalar> vl::Matrix2< T_Scalar >::mVec[2]
protected

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