Antkeeper
0.0.1
|
n by m column-major matrix. More...
#include <matrix.hpp>
Public Types | |
using | element_type = T |
Element type. More... | |
using | column_vector_type = vector< element_type, row_count > |
Matrix column vector data type. More... | |
using | row_vector_type = vector< element_type, column_count > |
Matrix row vector data type. More... | |
Public Member Functions | |
Column access | |
constexpr column_vector_type & | operator[] (std::size_t i) noexcept |
Returns a reference to the column vector at a given index. More... | |
constexpr const column_vector_type & | operator[] (std::size_t i) const noexcept |
Returns a reference to the column vector at a given index. More... | |
constexpr column_vector_type & | column (std::size_t i) noexcept |
Returns a reference to the column vector at a given index. More... | |
constexpr const column_vector_type & | column (std::size_t i) const noexcept |
Returns a reference to the column vector at a given index. More... | |
constexpr column_vector_type & | front () noexcept |
Returns a reference to the first column vector. More... | |
constexpr const column_vector_type & | front () const noexcept |
Returns a reference to the first column vector. More... | |
constexpr column_vector_type & | back () noexcept |
Returns a reference to the last column vector. More... | |
constexpr const column_vector_type & | back () const noexcept |
Returns a reference to the last column vector. More... | |
Element access | |
constexpr T & | element (std::size_t i) noexcept |
Returns a reference to the element at a given column-major index. More... | |
constexpr const T & | element (std::size_t i) const noexcept |
Returns a reference to the element at a given column-major index. More... | |
constexpr element_type * | data () noexcept |
Returns a pointer to the first element. More... | |
constexpr const element_type * | data () const noexcept |
Returns a pointer to the first element. More... | |
Iterators | |
constexpr column_vector_type * | begin () noexcept |
Returns an iterator to the first column vector. More... | |
constexpr const column_vector_type * | begin () const noexcept |
Returns an iterator to the first column vector. More... | |
constexpr const column_vector_type * | cbegin () const noexcept |
Returns an iterator to the first column vector. More... | |
constexpr column_vector_type * | end () noexcept |
Returns an iterator to the column vector following the last column vector. More... | |
constexpr const column_vector_type * | end () const noexcept |
Returns an iterator to the column vector following the last column vector. More... | |
constexpr const column_vector_type * | cend () const noexcept |
Returns an iterator to the column vector following the last column vector. More... | |
constexpr std::reverse_iterator< column_vector_type * > | rbegin () noexcept |
Returns a reverse iterator to the first column vector of the reversed matrix. More... | |
constexpr std::reverse_iterator< const column_vector_type * > | rbegin () const noexcept |
Returns a reverse iterator to the first column vector of the reversed matrix. More... | |
constexpr std::reverse_iterator< const column_vector_type * > | crbegin () const noexcept |
Returns a reverse iterator to the first column vector of the reversed matrix. More... | |
constexpr std::reverse_iterator< column_vector_type * > | rend () noexcept |
Returns a reverse iterator to the column vector following the last column vector of the reversed matrix. More... | |
constexpr std::reverse_iterator< const column_vector_type * > | rend () const noexcept |
Returns a reverse iterator to the column vector following the last column vector of the reversed matrix. More... | |
constexpr std::reverse_iterator< const column_vector_type * > | crend () const noexcept |
Returns a reverse iterator to the column vector following the last column vector of the reversed matrix. More... | |
Capacity | |
constexpr std::size_t | size () const noexcept |
Returns the number of elements in the matrix. More... | |
Public Attributes | |
column_vector_type | columns [column_count] |
Array of matrix column vectors. More... | |
Static Public Attributes | |
static constexpr std::size_t | column_count = N |
Number of columns. More... | |
static constexpr std::size_t | row_count = M |
Number of rows. More... | |
static constexpr std::size_t | element_count = column_count * row_count |
Number of elements. More... | |
Conversion | |
template<class U > | |
constexpr | operator matrix< U, N, M > () const noexcept |
Type-casts the elements of this matrix using static_cast . More... | |
template<std::size_t P, std::size_t O> | |
constexpr | operator matrix< T, P, O > () const noexcept |
Size-casts this matrix to a matrix with different dimensions. More... | |
Constants | |
static constexpr matrix | zero () noexcept |
Returns a zero matrix, where every element is equal to zero. More... | |
static constexpr matrix | one () noexcept |
Returns a matrix of ones, where every element is equal to one. More... | |
static constexpr matrix | identity () noexcept |
Returns an identity matrix, with ones on the main diagonal and zeros elsewhere. More... | |
n by m column-major matrix.
T | Element type. |
N | Number of columns. |
M | Number of rows. |
Definition at line 43 of file math/matrix.hpp.
using math::matrix< T, N, M >::column_vector_type = vector<element_type, row_count> |
Matrix column vector data type.
Definition at line 58 of file math/matrix.hpp.
using math::matrix< T, N, M >::element_type = T |
Element type.
Definition at line 46 of file math/matrix.hpp.
using math::matrix< T, N, M >::row_vector_type = vector<element_type, column_count> |
Matrix row vector data type.
Definition at line 61 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the last column vector.
Definition at line 170 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the last column vector.
Definition at line 166 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the first column vector.
Definition at line 228 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the first column vector.
Definition at line 224 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the first column vector.
Definition at line 232 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the column vector following the last column vector.
Definition at line 250 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the column vector at a given index.
i | Index of a column vector. |
i
. Definition at line 142 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the column vector at a given index.
i | Index of a column vector. |
i
. Definition at line 138 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the first column vector of the reversed matrix.
Definition at line 268 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the column vector following the last column vector of the reversed matrix.
Definition at line 286 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a pointer to the first element.
Definition at line 209 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a pointer to the first element.
Definition at line 205 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the element at a given column-major index.
i | Column-major index of a matrix element. |
i
. Definition at line 193 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the element at a given column-major index.
i | Column-major index of a matrix element. |
i
. Definition at line 189 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the column vector following the last column vector.
Definition at line 246 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns an iterator to the column vector following the last column vector.
Definition at line 242 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first column vector.
Definition at line 156 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the first column vector.
Definition at line 152 of file math/matrix.hpp.
|
inlinestaticconstexprnoexcept |
Returns an identity matrix, with ones on the main diagonal and zeros elsewhere.
Definition at line 353 of file math/matrix.hpp.
|
inlinestaticconstexprnoexcept |
Returns a matrix of ones, where every element is equal to one.
Definition at line 331 of file math/matrix.hpp.
|
inlineexplicitconstexprnoexcept |
Size-casts this matrix to a matrix with different dimensions.
Casting to greater dimensions causes new elements to be set to identity matrix elements.
P | Target number of columns. |
O | Target number of rows. |
Definition at line 112 of file math/matrix.hpp.
|
inlineexplicitconstexprnoexcept |
Type-casts the elements of this matrix using static_cast
.
U | Target element type. |
Definition at line 84 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the column vector at a given index.
i | Index of a column vector. |
i
. Definition at line 134 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reference to the column vector at a given index.
i | Index of a column vector. |
i
. Definition at line 130 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the first column vector of the reversed matrix.
Definition at line 264 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the first column vector of the reversed matrix.
Definition at line 260 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the column vector following the last column vector of the reversed matrix.
Definition at line 282 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns a reverse iterator to the column vector following the last column vector of the reversed matrix.
Definition at line 278 of file math/matrix.hpp.
|
inlineconstexprnoexcept |
Returns the number of elements in the matrix.
Definition at line 300 of file math/matrix.hpp.
|
inlinestaticconstexprnoexcept |
Returns a zero matrix, where every element is equal to zero.
Definition at line 313 of file math/matrix.hpp.
|
staticconstexpr |
Number of columns.
Definition at line 49 of file math/matrix.hpp.
column_vector_type math::matrix< T, N, M >::columns[column_count] |
Array of matrix column vectors.
Definition at line 64 of file math/matrix.hpp.
|
staticconstexpr |
Number of elements.
Definition at line 55 of file math/matrix.hpp.
|
staticconstexpr |
Number of rows.
Definition at line 52 of file math/matrix.hpp.