|
NTLib - Number Theory Library 0.9
|
Primary module interface unit for module matrix. More...
#include <cassert>#include <concepts>#include <cstddef>#include <initializer_list>#include <ostream>#include <string>import base;
Classes | |
| class | ntlib::matrix< ROWS, COLUMNS, T > |
| Represents a matrix with a given number of rows and colums. More... | |
| class | ntlib::algebra_traits< matrix< ROWS, COLUMNS, T > > |
| Specialization of ntlib::algebra_traits for matrix. More... | |
Functions | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| std::string | ntlib::to_string (matrix< ROWS, COLUMNS, T > mat) |
| Converts a given matrix into a human readable string representation. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| std::ostream & | ntlib::operator<< (std::ostream &os, const matrix< ROWS, COLUMNS, T > &m) |
| Writes a string representation of a given matrix to a given output stream. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator+ (matrix< ROWS, COLUMNS, T > lhs, const matrix< ROWS, COLUMNS, T > &rhs) |
| Plus operator for matrix addition. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator- (matrix< ROWS, COLUMNS, T > lhs, const matrix< ROWS, COLUMNS, T > &rhs) |
| Minus operator for matrix subtraction. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator* (matrix< ROWS, COLUMNS, T > lhs, T rhs) |
| Times operator for right scalar multiplication. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator* (T lhs, matrix< ROWS, COLUMNS, T > rhs) |
| Times operator for left scalar multiplication. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator/ (matrix< ROWS, COLUMNS, T > lhs, T rhs) |
| Divides operator for scalar division. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator% (matrix< ROWS, COLUMNS, T > lhs, T rhs) |
| Modulo operator for elementwise modulo by a scalar. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator+ (const matrix< ROWS, COLUMNS, T > &rhs) |
| Unary plus operator. Does nothing. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T> | |
| matrix< ROWS, COLUMNS, T > | ntlib::operator- (const matrix< ROWS, COLUMNS, T > &rhs) |
| Unary minus operator. | |
| template<std::size_t ROWS_LHS, std::size_t COLUMNS_LHS, std::size_t ROWS_RHS, std::size_t COLUMNS_RHS, Ring T> | |
| matrix< ROWS_LHS, COLUMNS_RHS, T > | ntlib::operator* (const matrix< ROWS_LHS, COLUMNS_LHS, T > &lhs, const matrix< ROWS_RHS, COLUMNS_RHS, T > &rhs) |
| Times operator for matrix multiplication. | |
| template<std::size_t ROWS, std::size_t COLUMNS, Ring T, std::invocable< T > F> | |
| matrix< ROWS, COLUMNS, T > | ntlib::exec_each_element (const matrix< ROWS, COLUMNS, T > &m, const F &func) |
| Executes a function an each element. | |
Primary module interface unit for module matrix.
|
export |
Executes a function an each element.
TODO (pjungeblut): Try to get rid of this function.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| F | A function object. |
| m | The matrix. |
| func | The function to execute. |
|
export |
Modulo operator for elementwise modulo by a scalar.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| lhs | The dividend. A matrix. |
| rhs | The divisor. A scalar. |
|
export |
Times operator for matrix multiplication.
| ROWS_LHS | The number of rows of the first factor. |
| COLUMNS_LHS | The number of columns of the first factor. |
| ROWS_RHS | The number of rows of the second factor. |
| COLUMNS_RHS | The number of columns of the second factor. |
| T | The element type. |
| lhs | The first factor. |
| rhs | The second factor. |
|
export |
Times operator for right scalar multiplication.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| lhs | The first factor, a matrix. |
| rhs | The second factor, a scalar. |
|
export |
Times operator for left scalar multiplication.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| lhs | The first factor, a scalar. |
| rhs | The second factor, a matrix. |
|
export |
Unary plus operator. Does nothing.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| rhs | The matrix.. |
|
nodiscardexport |
Plus operator for matrix addition.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| lhs | The first summand. |
| rhs | The second summand. |
|
export |
Unary minus operator.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| rhs | The matrix. |
|
export |
Minus operator for matrix subtraction.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| lhs | The minuend. |
| rhs | The subtrahend. |
|
export |
Divides operator for scalar division.
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| lhs | The dividend. A matrix. |
| rhs | The divisor. A scalar. |
|
export |
Writes a string representation of a given matrix to a given output stream.
| ROWS | The number of rows. |
| COLUMS | The number of colums. |
| T | The element type. |
| os | The given output stream. |
| m | The given matrix. |
|
export |
Converts a given matrix into a human readable string representation.
For example, the matrix
\[\begin{pmatrix} a & b \\ c & d \end{pmatrix} \]
will be converted into "{{a,b},{c,d}}".
| ROWS | The number of rows. |
| COLUMNS | The number of columns. |
| T | The element type. |
| mat | The given matrix. |