Class expval_scalar (o2scl)¶
-
class
o2scl
::
expval_scalar
: public o2scl::expval_base¶ Scalar expectation value.
See expval_base for some general notes on this and related classes.
This represents the expectation value of a scalar double-precision quantity over several measurements.
Report statistics
-
void
current_avg_stats
(double &avg, double &std_dev, double &avg_err, size_t &m_block, size_t &m_per_block) const¶ Report current average, standard deviation, and the error in the average and include block information.
-
void
current_avg
(double &avg, double &std_dev, double &avg_err) const¶ Report current average, standard deviation, and the error in the average.
-
void
reblock_avg_stats
(size_t new_blocks, double &avg, double &std_dev, double &avg_err, size_t &m_per_block) const¶ Report average, standard deviation, and the error in the average assuming a new block size.
- Idea for Future:
Use recurrence relation for averages here rather than dividing at the end.
-
void
reblock_avg
(size_t new_blocks, double &avg, double &std_dev, double &avg_err) const¶ Report average, standard deviation, and the error in the average assuming a new block size.
Direct manipulation of the stored data
-
const double &
operator[]
(size_t i_block) const¶ Return the current data for block with index
i_block
.
-
double &
operator[]
(size_t i_block)¶ Return the current data for block with index
i_block
.
-
void
is_valid
() const¶ Internal consistency check.
-
friend void
hdf_output
(o2scl_hdf::hdf_file &hf, expval_scalar &t, std::string name)¶
-
friend void
hdf_input
(o2scl_hdf::hdf_file &hf, expval_scalar &t, std::string name)¶
Public Types
-
typedef boost::numeric::ublas::vector<double>
ubvector
¶
Public Functions
-
expval_scalar
(size_t n_blocks = 1, size_t n_per_block = 1)¶ Create with
n_blocks
blocks andn_per_block
points block.
-
~expval_scalar
()¶
-
expval_scalar
(const expval_scalar &ev)¶ Copy constructor.
-
expval_scalar &
operator=
(const expval_scalar &ev)¶ Copy constructor.
-
void
set_blocks
(size_t n_blocks, size_t n_per_block)¶ Reset for
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
)
-
void
add
(double val)¶ Add measurement of value
val
.
Public Members
-
double
current
¶ The current rolling average.
-
void