![]() |
Object-oriented Scientific Computing Library: Version 0.910
|
A set expectation values for histogram bins. More...
#include <hist_ev.h>
See expect_val for some general notes on this and related classes.
This class is experimental.
This class computes expectation values of bins in a histogram. It is most useful in cases where one does not know a priori how many measurements one is going to get for each bin. The class automatically arranges each bin into blocks, so that the standard deviation and error and the average can be computed even when not all bins have been filled with the same number of measurements.
n_per_block
is zero. See expect_val for more details.Public Member Functions | |
hist_ev (uniform_grid< double > g, size_t n_blocks) | |
Create a histogram expectation value. | |
void | reset () |
Remove all currently stored data, but keep same block size. | |
void | set_grid_blocks (uniform_grid< double > g, size_t n_blocks) |
Set the histogram grid and the number of blocks. | |
virtual void | add (double x, double val) |
Add measurement of value val at location x . | |
virtual void | current_avg_stats (uvector &reps, uvector &avg, uvector &std_dev, uvector &avg_err, uvector_int &m_block, uvector_int &m_per_block) |
Report current average, standard deviation, and the error in the average. | |
virtual void | current_avg (uvector &reps, uvector &avg, uvector &std_dev, uvector &avg_err) |
Report current average, standard deviation, and the error in the average. | |
Protected Attributes | |
umatrix | last |
Last measurement for each block and each bin. | |
umatrix | vals |
Running average for each block and each bin. | |
uvector_int | iblock_bins |
The value of iblock for each bin. | |
uvector_int | i_bins |
The value of i for each bin. | |
size_t | hsize |
This should always be the same as the size as the histogram. | |
hist | h |
The associated histogram. |
virtual void hist_ev::current_avg_stats | ( | uvector & | reps, |
uvector & | avg, | ||
uvector & | std_dev, | ||
uvector & | avg_err, | ||
uvector_int & | m_block, | ||
uvector_int & | m_per_block | ||
) | [virtual] |
This function deallocates any space already allocated for the vector parameters and reallocates space as needed. Information previously stored in these vectors will be lost.
virtual void hist_ev::current_avg | ( | uvector & | reps, |
uvector & | avg, | ||
uvector & | std_dev, | ||
uvector & | avg_err | ||
) | [virtual] |
This function deallocates any space already allocated for the vector parameters and reallocates space as needed. Information previously stored in these vectors will be lost.
hist hist_ev::h [protected] |
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).