Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | Static Public Attributes | List of all members
castor::SquareMatrix< T, Count > Class Template Reference

Templated column major square matrix representation. More...

#include <SquareMatrix.hpp>

Inheritance diagram for castor::SquareMatrix< T, Count >:
Inheritance graph
[legend]
Collaboration diagram for castor::SquareMatrix< T, Count >:
Collaboration graph
[legend]

Public Types

using matrix_type = Matrix< T, Count, Count >
 
using square_type = SquareMatrix< T, Count >
 
using transpose_type = square_type
 
- Public Types inherited from castor::Matrix< T, Count, Count >
using value_type
 
using col_type
 
using row_type
 
using transpose_type
 
using my_type
 

Public Member Functions

SquareMatrix< T, Count - 1 > getMinor (uint32_t x, uint32_t y) const
 Retrieves a minor matrix, ignoring given line and column.
 
value_type getCofactor (uint32_t column, uint32_t row) const
 Computes the cofactor value of given row and column.
 
value_type getDeterminant () const
 Computes the determinant of this matrix.
 
transpose_type getTransposed () const
 Computes and returns the transposed of this matrix.
 
square_typetranspose ()
 Transposes this matrix.
 
bool isOrthogonal () const
 Tells if the matrix is orthogonal.
 
bool isSymmetrical () const
 Tells if this matrix is symmetrical.
 
bool isAntiSymmetrical () const
 Tells if this matrix is anti symmetrical.
 
SquareMatrix< T, Count > getInverse () const
 Retrieves the inverse of this matrix.
 
SquareMatrix< T, Count > & invert ()
 Inverts this matrix.
 
 SquareMatrix ()
 
 SquareMatrix (NoInit const &)
 
 SquareMatrix (T const &rhs)
 
 SquareMatrix (SquareMatrix const &rhs)
 
 SquareMatrix (SquareMatrix &&rhs) noexcept
 
template<uint32_t CountU>
 SquareMatrix (SquareMatrix< T, CountU > const &rhs)
 
template<typename Type >
 SquareMatrix (SquareMatrix< Type, Count > const &rhs)
 
template<typename Type >
 SquareMatrix (Matrix< Type, Count, Count > const &rhs)
 
template<typename Type >
 SquareMatrix (Array< Type, Count *Count > const &rhs)
 
template<typename Type >
 SquareMatrix (Type const *rhs)
 
 SquareMatrix (std::initializer_list< T > rhs)
 
template<typename ... Types>
requires isRightSize< Types... >
 SquareMatrix (Types &&... inits)
 
template<typename Type >
SquareMatrix< T, Count > & operator= (Matrix< Type, Count, Count > const &rhs)
 
SquareMatrix< T, Count > & operator= (SquareMatrix< T, Count > const &rhs)
 
SquareMatrix< T, Count > & operator= (SquareMatrix< T, Count > &&rhs) noexcept
 
template<typename Type >
SquareMatrix< T, Count > & operator= (SquareMatrix< Type, Count > const &rhs)
 
template<typename Type >
SquareMatrix< T, Count > & operator= (Type const *rhs)
 
template<typename Type >
SquareMatrix< T, Count > & operator+= (SquareMatrix< Type, Count > const &rhs)
 
template<typename Type >
SquareMatrix< T, Count > & operator-= (SquareMatrix< Type, Count > const &rhs)
 
template<typename Type >
SquareMatrix< T, Count > & operator*= (SquareMatrix< Type, Count > const &rhs)
 
template<typename Type >
SquareMatrix< T, Count > & operator+= (Type const *rhs)
 
template<typename Type >
SquareMatrix< T, Count > & operator-= (Type const *rhs)
 
template<typename Type >
SquareMatrix< T, Count > & operator*= (Type const *rhs)
 
SquareMatrix< T, Count > & operator+= (T const &rhs)
 
SquareMatrix< T, Count > & operator-= (T const &rhs)
 
