1#ifndef UTIL_AUTOCORRELATION_H
2#define UTIL_AUTOCORRELATION_H
12#include "AutoCorrStage.h"
13#include <util/param/ParamComposite.h>
14#include <util/containers/GArray.h>
28 template <
typename Data,
typename Product>
Hierarchical auto-correlation function algorithm.
long stageInterval() const
Return the number of primary values per block at this stage.
int bufferCapacity() const
Return capacity of history buffer.
void output(std::ostream &out)
Output the autocorrelation function, assuming zero mean.
void serialize(Archive &ar, const unsigned int version)
Serialize to/from an archive.
void clear()
Clear accumulators and destroy descendants.
void serializePrivate(Archive &ar, const unsigned int version)
Serialize private data members, and descendants.
virtual void sample(Data value)
Sample a value.
Product autoCorrelation(int t) const
Return autocorrelation at a given time, assuming zero average.
double corrTime() const
Estimate of autocorrelation time, in samples.
long nSample() const
Return the number of sampled values.
int bufferCapacity_
Physical capacity (# of elements) of buffer, corr, and nCorr.
int maxStageId_
Maximum allowed stage index (controls maximum degree of blocking).
int blockFactor_
Number of values per block (ratio of intervals for successive stages).
void allocate()
Allocate memory and initialize to empty state.
void setParam(int bufferCapacity=64, int maxStageId=0, int blockFactor=2)
Set all parameters and allocate to initialize state.
Auto-correlation function, using hierarchical algorithm.
int maxDelay() const
Return maximum delay, in primary samples.
virtual void registerDescendant(AutoCorrStage< Data, Product > *ptr)
Register a descendant stage.
virtual void readParameters(std::istream &in)
Read parameters from file and initialize.
virtual void load(Serializable::IArchive &ar)
Load internal state from an archive.
AutoCorrelation()
Constructor.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Saving archive for binary istream.
Saving / output archive for binary ostream.
An automatically growable array, analogous to a std::vector.
An object that can read multiple parameters from file.
File containing preprocessor macros for error handling.
Utility classes for scientific computation.