Castor3D 0.16.0
Multiplatform 3D engine
|
Templated column major matrix representation. More...
#include <Matrix.hpp>
Public Types | |
using | value_type = T |
using | col_type = Point< value_type, Rows > |
using | row_type = Point< value_type, Columns > |
using | transpose_type = Matrix< value_type, Rows, Columns > |
using | my_type = Matrix< value_type, Columns, Rows > |
Public Member Functions | |
value_type * | ptr () |
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) | |
template<typename Type > | |
Matrix (Type const *matrix) | |
template<typename Type > | |
Matrix (Array< Type, Columns *Rows > const &rhs) | |
template<typename Type > | |
Matrix (Matrix< Type, Columns, Rows > const &matrix) | |
Matrix (std::initializer_list< T > rhs) | |
~Matrix () noexcept=default | |
template<typename ... Types> requires isRightSize< Types... > | |
Matrix (Types &&... inits) | |
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_type & | operator[] (uint32_t index) |
value_type & | operator() (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 |
template<typename Type > | |
Matrix< T, Columns, Rows > & | operator= (Matrix< Type, Columns, Rows > const &rhs) |
template<typename Type > | |
Matrix< T, Columns, Rows > & | operator= (Type const *rhs) |
template<typename Type > | |
Matrix< T, Columns, Rows > & | operator+= (Matrix< Type, Columns, Rows > const &rhs) |
template<typename Type > | |
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) |
Matrix< T, Columns, Rows > & | operator/= (T const &rhs) |
Static Public Member Functions | |
static my_type | getIdentity () |
Protected Member Functions | |
my_type | recGetMinor (uint32_t x, uint32_t y, uint32_t rows, uint32_t cols) const |
Protected Attributes | ||
union { | ||
Array< T, Columns *Rows > m_data | ||
Array< col_type, Columns > m_columns | ||
}; | ||
Static Protected Attributes | |
static const std::size_t | count = Rows * Columns |
static const std::size_t | size = sizeof( T ) * Rows * Columns |
template<typename ... Types> | |
static bool constexpr | isRightSize = sizeof...( Types ) == count |
Friends | |
template<typename U , uint32_t C, uint32_t R> | |
class | Matrix |
Templated column major matrix representation.
using castor::Matrix< T, Columns, Rows >::col_type = Point< value_type, Rows > |
The column type
using castor::Matrix< T, Columns, Rows >::my_type = Matrix< value_type, Columns, Rows > |
This matrix type.
using castor::Matrix< T, Columns, Rows >::row_type = Point< value_type, Columns > |
The line type.
using castor::Matrix< T, Columns, Rows >::transpose_type = Matrix< value_type, Rows, Columns > |
The transposed matrix type.
using castor::Matrix< T, Columns, Rows >::value_type = T |
The data type.
castor::Matrix< T, Columns, Rows >::Matrix | ( | ) |
name Construction / Destruction.
|
explicit |
castor::Matrix< T, Columns, Rows >::Matrix | ( | Matrix< T, Columns, Rows > const & | matrix | ) |
|
noexcept |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
explicit |
|
defaultnoexcept |
|
inlineexplicit |
value_type const * castor::Matrix< T, Columns, Rows >::constPtr | ( | ) | const |
Point< value_type, Rows > & castor::Matrix< T, Columns, Rows >::getColumn | ( | uint32_t | index | ) |
Point< value_type, Rows > const & castor::Matrix< T, Columns, Rows >::getColumn | ( | uint32_t | index | ) | const |
void castor::Matrix< T, Columns, Rows >::getColumn | ( | uint32_t | index, |
Coords< value_type, Rows > & | result ) |
void castor::Matrix< T, Columns, Rows >::getColumn | ( | uint32_t | index, |
Point< value_type, Rows > & | result ) const |
|
static |
Point< value_type, Columns > castor::Matrix< T, Columns, Rows >::getRow | ( | uint32_t | index | ) | const |
void castor::Matrix< T, Columns, Rows >::getRow | ( | uint32_t | index, |
Point< value_type, Columns > & | result ) const |
value_type castor::Matrix< T, Columns, Rows >::getTrace | ( | ) | const |
transpose_type castor::Matrix< T, Columns, Rows >::getTransposed | ( | ) | const |
void castor::Matrix< T, Columns, Rows >::getTransposed | ( | transpose_type & | result | ) | const |
Computes the transposed of this matrix.
[in] | result | Receives the transposed. |
void castor::Matrix< T, Columns, Rows >::initialise | ( | ) |
Initialises the matrix to 0.
void castor::Matrix< T, Columns, Rows >::initialise | ( | value_type const & | value | ) |
Initialises the matrix as a Jordan one, with the given value.
[in] | value | The value. |
value_type & castor::Matrix< T, Columns, Rows >::operator() | ( | uint32_t | col, |
uint32_t | row ) |
value_type const & castor::Matrix< T, Columns, Rows >::operator() | ( | uint32_t | col, |
uint32_t | row ) const |
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator*= | ( | T const & | rhs | ) |
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator+= | ( | Matrix< Type, Columns, Rows > const & | rhs | ) |
name Arithmetic operators.
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator+= | ( | T const & | rhs | ) |
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator-= | ( | Matrix< Type, Columns, Rows > const & | rhs | ) |
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator-= | ( | T const & | rhs | ) |
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator/= | ( | T const & | rhs | ) |
|
noexcept |
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator= | ( | Matrix< T, Columns, Rows > const & | rhs | ) |
name Assignment operators.
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator= | ( | Matrix< Type, Columns, Rows > const & | rhs | ) |
Matrix< T, Columns, Rows > & castor::Matrix< T, Columns, Rows >::operator= | ( | Type const * | rhs | ) |
col_type & castor::Matrix< T, Columns, Rows >::operator[] | ( | uint32_t | index | ) |
col_type const & castor::Matrix< T, Columns, Rows >::operator[] | ( | uint32_t | index | ) | const |
name Array access.
value_type * castor::Matrix< T, Columns, Rows >::ptr | ( | ) |
|
protected |
void castor::Matrix< T, Columns, Rows >::setColumn | ( | uint32_t | index, |
Coords< value_type const, Rows > const & | col ) |
void castor::Matrix< T, Columns, Rows >::setColumn | ( | uint32_t | index, |
Coords< value_type, Rows > const & | col ) |
void castor::Matrix< T, Columns, Rows >::setColumn | ( | uint32_t | index, |
Point< value_type, Rows > const & | col ) |
void castor::Matrix< T, Columns, Rows >::setColumn | ( | uint32_t | index, |
value_type const * | col ) |
void castor::Matrix< T, Columns, Rows >::setIdentity | ( | ) |
sets this matrix to identity
void castor::Matrix< T, Columns, Rows >::setRow | ( | uint32_t | index, |
Coords< value_type, Columns > const & | row ) |
void castor::Matrix< T, Columns, Rows >::setRow | ( | uint32_t | index, |
Point< value_type, Columns > const & | row ) |
void castor::Matrix< T, Columns, Rows >::setRow | ( | uint32_t | index, |
value_type const * | row ) |
name Row/column access.
|
friend |
union { ... } castor::Matrix< T, Columns, Rows > |
|
staticprotected |
|
staticconstexprprotected |
Array< col_type, Columns > castor::Matrix< T, Columns, Rows >::m_columns |
Array< T, Columns * Rows > castor::Matrix< T, Columns, Rows >::m_data |
|
staticprotected |