|
MCKL
Monte Carlo Kernel Library
|
Estimate matrix for iterative Monte Carlo algorithms. More...
#include <mckl/core/estimate_matrix.hpp>
Inherits mckl::Matrix< T, RowMajor >.
Inherited by mckl::Estimator< T, Args >.
Public Member Functions | |
| EstimateMatrix (size_type dim) | |
| void | clear () |
| Clear the estimate matrix but preserve the dimension. More... | |
| std::size_t | dim () const noexcept |
| The dimension of the estimator. More... | |
| estimate_range | estimate (size_type i) |
| Range of an estimate. More... | |
| const_estimate_range | estimate (size_type i) const |
| Range of an estimate. More... | |
| T * | insert_estimate () |
| Add space for a new estimate, return a pointer to the new row. More... | |
| template<typename InputIter > | |
| void | insert_estimate (InputIter first) |
| Add a new estimate to the bottom of the matrix. More... | |
| template<typename InputIter > | |
| void | insert_estimate (size_type i, InputIter first) |
| Add a new estimate into the matrix given iteration number. More... | |
| std::size_t | num_iter () const noexcept |
| The number of iterations stored in the estimate matrix. More... | |
| void | reserve (std::size_t n) |
| Reserve space for additional iterations. More... | |
| variable_range | variable (size_type j) |
| Range of a variable. More... | |
| const_variable_range | variable (size_type j) const |
| Range of a variable. More... | |
Public Member Functions inherited from mckl::Matrix< T, RowMajor > | |
| Matrix () noexcept(std::is_nothrow_default_constructible< Vector< T, Allocator< T > >>::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, Allocator< T > >>::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... | |
| void | push_back_col (InputIter first) |
| Insert a new coloumn at the right. More... | |
| 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... | |
Additional Inherited Members | |
Static Public Member Functions inherited from mckl::Matrix< T, RowMajor > | |
| static constexpr MatrixLayout | layout () |
| The layout of the matrix. More... | |
Estimate matrix for iterative Monte Carlo algorithms.
Let \(\eta\) be an estimator of dimension \(d\), and \(t\) be the number of iterations of the algorithms. The estimates are collected in an \(t\) by \(d\) matrix \(E\), where \(E_{i,j} = \eta_i(j)\), the \(j\)-th component of the an estimate at iteration \(i\).
Definition at line 49 of file estimate_matrix.hpp.
| using mckl::EstimateMatrix< T >::const_estimate_range = typename matrix_type::const_row_range |
Definition at line 57 of file estimate_matrix.hpp.
| using mckl::EstimateMatrix< T >::const_variable_range = typename matrix_type::const_col_range |
Definition at line 58 of file estimate_matrix.hpp.
| using mckl::EstimateMatrix< T >::estimate_range = typename matrix_type::row_range |
Definition at line 55 of file estimate_matrix.hpp.
| using mckl::EstimateMatrix< T >::matrix_type = Matrix<T, RowMajor> |
Definition at line 52 of file estimate_matrix.hpp.
| using mckl::EstimateMatrix< T >::size_type = typename matrix_type::size_type |
Definition at line 54 of file estimate_matrix.hpp.
| using mckl::EstimateMatrix< T >::value_type = typename matrix_type::value_type |
Definition at line 53 of file estimate_matrix.hpp.
| using mckl::EstimateMatrix< T >::variable_range = typename matrix_type::col_range |
Definition at line 56 of file estimate_matrix.hpp.
|
inline |
Definition at line 60 of file estimate_matrix.hpp.
|
inline |
Clear the estimate matrix but preserve the dimension.
Definition at line 69 of file estimate_matrix.hpp.
|
inlinenoexcept |
The dimension of the estimator.
Definition at line 63 of file estimate_matrix.hpp.
|
inline |
Range of an estimate.
Definition at line 78 of file estimate_matrix.hpp.
|
inline |
Range of an estimate.
Definition at line 81 of file estimate_matrix.hpp.
|
inline |
Add space for a new estimate, return a pointer to the new row.
Definition at line 96 of file estimate_matrix.hpp.
|
inline |
Add a new estimate to the bottom of the matrix.
Definition at line 106 of file estimate_matrix.hpp.
|
inline |
Add a new estimate into the matrix given iteration number.
Let \(t\) be the number of iterations currently stored within the matrix. If \(i < t\), then the estimate of \(i\)-th iteration is overriden. If \(i = t\), then it is added to the bottom of the matrix. If \(i > t\). Then the matrix will have \(i + 1\) iterations, and the values of estimates of iterations \(t\) to \(i - 1\) will be initialized as -const_nan<T>() if T is a floating point type.
Definition at line 122 of file estimate_matrix.hpp.
|
inlinenoexcept |
The number of iterations stored in the estimate matrix.
Definition at line 66 of file estimate_matrix.hpp.
|
inline |
Reserve space for additional iterations.
Definition at line 72 of file estimate_matrix.hpp.
|
inline |
Range of a variable.
Definition at line 87 of file estimate_matrix.hpp.
|
inline |
Range of a variable.
Definition at line 90 of file estimate_matrix.hpp.
1.8.13