SquareMatrix< T, Count > & operator*= (T const &rhs)
 
SquareMatrix< T, Count > & operator/= (T const &rhs)
 
- Public Member Functions inherited from castor::Matrix< T, Count, Count >
value_typeptr ()
 
value_type const * constPtr () const
 
void initialise ()
 Initialises the matrix to 0.
 
void initialise (value_type const &value)
 Initialises the matrix as a Jordan one, with the given value.
 
transpose_type getTransposed () const
 
void getTransposed (transpose_type &result) const
 Computes the transposed of this matrix.
 
value_type getTrace () const
 
void setIdentity ()
 sets this matrix to identity
 
 Matrix ()
 
 Matrix (NoInit const &)
 
 Matrix (Matrix const &matrix)
 
 Matrix (Matrix &&matrix) noexcept
 
 Matrix (T const &value)
 
 Matrix (T *matrix)
 
 Matrix (Type const *matrix)
 
 Matrix (Array< Type, Columns *Rows > const &rhs)
 
 Matrix (Matrix< Type, Columns, Rows > const &matrix)
 
 Matrix (std::initializer_list< T > rhs)
 
 Matrix (Types &&... inits)
 
 ~Matrix () noexcept=default
 
void setRow (uint32_t index, value_type const *row)
 
void setRow (uint32_t index, Point< value_type, Columns > const &row)
 
void setRow (uint32_t index, Coords< value_type, Columns > const &row)
 
Point< value_type, Columns > getRow (uint32_t index) const
 
void getRow (uint32_t index, Point< value_type, Columns > &result) const
 
void setColumn (uint32_t index, value_type const *col)
 
void setColumn (uint32_t index, Point< value_type, Rows > const &col)
 
void setColumn (uint32_t index, Coords< value_type const, Rows > const &col)
 
void setColumn (uint32_t index, Coords< value_type, Rows > const &col)
 
Point< value_type, Rows > const & getColumn (uint32_t index) const
 
Point< value_type, Rows > & getColumn (uint32_t index)
 
void getColumn (uint32_t index, Point< value_type, Rows > &result) const
 
void getColumn (uint32_t index, Coords< value_type, Rows > &result)
 
col_type const & operator[] (uint32_t index) const
 
col_typeoperator[] (uint32_t index)
 
value_typeoperator() (uint32_t col, uint32_t row)
 
value_type const & operator() (uint32_t col, uint32_t row) const
 
Matrix< T, Columns, Rows > & operator= (Matrix< T, Columns, Rows > const &rhs)
 
Matrix< T, Columns, Rows > & operator= (Matrix< T, Columns, Rows > &&rhs) noexcept
 
Matrix< T, Columns, Rows > & operator= (Matrix< Type, Columns, Rows > const &rhs)
 
Matrix< T, Columns, Rows > & operator= (Type const *rhs)
 
Matrix< T, Columns, Rows > & operator+= (Matrix< Type, Columns, Rows > const &rhs)
 
Matrix< T, Columns, Rows > & operator+= (T const &rhs)
 
Matrix< T, Columns, Rows > & operator-= (Matrix< Type, Columns, Rows > const &rhs)
 
Matrix< T, Columns, Rows > & operator-= (T const &rhs)
 
Matrix< T, Columns, Rows > & operator*= (T const &rhs)
 
Matrix< T, Columns, Rows > & operator/= (T const &rhs)
 

Static Public Attributes

template<typename ... Types>
static bool constexpr isRightSize = sizeof...( Types ) == Count * Count
 

Additional Inherited Members

- Static Public Member Functions inherited from castor::Matrix< T, Count, Count >
static my_type getIdentity ()
 
- Public Attributes inherited from castor::Matrix< T, Count, Count >
Array< T, Columns *Rows > m_data
 
Array< col_type, Columns > m_columns
 
- Protected Member Functions inherited from castor::Matrix< T, Count, Count >
my_type recGetMinor (uint32_t x, uint32_t y, uint32_t rows, uint32_t cols) const
 
