|
Not Enough Math
Lightweight zero-dependency C++ math library
|
#include <mat.hpp>
Public Types | |
| using | ITEM_TYPE = _T |
| using | COLUMN_TYPE = nem::vec<ITEM_TYPE, ROWS> |
| using | ROW_TYPE = nem::vec<ITEM_TYPE, COLUMNS> |
Public Member Functions | |
| constexpr COLUMN_TYPE & | column (size_t index) |
| constexpr const COLUMN_TYPE & | column (size_t index) const |
| constexpr COLUMN_TYPE & | operator[] (size_t col) |
| constexpr const COLUMN_TYPE & | operator[] (size_t col) const |
| constexpr ITEM_TYPE & | at (size_t row, size_t col) |
| constexpr const ITEM_TYPE & | at (size_t row, size_t col) const |
| constexpr ITEM_TYPE | item (size_t i) const |
| constexpr const ITEM_TYPE * | item_ptr (size_t i) const |
| constexpr ITEM_TYPE * | item_ptr (size_t i) |
| constexpr | mat () |
| constexpr | mat (ITEM_TYPE scalar) |
| constexpr | mat (std::initializer_list< std::initializer_list< ITEM_TYPE > > rows) |
| constexpr mat & | operator+= (const mat &other) |
Static Public Member Functions | |
| static constexpr mat | NaN () |
Public Attributes | ||
| union { | ||
| ITEM_TYPE data [ITEM_COUNT] = { 0 } | ||
| COLUMN_TYPE columns [COLUMNS] | ||
| }; | ||
Static Public Attributes | |
| static constexpr size_t | COLUMNS = _C |
| static constexpr size_t | ROWS = _R |
| static constexpr size_t | ITEM_COUNT = ROWS * COLUMNS |
Friends | |
| template<size_t OTHER_COLUMNS> | |
| constexpr friend mat< ITEM_TYPE, OTHER_COLUMNS, ROWS > | operator* (const mat &lhs, const mat< ITEM_TYPE, OTHER_COLUMNS, COLUMNS > &rhs) |
| constexpr friend mat | operator+ (mat lhs, const mat &rhs) |
| constexpr friend bool | operator== (const mat &lhs, const mat &rhs) |
| constexpr friend bool | operator!= (const mat &lhs, const mat &rhs) |
| constexpr friend nem::vec< ITEM_TYPE, ROWS > | operator* (const mat &lhs, const nem::vec< ITEM_TYPE, COLUMNS > &rhs) |
| using nem::mat< _T, _C, _R >::COLUMN_TYPE = nem::vec<ITEM_TYPE, ROWS> |
| using nem::mat< _T, _C, _R >::ITEM_TYPE = _T |
| using nem::mat< _T, _C, _R >::ROW_TYPE = nem::vec<ITEM_TYPE, COLUMNS> |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinestaticconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
friend |
|
friend |
|
friend |
| union { ... } nem::mat< _T, _C, _R > |
C
| m00 m01 m02 m03 Row 0 | m10 m11 m12 m13 Row 1 R | m20 m21 m22 m23 Row 2 | m30 m31 m32 m33 Row 3 | m40 m41 m42 m43 Row 4
Cl0 Cl1 Cl2 Cl3
Storage is column-major: columns[c] is contiguous in memory, and columns[c][r] is the element at row r, column c. operator[] indexes a column first (GLM-style); at(row, col) indexes by mathematical (row, column) notation instead.
|
staticconstexpr |
| COLUMN_TYPE nem::mat< _T, _C, _R >::columns[COLUMNS] |
| ITEM_TYPE nem::mat< _T, _C, _R >::data[ITEM_COUNT] = { 0 } |
|
staticconstexpr |
|
staticconstexpr |