Loading...
Searching...
No Matches
Owning, contiguous, row-major double matrix.
More...
#include <aigenlib.hpp>
|
| | Matrix ()=default |
| | Construct an empty matrix.
|
| | Matrix (std::size_t rows, std::size_t columns, double value=0.0) |
| | Allocate initialized storage.
|
| | Matrix (const Matrix &other)=default |
| | Deep copy.
|
| Matrix & | operator= (const Matrix &other) |
| | Deep assignment with strong exception guarantee.
|
| | Matrix (Matrix &&other) noexcept |
| | Transfer storage.
|
| Matrix & | operator= (Matrix &&other) noexcept |
| | Transfer storage.
|
| std::size_t | rows () const noexcept |
| | Row count.
|
| std::size_t | cols () const noexcept |
| | Column count.
|
| std::size_t | size () const noexcept |
| | Allocated scalar count.
|
| double & | operator() (std::size_t row, std::size_t column) |
| | Checked access.
|
| double | operator() (std::size_t row, std::size_t column) const |
| | Checked access.
|
| double * | row_data (std::size_t row) |
| | Borrow a row.
|
| const double * | row_data (std::size_t row) const |
| | Borrow a row.
|
| bool | finite () const noexcept |
| | Validate all stored scalars.
|
| double | trace () const |
| | Sum a square matrix's diagonal.
|
Owning, contiguous, row-major double matrix.
Each extent is at most max_extent. Construction checks before multiplying dimensions. Element/row access is checked, including release builds. A borrowed row pointer is valid until assignment, move, or destruction; callers must bound column accesses. Moved-from matrices are empty 0-by-0.
◆ Matrix() [1/4]
| dipla::aigenlib::Matrix::Matrix |
( |
| ) |
|
|
default |
Construct an empty matrix.
◆ Matrix() [2/4]
| dipla::aigenlib::Matrix::Matrix |
( |
std::size_t | rows, |
|
|
std::size_t | columns, |
|
|
double | value = 0.0 ) |
Allocate initialized storage.
- Parameters
-
| rows | Row count. |
| columns | Column count. |
| value | Initial scalar. |
◆ Matrix() [3/4]
| dipla::aigenlib::Matrix::Matrix |
( |
const Matrix & | other | ) |
|
|
default |
◆ Matrix() [4/4]
| dipla::aigenlib::Matrix::Matrix |
( |
Matrix && | other | ) |
|
|
noexcept |
Transfer storage.
- Parameters
-
| other | Source, emptied afterwards. |
◆ cols()
| std::size_t dipla::aigenlib::Matrix::cols |
( |
| ) |
const |
|
noexcept |
Column count.
- Returns
- Columns.
◆ finite()
| bool dipla::aigenlib::Matrix::finite |
( |
| ) |
const |
|
noexcept |
Validate all stored scalars.
- Returns
- True if finite, including empty matrices.
◆ operator()() [1/2]
| double & dipla::aigenlib::Matrix::operator() |
( |
std::size_t | row, |
|
|
std::size_t | column ) |
Checked access.
- Parameters
-
- Returns
- Mutable scalar.
◆ operator()() [2/2]
| double dipla::aigenlib::Matrix::operator() |
( |
std::size_t | row, |
|
|
std::size_t | column ) const |
Checked access.
- Parameters
-
- Returns
- Scalar.
◆ operator=() [1/2]
| Matrix & dipla::aigenlib::Matrix::operator= |
( |
const Matrix & | other | ) |
|
Deep assignment with strong exception guarantee.
- Parameters
-
- Returns
- This matrix.
◆ operator=() [2/2]
| Matrix & dipla::aigenlib::Matrix::operator= |
( |
Matrix && | other | ) |
|
|
noexcept |
Transfer storage.
- Parameters
-
| other | Source, emptied afterwards. |
- Returns
- This matrix.
◆ row_data() [1/2]
| double * dipla::aigenlib::Matrix::row_data |
( |
std::size_t | row | ) |
|
Borrow a row.
- Parameters
-
- Returns
- Pointer, null for zero columns.
◆ row_data() [2/2]
| const double * dipla::aigenlib::Matrix::row_data |
( |
std::size_t | row | ) |
const |
Borrow a row.
- Parameters
-
- Returns
- Pointer, null for zero columns.
◆ rows()
| std::size_t dipla::aigenlib::Matrix::rows |
( |
| ) |
const |
|
noexcept |
◆ size()
| std::size_t dipla::aigenlib::Matrix::size |
( |
| ) |
const |
|
noexcept |
Allocated scalar count.
- Returns
- Rows times columns.
◆ trace()
| double dipla::aigenlib::Matrix::trace |
( |
| ) |
const |
Sum a square matrix's diagonal.
- Returns
- Trace.
◆ columns_
| std::size_t dipla::aigenlib::Matrix::columns_ = 0 |
|
private |
◆ rows_
| std::size_t dipla::aigenlib::Matrix::rows_ = 0 |
|
private |
◆ values_
| Vector dipla::aigenlib::Matrix::values_ |
|
private |
Contiguous owning storage.
The documentation for this class was generated from the following files: