Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Protected Attributes
vector_ev Class Reference

Vector expectation value. More...

#include <expect_val.h>

Inheritance diagram for vector_ev:
expect_val

Detailed Description

See expect_val for some general notes on this and related classes.

This class is experimental.

This is a similar to scalar_ev, except that it allows updating and statistics for a set of scalars en masse. The data is stored internally in uvector and umatrix objects, but the public member functions operate with template types which are compatible with any vector class which provides double &operator[].

Internally, data is stored in matrices designating the first (row) index as the user-specified vector index and designating the second (column) index as the block index.

Definition at line 325 of file expect_val.h.

Public Member Functions

 vector_ev (size_t n)
 Create for a vector of size n with no blocking.
 vector_ev (size_t n, size_t n_blocks, size_t n_per_block)
 Create for a vector of size n with n_blocks blocks and n_per_block points block.
virtual void set_blocks (size_t n, size_t n_blocks, size_t n_per_block)
 Set for a vector of size n with n_blocks blocks and n_per_block points block.
 vector_ev (const vector_ev &ev)
 Copy constructor.
vector_evoperator= (const vector_ev &ev)
 Copy constructor.
virtual void free ()
 Free allocated data.
virtual void reset ()
 Clear all the data.
template<class vec_t >
void add (vec_t &v)
 Add measurement of value val.
Report statistics
template<class vec_t , class vec2_t , class vec3_t >
void current_avg_stats (vec_t &avg, vec2_t &std_dev, vec3_t &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.
template<class vec_t , class vec2_t , class vec3_t >
void current_avg (vec_t &avg, vec2_t &std_dev, vec3_t &avg_err) const
 Report current average, standard deviation, and the error in the average.
template<class vec_t , class vec2_t , class vec3_t >
void reblock_avg_stats (size_t new_blocks, vec_t &avg, vec2_t &std_dev, vec3_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 vec_t , class vec2_t , class vec3_t >
void reblock_avg (size_t new_blocks, vec_t &avg, vec2_t &std_dev, vec3_t &avg_err) const
 Report average, standard deviation, and the error in the average assuming a new block size.

Protected Attributes

umatrix last
 The most recent values for each block.
umatrix vals
 The average for each block.
uvector current
 The current rolling average.
size_t nvec
 The size of the vector.

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.