Owning, contiguous, row-major double matrix. More...
#include <aigenlib.hpp>

Public Member Functions | |
| 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. | |
Private Attributes | |
| std::size_t | rows_ = 0 |
| std::size_t | columns_ = 0 |
| Vector | values_ |
Detailed Description
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.
Definition at line 95 of file aigenlib.hpp.
Constructor & Destructor Documentation
◆ Matrix() [1/4]
|
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.
Definition at line 221 of file aigenlib.cpp.
◆ Matrix() [3/4]
|
default |
Deep copy.
- Parameters
-
other Source.
◆ Matrix() [4/4]
|
noexcept |
Transfer storage.
- Parameters
-
other Source, emptied afterwards.
Definition at line 230 of file aigenlib.cpp.
Member Function Documentation
◆ cols()
|
noexcept |
◆ finite()
|
noexcept |
Validate all stored scalars.
- Returns
- True if finite, including empty matrices.
Definition at line 259 of file aigenlib.cpp.
◆ operator()() [1/2]
| double & dipla::aigenlib::Matrix::operator() | ( | std::size_t | row, |
| std::size_t | column ) |
Checked access.
- Parameters
-
row Row. column Column.
- Returns
- Mutable scalar.
Definition at line 243 of file aigenlib.cpp.
◆ operator()() [2/2]
| double dipla::aigenlib::Matrix::operator() | ( | std::size_t | row, |
| std::size_t | column ) const |
Checked access.
- Parameters
-
row Row. column Column.
- Returns
- Scalar.
Definition at line 247 of file aigenlib.cpp.
◆ operator=() [1/2]
Deep assignment with strong exception guarantee.
- Parameters
-
other Source.
- Returns
- This matrix.
Definition at line 223 of file aigenlib.cpp.
◆ operator=() [2/2]
Transfer storage.
- Parameters
-
other Source, emptied afterwards.
- Returns
- This matrix.
Definition at line 232 of file aigenlib.cpp.
◆ row_data() [1/2]
| double * dipla::aigenlib::Matrix::row_data | ( | std::size_t | row | ) |
Borrow a row.
- Parameters
-
row Row.
- Returns
- Pointer, null for zero columns.
Definition at line 251 of file aigenlib.cpp.
◆ row_data() [2/2]
| const double * dipla::aigenlib::Matrix::row_data | ( | std::size_t | row | ) | const |
Borrow a row.
- Parameters
-
row Row.
- Returns
- Pointer, null for zero columns.
Definition at line 255 of file aigenlib.cpp.
◆ rows()
|
noexcept |
◆ size()
|
noexcept |
◆ trace()
| double dipla::aigenlib::Matrix::trace | ( | ) | const |
Field Documentation
◆ columns_
|
private |
Column extent.
Definition at line 130 of file aigenlib.hpp.
◆ rows_
|
private |
Row extent.
Definition at line 129 of file aigenlib.hpp.
◆ values_
|
private |
Contiguous owning storage.
Definition at line 131 of file aigenlib.hpp.
The documentation for this class was generated from the following files:
- modules/dipla_cam/aigenlib/aigenlib.hpp
- modules/dipla_cam/aigenlib/aigenlib.cpp