3D City v-1.0
Computer Graphics Project
mat< Type, x_dim, y_dim > Class Template Reference

A general matrix class for any size of matrix. More...

#include <maths.h>

Public Member Functions

 mat ()
 
 mat (const Type &in)
 
 mat (const std::array< Type, x_dim *y_dim > &in)
 
template<class U >
 mat (const mat< U, x_dim, y_dim > &in)
 
Type & operator() (const size_t &r, const size_t &c)
 
const Type & operator() (const size_t &r, const size_t &c) const
 
const Type & at (const size_t &r, const size_t &c) const
 
Type & at (const size_t &r, const size_t &c)
 
void print () const
 
mat< Type, x_dim, y_dim > toUpper ()
 
mat< Type, x_dim, y_dim > inverse () const
 
mat< Type, x_dim, y_dim > operator- ()
 
mat< Type, x_dim, y_dim > operator+ (const mat< Type, x_dim, y_dim > &in)
 
mat< Type, x_dim, y_dim > operator- (const mat< Type, x_dim, y_dim > &in)
 
void operator+= (const mat< Type, x_dim, y_dim > &in)
 
void operator-= (const mat< Type, x_dim, y_dim > &in)
 
void operator*= (const mat< Type, x_dim, y_dim > &in)
 
void operator*= (const Type &a)
 
void operator/= (const Type &a)
 
vec2_T< Type > operator* (const vec2_T< Type > &in) const
 
mat< Type, x_dim, y_dim > operator* (const Type &a) const
 
mat< Type, x_dim, y_dim > operator/ (const Type &a) const
 
Type determinant ()
 

Protected Attributes

std::array< Type, x_dim *y_dim > m_data
 

Detailed Description

template<class Type, size_t x_dim, size_t y_dim>
class mat< Type, x_dim, y_dim >

A general matrix class for any size of matrix.

Template Parameters
Typeof vector

Definition at line 447 of file maths.h.

Constructor & Destructor Documentation

◆ mat() [1/4]

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim >::mat ( )
inline

Definition at line 452 of file maths.h.

◆ mat() [2/4]

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim >::mat ( const Type &  in)
inline

Definition at line 458 of file maths.h.

◆ mat() [3/4]

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim >::mat ( const std::array< Type, x_dim *y_dim > &  in)
inline

Definition at line 464 of file maths.h.

◆ mat() [4/4]

template<class Type , size_t x_dim, size_t y_dim>
template<class U >
mat< Type, x_dim, y_dim >::mat ( const mat< U, x_dim, y_dim > &  in)
inline

Definition at line 470 of file maths.h.

Member Function Documentation

◆ at() [1/2]

template<class Type , size_t x_dim, size_t y_dim>
Type & mat< Type, x_dim, y_dim >::at ( const size_t &  r,
const size_t &  c 
)
inline

Definition at line 490 of file maths.h.

◆ at() [2/2]

template<class Type , size_t x_dim, size_t y_dim>
const Type & mat< Type, x_dim, y_dim >::at ( const size_t &  r,
const size_t &  c 
) const
inline

Definition at line 486 of file maths.h.

◆ determinant()

template<class Type , size_t x_dim, size_t y_dim>
Type mat< Type, x_dim, y_dim >::determinant ( )
inline

Definition at line 665 of file maths.h.

◆ inverse()

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim > mat< Type, x_dim, y_dim >::inverse ( ) const
inline

Definition at line 519 of file maths.h.

◆ operator()() [1/2]

template<class Type , size_t x_dim, size_t y_dim>
Type & mat< Type, x_dim, y_dim >::operator() ( const size_t &  r,
const size_t &  c 
)
inline

Definition at line 476 of file maths.h.

◆ operator()() [2/2]

template<class Type , size_t x_dim, size_t y_dim>
const Type & mat< Type, x_dim, y_dim >::operator() ( const size_t &  r,
const size_t &  c 
) const
inline

Definition at line 481 of file maths.h.

◆ operator*() [1/2]

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim > mat< Type, x_dim, y_dim >::operator* ( const Type &  a) const
inline

Definition at line 651 of file maths.h.

◆ operator*() [2/2]

template<class Type , size_t x_dim, size_t y_dim>
vec2_T< Type > mat< Type, x_dim, y_dim >::operator* ( const vec2_T< Type > &  in) const
inline

Definition at line 643 of file maths.h.

◆ operator*=() [1/2]

template<class Type , size_t x_dim, size_t y_dim>
void mat< Type, x_dim, y_dim >::operator*= ( const mat< Type, x_dim, y_dim > &  in)
inline

Definition at line 617 of file maths.h.

◆ operator*=() [2/2]

template<class Type , size_t x_dim, size_t y_dim>
void mat< Type, x_dim, y_dim >::operator*= ( const Type &  a)
inline

Definition at line 631 of file maths.h.

◆ operator+()

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim > mat< Type, x_dim, y_dim >::operator+ ( const mat< Type, x_dim, y_dim > &  in)
inline

Definition at line 589 of file maths.h.

◆ operator+=()

template<class Type , size_t x_dim, size_t y_dim>
void mat< Type, x_dim, y_dim >::operator+= ( const mat< Type, x_dim, y_dim > &  in)
inline

Definition at line 605 of file maths.h.

◆ operator-() [1/2]

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim > mat< Type, x_dim, y_dim >::operator- ( )
inline

Definition at line 581 of file maths.h.

◆ operator-() [2/2]

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim > mat< Type, x_dim, y_dim >::operator- ( const mat< Type, x_dim, y_dim > &  in)
inline

Definition at line 597 of file maths.h.

◆ operator-=()

template<class Type , size_t x_dim, size_t y_dim>
void mat< Type, x_dim, y_dim >::operator-= ( const mat< Type, x_dim, y_dim > &  in)
inline

Definition at line 611 of file maths.h.

◆ operator/()

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim > mat< Type, x_dim, y_dim >::operator/ ( const Type &  a) const
inline

Definition at line 658 of file maths.h.

◆ operator/=()

template<class Type , size_t x_dim, size_t y_dim>
void mat< Type, x_dim, y_dim >::operator/= ( const Type &  a)
inline

Definition at line 637 of file maths.h.

◆ print()

template<class Type , size_t x_dim, size_t y_dim>
void mat< Type, x_dim, y_dim >::print ( ) const
inline

Definition at line 494 of file maths.h.

◆ toUpper()

template<class Type , size_t x_dim, size_t y_dim>
mat< Type, x_dim, y_dim > mat< Type, x_dim, y_dim >::toUpper ( )
inline

Definition at line 504 of file maths.h.

Member Data Documentation

◆ m_data

template<class Type , size_t x_dim, size_t y_dim>
std::array<Type, x_dim * y_dim> mat< Type, x_dim, y_dim >::m_data
protected

Definition at line 449 of file maths.h.