- Protected Attributes inherited from castor::Matrix< T, Count, Count >
union { 
 
   Array< T, Columns *Rows >   m_data 
 
   Array< col_type, Columns >   m_columns 
 
};  
 
- Static Protected Attributes inherited from castor::Matrix< T, Count, Count >
static const std::size_t count
 
static const std::size_t size
 
static bool constexpr isRightSize
 

Detailed Description

template<typename T, uint32_t Count>
class castor::SquareMatrix< T, Count >

Templated column major square matrix representation.

Member Typedef Documentation

◆ matrix_type

template<typename T , uint32_t Count>
using castor::SquareMatrix< T, Count >::matrix_type = Matrix< T, Count, Count >

This matrix type

◆ square_type

template<typename T , uint32_t Count>
using castor::SquareMatrix< T, Count >::square_type = SquareMatrix< T, Count >

This matrix type

◆ transpose_type

template<typename T , uint32_t Count>
using castor::SquareMatrix< T, Count >::transpose_type = square_type

The transposed matrix type

Constructor & Destructor Documentation

◆ SquareMatrix() [1/12]

template<typename T , uint32_t Count>
castor::SquareMatrix< T, Count >::SquareMatrix ( )

name Construction / Destruction.

◆ SquareMatrix() [2/12]

template<typename T , uint32_t Count>
castor::SquareMatrix< T, Count >::SquareMatrix ( NoInit const & )
explicit

◆ SquareMatrix() [3/12]

template<typename T , uint32_t Count>
castor::SquareMatrix< T, Count >::SquareMatrix ( T const & rhs)
explicit

◆ SquareMatrix() [4/12]

template<typename T , uint32_t Count>
castor::SquareMatrix< T, Count >::SquareMatrix ( SquareMatrix< T, Count > const & rhs)

◆ SquareMatrix() [5/12]

template<typename T , uint32_t Count>
castor::SquareMatrix< T, Count >::SquareMatrix ( SquareMatrix< T, Count > && rhs)
noexcept

◆ SquareMatrix() [6/12]

template<typename T , uint32_t Count>
template<uint32_t CountU>
castor::SquareMatrix< T, Count >::SquareMatrix ( SquareMatrix< T, CountU > const & rhs)
explicit

◆ SquareMatrix() [7/12]

template<typename T , uint32_t Count>
template<typename Type >
castor::SquareMatrix< T, Count >::SquareMatrix ( SquareMatrix< Type, Count > const & rhs)
explicit

◆ SquareMatrix() [8/12]

template<typename T , uint32_t Count>
template<typename Type >
castor::SquareMatrix< T, Count >::SquareMatrix ( Matrix< Type, Count, Count > const & rhs)
explicit

◆ SquareMatrix() [9/12]

template<typename T , uint32_t Count>
template<typename Type >
castor::SquareMatrix< T, Count >::SquareMatrix ( Array< Type, Count *Count > const & rhs)
explicit

◆ SquareMatrix() [10/12]

template<typename T , uint32_t Count>
template<typename Type >
castor::SquareMatrix< T, Count >::SquareMatrix ( Type const * rhs)
explicit

◆ SquareMatrix() [11/12]

template<typename T , uint32_t Count>
castor::SquareMatrix< T, Count >::SquareMatrix ( std::initializer_list< T > rhs)
explicit

◆ SquareMatrix() [12/12]

template<typename T , uint32_t Count>
template<typename ... Types>
requires isRightSize< Types... >
castor::SquareMatrix< T, Count >::SquareMatrix ( Types &&... inits)
inlineexplicit

Member Function Documentation

◆ getCofactor()

template<typename T , uint32_t Count>
value_type castor::SquareMatrix< T, Count >::getCofactor ( uint32_t column,
uint32_t row ) const

Computes the cofactor value of given row and column.

Parameters
[in]row,columnRow and column
Returns
The cofactor

