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

A set expectation values for histogram bins. More...

#include <hist_ev.h>

Inheritance diagram for hist_ev:
expect_val

Detailed Description

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.

Note:
This class always assumes that n_per_block is zero. See expect_val for more details.
Todo:
Test set_grid_blocks() function.
Todo:
Create copy constructors as in the scalar_ev class.

Definition at line 58 of file hist_ev.h.

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.

Member Function Documentation

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.


Field Documentation

hist hist_ev::h [protected]

This object is only currently used internally for binning. No data is added to it.

Definition at line 84 of file hist_ev.h.


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.