|
aest 0.1.0
Collection of C++ utility libraries
|
Partition aest.blas:matrix: fixed-size vectors and matrices and their compile-time operations. More...
#include <array>#include <concepts>#include <cstddef>Go to the source code of this file.
Typedefs | |
| template<typename T, std::size_t Size> | |
| using | aest::blas::Vector = std::array<T, Size> |
| A column vector of fixed size. | |
| template<typename T, std::size_t Rows, std::size_t Columns> | |
| using | aest::blas::Matrix = std::array<Vector<T, Columns>, Rows> |
| A matrix of fixed size, stored as an array of rows. | |
Functions | |
| template<typename T> | |
| constexpr T | aest::blas::cofactor (const std::array< std::array< T, 3 >, 3 > &matrix, const std::size_t row, const std::size_t column) |
| Cofactor of one element of a 3x3 matrix, sign included. | |
| template<typename T, std::size_t Rows, std::size_t Columns> | |
| constexpr Vector< T, Rows > | aest::blas::multiply (const Matrix< T, Rows, Columns > &matrix, const Vector< T, Columns > &vector) |
| Multiplies a matrix by a column vector. | |
| template<typename T, std::size_t Rows, std::size_t Inner, std::size_t Columns> | |
| constexpr Matrix< T, Rows, Columns > | aest::blas::multiply (const Matrix< T, Rows, Inner > &lhs, const Matrix< T, Inner, Columns > &rhs) |
| Multiplies two matrices. | |
| template<typename T, std::size_t Rows, std::size_t Columns> | |
| constexpr Matrix< T, Columns, Rows > | aest::blas::transpose (const Matrix< T, Rows, Columns > &matrix) |
| Swaps the rows and columns of a matrix. | |
| template<typename T, std::size_t Size> | |
| constexpr Matrix< T, Size, Size > | aest::blas::diagonal (const Vector< T, Size > &vector) |
| Builds a square matrix with a vector on its diagonal and 0 elsewhere. | |
| template<typename T> | |
| constexpr T | aest::blas::determinant (const Matrix< T, 3, 3 > &matrix) |
| Determinant of a 3x3 matrix, by cofactor expansion along the first row. | |
| template<std::floating_point T> | |
| constexpr Matrix< T, 3, 3 > | aest::blas::inverse (const Matrix< T, 3, 3 > &matrix) |
| Inverts a 3x3 matrix through its adjugate. | |
Partition aest.blas:matrix: fixed-size vectors and matrices and their compile-time operations.
Definition in file Matrix.cppm.
|
export |
A matrix of fixed size, stored as an array of rows.
| T | The element type |
| Rows | The number of rows |
| Columns | The number of columns |
Definition at line 57 of file Matrix.cppm.
|
export |
A column vector of fixed size.
| T | The element type |
| Size | The number of elements |
Definition at line 48 of file Matrix.cppm.
|
constexpr |
Cofactor of one element of a 3x3 matrix, sign included.
| T | The element type |
| [in] | matrix | The matrix, a Matrix<T, 3, 3> |
| [in] | row | Row of the element |
| [in] | column | Column of the element |
row and column, with the sign of the element's position. Definition at line 26 of file Matrix.cppm.
|
constexprexport |
Determinant of a 3x3 matrix, by cofactor expansion along the first row.
| T | The element type |
| [in] | matrix | The matrix |
matrix. Definition at line 142 of file Matrix.cppm.
|
constexprexport |
Builds a square matrix with a vector on its diagonal and 0 elsewhere.
| T | The element type |
| Size | The number of elements of vector, and of rows and columns |
| [in] | vector | The diagonal |
vector. Definition at line 128 of file Matrix.cppm.
|
constexprexport |
Inverts a 3x3 matrix through its adjugate.
| T | The element type, a floating-point type |
| [in] | matrix | The matrix to invert |
matrix. matrix is invertible: its determinant is not 0. Definition at line 158 of file Matrix.cppm.
|
constexprexport |
Multiplies a matrix by a column vector.
| T | The element type |
| Rows | The number of rows of matrix and elements of the result |
| Columns | The number of columns of matrix and elements of vector |
| [in] | matrix | The matrix |
| [in] | vector | The column vector |
Definition at line 69 of file Matrix.cppm.
|
constexprexport |
Multiplies two matrices.
| T | The element type |
| Rows | The number of rows of lhs and of the result |
| Inner | The number of columns of lhs and rows of rhs |
| Columns | The number of columns of rhs and of the result |
| [in] | lhs | The left-hand matrix |
| [in] | rhs | The right-hand matrix |
rhs first when used on a vector. Definition at line 90 of file Matrix.cppm.
|
constexprexport |
Swaps the rows and columns of a matrix.
| T | The element type |
| Rows | The number of rows of matrix |
| Columns | The number of columns of matrix |
| [in] | matrix | The matrix to transpose |
matrix. Definition at line 110 of file Matrix.cppm.