◆ getDeterminant()

template<typename T , uint32_t Count>
value_type castor::SquareMatrix< T, Count >::getDeterminant ( ) const

Computes the determinant of this matrix.

Returns
The determinant

◆ getInverse()

template<typename T , uint32_t Count>
SquareMatrix< T, Count > castor::SquareMatrix< T, Count >::getInverse ( ) const

Retrieves the inverse of this matrix.

Returns
The inverse

◆ getMinor()

template<typename T , uint32_t Count>
SquareMatrix< T, Count - 1 > castor::SquareMatrix< T, Count >::getMinor ( uint32_t x,
uint32_t y ) const

Retrieves a minor matrix, ignoring given line and column.

Parameters
[in]x,yLine and column ignored
Returns
The minor matrix

◆ getTransposed()

template<typename T , uint32_t Count>
transpose_type castor::SquareMatrix< T, Count >::getTransposed ( ) const

Computes and returns the transposed of this matrix.

Returns
The transposed

◆ invert()

template<typename T , uint32_t Count>
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::invert ( )

Inverts this matrix.

Returns
A reference to this matrix

◆ isAntiSymmetrical()

template<typename T , uint32_t Count>
bool castor::SquareMatrix< T, Count >::isAntiSymmetrical ( ) const

Tells if this matrix is anti symmetrical.

Returns
true if it is anti symmetrical

◆ isOrthogonal()

template<typename T , uint32_t Count>
bool castor::SquareMatrix< T, Count >::isOrthogonal ( ) const

Tells if the matrix is orthogonal.

Returns
true if it is orthogonal

◆ isSymmetrical()

template<typename T , uint32_t Count>
bool castor::SquareMatrix< T, Count >::isSymmetrical ( ) const

Tells if this matrix is symmetrical.

Returns
true if it is symmetrical

◆ operator*=() [1/3]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator*= ( SquareMatrix< Type, Count > const & rhs)

◆ operator*=() [2/3]

template<typename T , uint32_t Count>
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator*= ( T const & rhs)

◆ operator*=() [3/3]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator*= ( Type const * rhs)

◆ operator+=() [1/3]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator+= ( SquareMatrix< Type, Count > const & rhs)

name Arithmetic operators.

◆ operator+=() [2/3]

template<typename T , uint32_t Count>
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator+= ( T const & rhs)

◆ operator+=() [3/3]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator+= ( Type const * rhs)

◆ operator-=() [1/3]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator-= ( SquareMatrix< Type, Count > const & rhs)

◆ operator-=() [2/3]

template<typename T , uint32_t Count>
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator-= ( T const & rhs)

◆ operator-=() [3/3]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator-= ( Type const * rhs)

◆ operator/=()

template<typename T , uint32_t Count>
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator/= ( T const & rhs)

◆ operator=() [1/5]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator= ( Matrix< Type, Count, Count > const & rhs)

name Assignment operators.

◆ operator=() [2/5]

template<typename T , uint32_t Count>
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator= ( SquareMatrix< T, Count > && rhs)
noexcept

◆ operator=() [3/5]

template<typename T , uint32_t Count>
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator= ( SquareMatrix< T, Count > const & rhs)

◆ operator=() [4/5]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator= ( SquareMatrix< Type, Count > const & rhs)

◆ operator=() [5/5]

template<typename T , uint32_t Count>
template<typename Type >
SquareMatrix< T, Count > & castor::SquareMatrix< T, Count >::operator= ( Type const * rhs)

◆ transpose()

template<typename T , uint32_t Count>
square_type & castor::SquareMatrix< T, Count >::transpose ( )

Transposes this matrix.

Returns
This matrix

Member Data Documentation

◆ isRightSize

template<typename T , uint32_t Count>
template<typename ... Types>
bool constexpr castor::SquareMatrix< T, Count >::isRightSize = sizeof...( Types ) == Count * Count
staticconstexpr

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