|
MCKL
Monte Carlo Kernel Library
|
#include <mckl/core/matrix.hpp>
Public Member Functions | |
| Matrix () noexcept(std::is_nothrow_default_constructible< Vector< T, Alloc >>::value) | |
| Construct an empty matrix. More... | |
| Matrix (size_type nrow, size_type ncol) | |
Construct an nrow by ncol matrix. More... | |
| Matrix (const Matrix &)=default | |
| Copy constructor. More... | |
| Matrix (Matrix &&other) noexcept(std::is_nothrow_move_constructible< Vector< T, Alloc >>::value) | |
| Move constructor. More... | |
| reference | at (size_type i, size_type j) |
| Access an element in the matrix with bound checking. More... | |
| const_reference | at (size_type i, size_type j) const |
| Access an element in the matrix with bound checking. More... | |
| iterator | begin () |
| Iterator to the upper left corner of the matrix. More... | |
| const_iterator | begin () const |
| Iterator to the upper left corner of the matrix. More... | |
| const_iterator | cbegin () const |
| Iterator to the upper left corner of the matrix. More... | |
| const_col_range | ccol (size_type i) const |
| Range of a column. More... | |
| const_iterator | cend () const |
| Iterator to one pass the lower right corner of the matrix. More... | |
| void | clear () |
| Clear the matrix of all elements. More... | |
| col_range | col (size_type i) |
| Range of a column. More... | |
| const_col_range | col (size_type i) const |
| Range of a column. More... | |
| col_iterator | col_begin (size_type i) |
| Iterator to the beginning of a column. More... | |
| const_col_iterator | col_begin (size_type j) const |
| Iterator to the beginning of a column. More... | |
| const_col_iterator | col_cbegin (size_type j) const |
| Iterator to the beginning of a column. More... | |
| const_col_iterator | col_cend (size_type j) const |
| Iterator to one pass the end of a column. More... | |
| const_reverse_col_iterator | col_crbegin (size_type j) const |
| Iterator to the end of a column. More... | |
| const_reverse_col_iterator | col_crend (size_type j) const |
| Iterator to one before the beginning of a column. More... | |
| pointer | col_data (size_type j) |
| Pointer to the beginning of a column. More... | |
| const_pointer | col_data (size_type j) const |
| Pointer to the beginning of a column. More... | |
| col_iterator | col_end (size_type j) |
| Iterator to one pass the end of a column. More... | |
| const_col_iterator | col_end (size_type j) const |
| Iterator to one pass the end of a column. More... | |
| reverse_col_iterator | col_rbegin (size_type j) |
| Iterator to the end of a column. More... | |
| const_reverse_col_iterator | col_rbegin (size_type j) const |
| Iterator to the end of a column. More... | |
| reverse_col_iterator | col_rend (size_type j) |
| Iterator to one before the beginning of a column. More... | |
| const_reverse_col_iterator | col_rend (size_type j) const |
| Iterator to one before the beginning of a column. More... | |
| size_type | col_stride () const |
The stride size of column-wise access through col_data() More... | |
| const_reverse_iterator | crbegin () const |
| Iterator to the lower right corner of the matrix. More... | |
| const_reverse_col_range | crcol (size_type i) const |
| Range of a column in reverse order. More... | |
| const_reverse_iterator | crend () const |
| Iterator one before the upper left corner of the matrix. More... | |
| const_row_range | crow (size_type i) const |
| Range of a row. More... | |
| const_reverse_row_range | crrow (size_type i) const |
| Range of a row in reverse order. More... | |
| pointer | data () |
| Pointer to the upper left corner of the matrix. More... | |
| const_pointer | data () const |
| Pointer to the upper left corner of the matrix. More... | |
| bool | empty () const |
If the matrix is empty, i.e., nrow() * ncol() == 0 More... | |
| iterator | end () |
| Iterator to one pass the lower right corner of the matrix. More... | |
| const_iterator | end () const |
| Iterator to one pass the lower right corner of the matrix. More... | |
| allocator_type | get_allocator () const |
| Return the associated allocator. More... | |
| size_type | ldim () const |
| The number of elements in the leading dimension. More... | |
| size_type | ncol () const |
| The number of columns. More... | |
| size_type | nrow () const |
| The number of rows. More... | |
| operator transpose_type () const | |
| Convert to a matrix with a different storage layout. More... | |
| reference | operator() (size_type i, size_type j) |
| Access an element in the matrix. More... | |
| const_reference | operator() (size_type i, size_type j) const |
| Access an element in the matrix. More... | |
| Matrix & | operator= (const Matrix &)=default |
| Copy assignment operator. More... | |
| Matrix & | operator= (Matrix &&other) noexcept(noexcept(data_.swap(other.data_))) |
| Move assignment operator. More... | |
| template<typename InputIter > | |
| void | push_back_col (InputIter first) |
| Insert a new coloumn at the right. More... | |
| template<typename InputIter > | |
| void | push_back_row (InputIter first) |
| Insert a new row at the bottom. More... | |
| reverse_iterator | rbegin () |
| Iterator to the lower right corner of the matrix. More... | |
| const_reverse_iterator | rbegin () const |
| Iterator to the lower right corner of the matrix. More... | |
| reverse_col_range | rcol (size_type i) |
| Range of a column in reverse order. More... | |
| const_reverse_col_range | rcol (size_type i) const |
| Range of a column in reverse order. More... | |
| reverse_iterator | rend () |
| Iterator one before the upper left corner of the matrix. More... | |
| const_reverse_iterator | rend () const |
| Iterator one before the upper left corner of the matrix. More... | |
| void | reserve (size_type n, size_type m) |
| Reserve storage space for the matrix. More... | |
| void | resize (size_type nrow, size_type ncol) |
| Resize the matrix. More... | |
| row_range | row (size_type i) |
| Range of a row. More... | |
| const_row_range | row (size_type i) const |
| Range of a row. More... | |
| row_iterator | row_begin (size_type i) |
| Iterator to the beginning of a row. More... | |
| const_row_iterator | row_begin (size_type i) const |
| Iterator to the beginning of a row. More... | |
| const_row_iterator | row_cbegin (size_type i) const |
| Iterator to the beginning of a row. More... | |
| const_row_iterator | row_cend (size_type i) const |
| Iterator to one pass the end of a row. More... | |
| const_reverse_row_iterator | row_crbegin (size_type i) const |
| Iterator to the end of a row. More... | |
| const_reverse_row_iterator | row_crend (size_type i) const |
| Iterator to one before the beginning of a row. More... | |
| pointer | row_data (size_type i) |
| Pointer to the first element of a row. More... | |
| const_pointer | row_data (size_type i) const |
| Pointer to the first element of a row. More... | |
| row_iterator | row_end (size_type i) |
| Iterator to one pass the end of a row. More... | |
| const_row_iterator | row_end (size_type i) const |
| Iterator to one pass the end of a row. More... | |
| reverse_row_iterator | row_rbegin (size_type i) |
| Iterator to the end of a row. More... | |
| const_reverse_row_iterator | row_rbegin (size_type i) const |
| Iterator to the end of a row. More... | |
| reverse_row_iterator | row_rend (size_type i) |
| Iterator to one before the beginning of a row. More... | |
| const_reverse_row_iterator | row_rend (size_type i) const |
| Iterator to one before the beginning of a row. More... | |
| size_type | row_stride () const |
The stride of row-wise access through row_data() More... | |
| reverse_row_range | rrow (size_type i) |
| Range of a row in reverse order. More... | |
| const_reverse_row_range | rrow (size_type i) const |
| Range of a row in reverse order. More... | |
| void | shrink_to_fit () |
| Release memory no longer needed. More... | |
| size_type | size () const |
| The total number of elements. More... | |
| void | swap (Matrix &other) noexcept(noexcept(data_.swap(other.data_))) |
| Swap two matrices. More... | |
Static Public Member Functions | |
| static constexpr MatrixLayout | layout () |
| The layout of the matrix. More... | |
Friends | |
| bool | is_equal (const Matrix &m1, const Matrix &m2) |
| Compare equality. More... | |
| bool | operator!= (const Matrix &m1, const Matrix &m2) |
| Compare inequality. More... | |
| bool | operator== (const Matrix &m1, const Matrix &m2) |
| Compare equality. More... | |
| void | swap (Matrix &m1, Matrix &m2) noexcept(noexcept(m1.swap(m2))) |
| Swap two matrices. More... | |
Matrix container.
| T | The value type |
| Layout | The storage layout, either RowMajor or ColMajor |
| Alloc | The allocator type |
Definition at line 49 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::allocator_type = Alloc |
Definition at line 59 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::col_iterator = std::conditional_t<Layout == ColMajor, pointer, StepIterator<pointer> > |
Definition at line 81 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::col_range = Range<col_iterator> |
Definition at line 93 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_col_iterator = std::conditional_t<Layout == ColMajor, const_pointer, StepIterator<const_pointer> > |
Definition at line 83 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_col_range = Range<const_col_iterator> |
Definition at line 94 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_iterator = const_pointer |
Definition at line 68 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_pointer = const value_type * |
Definition at line 65 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_reference = const value_type & |
Definition at line 63 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_reverse_col_iterator = std::reverse_iterator<const_col_iterator> |
Definition at line 86 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_reverse_col_range = Range<const_reverse_col_iterator> |
Definition at line 96 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 70 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_reverse_row_iterator = std::reverse_iterator<const_row_iterator> |
Definition at line 78 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_reverse_row_range = Range<const_reverse_row_iterator> |
Definition at line 91 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_row_iterator = std::conditional_t<Layout == RowMajor, const_pointer, StepIterator<const_pointer> > |
Definition at line 75 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::const_row_range = Range<const_row_iterator> |
Definition at line 89 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::difference_type = std::ptrdiff_t |
Definition at line 61 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::iterator = pointer |
Definition at line 67 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::pointer = value_type * |
Definition at line 64 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::reference = value_type & |
Definition at line 62 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::reverse_col_iterator = std::reverse_iterator<col_iterator> |
Definition at line 84 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::reverse_col_range = Range<reverse_col_iterator> |
Definition at line 95 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 69 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::reverse_row_iterator = std::reverse_iterator<row_iterator> |
Definition at line 76 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::reverse_row_range = Range<reverse_row_iterator> |
Definition at line 90 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::row_iterator = std::conditional_t<Layout == RowMajor, pointer, StepIterator<pointer> > |
Definition at line 73 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::row_range = Range<row_iterator> |
Definition at line 88 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::size_type = std::size_t |
Definition at line 60 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::transpose_type = Matrix<T, Layout == RowMajor ? ColMajor : RowMajor, Alloc> |
Definition at line 99 of file matrix.hpp.
| using mckl::Matrix< T, Layout, Alloc >::value_type = T |
Definition at line 58 of file matrix.hpp.
|
inlinenoexcept |
Construct an empty matrix.
Definition at line 102 of file matrix.hpp.
|
inline |
Construct an nrow by ncol matrix.
Definition at line 109 of file matrix.hpp.
|
default |
Copy constructor.
|
inlinenoexcept |
Move constructor.
Definition at line 118 of file matrix.hpp.
|
inline |
Access an element in the matrix with bound checking.
Definition at line 403 of file matrix.hpp.
|
inline |
Access an element in the matrix with bound checking.
Definition at line 414 of file matrix.hpp.
|
inline |
Iterator to the upper left corner of the matrix.
Definition at line 169 of file matrix.hpp.
|
inline |
Iterator to the upper left corner of the matrix.
Definition at line 172 of file matrix.hpp.
|
inline |
Iterator to the upper left corner of the matrix.
Definition at line 175 of file matrix.hpp.
|
inline |
Range of a column.
Definition at line 379 of file matrix.hpp.
|
inline |
Iterator to one pass the lower right corner of the matrix.
Definition at line 184 of file matrix.hpp.
|
inline |
Clear the matrix of all elements.
Definition at line 526 of file matrix.hpp.
|
inline |
Range of a column.
Definition at line 370 of file matrix.hpp.
|
inline |
Range of a column.
Definition at line 373 of file matrix.hpp.
|
inline |
Iterator to the beginning of a column.
Definition at line 274 of file matrix.hpp.
|
inline |
Iterator to the beginning of a column.
Definition at line 280 of file matrix.hpp.
|
inline |
Iterator to the beginning of a column.
Definition at line 283 of file matrix.hpp.
|
inline |
Iterator to one pass the end of a column.
Definition at line 295 of file matrix.hpp.
|
inline |
Iterator to the end of a column.
Definition at line 313 of file matrix.hpp.
|
inline |
Iterator to one before the beginning of a column.
Definition at line 331 of file matrix.hpp.
|
inline |
Pointer to the beginning of a column.
Definition at line 461 of file matrix.hpp.
|
inline |
Pointer to the beginning of a column.
Definition at line 467 of file matrix.hpp.
|
inline |
Iterator to one pass the end of a column.
Definition at line 289 of file matrix.hpp.
|
inline |
Iterator to one pass the end of a column.
Definition at line 292 of file matrix.hpp.
|
inline |
Iterator to the end of a column.
Definition at line 301 of file matrix.hpp.
|
inline |
Iterator to the end of a column.
Definition at line 307 of file matrix.hpp.
|
inline |
Iterator to one before the beginning of a column.
Definition at line 319 of file matrix.hpp.
|
inline |
Iterator to one before the beginning of a column.
Definition at line 325 of file matrix.hpp.
|
inline |
The stride size of column-wise access through col_data()
Definition at line 473 of file matrix.hpp.
|
inline |
Iterator to the lower right corner of the matrix.
Definition at line 193 of file matrix.hpp.
|
inline |
Range of a column in reverse order.
Definition at line 397 of file matrix.hpp.
|
inline |
Iterator one before the upper left corner of the matrix.
Definition at line 205 of file matrix.hpp.
|
inline |
Range of a row.
Definition at line 346 of file matrix.hpp.
|
inline |
Range of a row in reverse order.
Definition at line 364 of file matrix.hpp.
|
inline |
Pointer to the upper left corner of the matrix.
Definition at line 437 of file matrix.hpp.
|
inline |
Pointer to the upper left corner of the matrix.
Definition at line 440 of file matrix.hpp.
|
inline |
If the matrix is empty, i.e., nrow() * ncol() == 0
Definition at line 482 of file matrix.hpp.
|
inline |
Iterator to one pass the lower right corner of the matrix.
Definition at line 178 of file matrix.hpp.
|
inline |
Iterator to one pass the lower right corner of the matrix.
Definition at line 181 of file matrix.hpp.
|
inline |
Return the associated allocator.
Definition at line 166 of file matrix.hpp.
|
inlinestatic |
The layout of the matrix.
Definition at line 479 of file matrix.hpp.
|
inline |
The number of elements in the leading dimension.
Definition at line 491 of file matrix.hpp.
|
inline |
The number of columns.
Definition at line 488 of file matrix.hpp.
|
inline |
The number of rows.
Definition at line 485 of file matrix.hpp.
|
inlineexplicit |
Convert to a matrix with a different storage layout.
Definition at line 143 of file matrix.hpp.
|
inline |
Access an element in the matrix.
Definition at line 425 of file matrix.hpp.
|
inline |
Access an element in the matrix.
Definition at line 431 of file matrix.hpp.
|
default |
Copy assignment operator.
|
inlinenoexcept |
Move assignment operator.
Definition at line 130 of file matrix.hpp.
|
inline |
Insert a new coloumn at the right.
Definition at line 543 of file matrix.hpp.
|
inline |
Insert a new row at the bottom.
Definition at line 535 of file matrix.hpp.
|
inline |
Iterator to the lower right corner of the matrix.
Definition at line 187 of file matrix.hpp.
|
inline |
Iterator to the lower right corner of the matrix.
Definition at line 190 of file matrix.hpp.
|
inline |
Range of a column in reverse order.
Definition at line 385 of file matrix.hpp.
|
inline |
Range of a column in reverse order.
Definition at line 391 of file matrix.hpp.
|
inline |
Iterator one before the upper left corner of the matrix.
Definition at line 199 of file matrix.hpp.
|
inline |
Iterator one before the upper left corner of the matrix.
Definition at line 202 of file matrix.hpp.
|
inline |
Reserve storage space for the matrix.
Definition at line 497 of file matrix.hpp.
|
inline |
Resize the matrix.
Let the orignal be a \(p\) by \(q\) matrix and the new matrix be of dimensions \(s\) by \(t\). Then the sub-matrix at the upper left corner, of dimensions \(n = \min\{p,s\}\) by \(m = \min\{q,t\}\) has its original values.
Definition at line 506 of file matrix.hpp.
|
inline |
Range of a row.
Definition at line 337 of file matrix.hpp.
|
inline |
Range of a row.
Definition at line 340 of file matrix.hpp.
|
inline |
Iterator to the beginning of a row.
Definition at line 211 of file matrix.hpp.
|
inline |
Iterator to the beginning of a row.
Definition at line 217 of file matrix.hpp.
|
inline |
Iterator to the beginning of a row.
Definition at line 220 of file matrix.hpp.
|
inline |
Iterator to one pass the end of a row.
Definition at line 232 of file matrix.hpp.
|
inline |
Iterator to the end of a row.
Definition at line 250 of file matrix.hpp.
|
inline |
Iterator to one before the beginning of a row.
Definition at line 268 of file matrix.hpp.
|
inline |
Pointer to the first element of a row.
Definition at line 443 of file matrix.hpp.
|
inline |
Pointer to the first element of a row.
Definition at line 449 of file matrix.hpp.
|
inline |
Iterator to one pass the end of a row.
Definition at line 226 of file matrix.hpp.
|
inline |
Iterator to one pass the end of a row.
Definition at line 229 of file matrix.hpp.
|
inline |
Iterator to the end of a row.
Definition at line 238 of file matrix.hpp.
|
inline |
Iterator to the end of a row.
Definition at line 244 of file matrix.hpp.
|
inline |
Iterator to one before the beginning of a row.
Definition at line 256 of file matrix.hpp.
|
inline |
Iterator to one before the beginning of a row.
Definition at line 262 of file matrix.hpp.
|
inline |
The stride of row-wise access through row_data()
Definition at line 455 of file matrix.hpp.
|
inline |
Range of a row in reverse order.
Definition at line 352 of file matrix.hpp.
|
inline |
Range of a row in reverse order.
Definition at line 358 of file matrix.hpp.
|
inline |
Release memory no longer needed.
Definition at line 523 of file matrix.hpp.
|
inline |
The total number of elements.
Definition at line 494 of file matrix.hpp.
|
inlinenoexcept |
Swap two matrices.
Definition at line 550 of file matrix.hpp.
|
friend |
Compare equality.
Definition at line 582 of file matrix.hpp.
|
friend |
Compare inequality.
Definition at line 576 of file matrix.hpp.
|
friend |
Compare equality.
Definition at line 564 of file matrix.hpp.
|
friend |
Swap two matrices.
Definition at line 558 of file matrix.hpp.
1.8.13