Class expval_matrix (o2scl)¶
-
class
o2scl
::
expval_matrix
: public o2scl::expval_base¶ Matrix expectation value.
See expval_base for some general notes on this and related classes.
This is a similar to expval_scalar, except that it allows updating and statistics for a set of matrices en masse. The data is stored internally in ublas matrix and tensor3 objects, but the public member functions operate with template types which are compatible with any vector class which provides
double &operator[]
. It is assumed that each call to add() contains a new measurement for all of the matrix entries.Report statistics
-
template<class
mat_t
, classmat2_t
, classmat3_t
>
voidcurrent_avg_stats
(mat_t &avg, mat2_t &std_dev, mat3_t &avg_err, size_t &m_block, size_t &m_per_block)¶ Report current average, standard deviation, and the error in the average and include block information.
- Idea for Future:
This should be made const.
- Idea for Future:
Avoid the copy associated with vector_slice().
-
template<class
mat_t
, classmat2_t
, classmat3_t
>
voidcurrent_avg
(mat_t &avg, mat2_t &std_dev, mat3_t &avg_err)¶ Report current average, standard deviation, and the error in the average.
- Idea for Future:
This should be made const.
-
template<class
mat_t
, classmat2_t
, classmat3_t
>
voidreblock_avg_stats
(size_t new_blocks, mat_t &avg, mat2_t &std_dev, mat3_t &avg_err, size_t &m_per_block) const¶ Report average, standard deviation, and the error in the average assuming a new block size.
-
template<class
mat_t
, classmat2_t
, classmat3_t
>
voidreblock_avg
(size_t new_blocks, mat_t &avg, mat2_t &std_dev, mat3_t &avg_err) const¶ Report average, standard deviation, and the error in the average assuming a new block size.
-
friend void
hdf_output
(o2scl_hdf::hdf_file &hf, expval_matrix &t, std::string name)¶
-
friend void
hdf_input
(o2scl_hdf::hdf_file &hf, expval_matrix &t, std::string name)¶
Public Types
-
typedef boost::numeric::ublas::vector<double>
ubvector
¶
-
typedef boost::numeric::ublas::matrix<double>
ubmatrix
¶
-
typedef boost::numeric::ublas::slice
slice
¶
Public Functions
-
expval_matrix
()¶
-
expval_matrix
(size_t rows, size_t cols, size_t n_blocks = 1, size_t n_per_block = 1)¶ Create for a vector of size
n
withn_blocks
blocks andn_per_block
points block.
-
~expval_matrix
()¶
-
expval_matrix
(const expval_matrix &ev)¶ Copy constructor.
-
expval_matrix &
operator=
(const expval_matrix &ev)¶ Copy constructor.
-
void
set_blocks_mat
(size_t rows, size_t cols, size_t n_blocks, size_t n_per_block)¶ Set for a matrix with
n_blocks
blocks andn_per_block
points block.
-
void
free
()¶ Free allocated data (but do not change the current values of
n_blocks
orn_per_block
)
Protected Attributes
-
size_t
nr
¶ The number of rows (zero for an empty expval_matrix object)
-
size_t
nc
¶ The number of columns (zero for an empty expval_matrix object)
-
template<class