|
|
| Matrix ()=default |
| | Default-constructs a 0x0 matrix.
|
| |
| | Matrix (std::size_t rows, std::size_t cols, double fill=0.0) |
| | Constructs an rows by cols matrix filled with fill.
|
| |
|
| Matrix (const Matrix &)=default |
| | Copy constructor.
|
| |
|
| Matrix (Matrix &&) noexcept=default |
| | Move constructor.
|
| |
|
Matrix & | operator= (const Matrix &)=default |
| | Copy assignment.
|
| |
|
Matrix & | operator= (Matrix &&) noexcept=default |
| | Move assignment.
|
| |
| std::size_t | rows () const noexcept |
| |
| std::size_t | cols () const noexcept |
| |
| bool | empty () const noexcept |
| |
| double & | operator() (std::size_t i, std::size_t j) |
| | Mutable element access.
|
| |
| const double & | operator() (std::size_t i, std::size_t j) const |
| | Const element access.
|
| |
| double * | data () noexcept |
| |
| const double * | data () const noexcept |
| |
| Matrix | operator+ (const Matrix &other) const |
| | Element-wise addition.
|
| |
| Matrix | operator- (const Matrix &other) const |
| | Element-wise subtraction.
|
| |
|
Matrix | operator* (double scalar) const |
| | Scalar multiplication.
|
| |
| Matrix | operator* (const Matrix &other) const |
| | Matrix product (this * other).
|
| |
| Vector | operator* (const Vector &v) const |
| | Matrix-vector product.
|
| |
|
Matrix & | operator+= (const Matrix &other) |
| | In-place element-wise addition.
|
| |
|
Matrix & | operator-= (const Matrix &other) |
| | In-place element-wise subtraction.
|
| |
|
Matrix & | operator*= (double scalar) |
| | In-place scalar multiplication.
|
| |
| Matrix | transposed () const |
| |
| Vector | row_sums () const |
| |
| Vector | col_sums () const |
| |
|
void | normalize_rows () |
| | Divides each row by its sum; zero-sum rows are unchanged.
|
| |
|
void | normalize_cols () |
| | Divides each column by its sum; zero-sum columns are unchanged.
|
| |
| Matrix | rows_normalized () const |
| |
| Matrix | cols_normalized () const |
| |
|
bool | is_equal (const Matrix &other, double abs_tol=1e-12) const |
| | Per-element absolute tolerance equality.
|
| |
|
bool | is_near (const Matrix &other, double abs_tol=1e-9, double rel_tol=1e-9) const |
| | Absolute and relative tolerance equality.
|
| |
Dense row-major matrix stored in a flat buffer.
Element (i, j) is at index i * cols() + j.