ALPSCore reference
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
alps::alea::var_acc< T, Strategy > Class Template Reference

#include <variance.hpp>

Collaboration diagram for alps::alea::var_acc< T, Strategy >:
Collaboration graph

Public Types

using value_type = T
 
using var_type = typename bind< Strategy, T >::var_type
 

Public Member Functions

 var_acc (size_t size=1, size_t batch_size=1)
 
 var_acc (const var_acc &other)
 
var_accoperator= (const var_acc &other)
 
void reset ()
 
void set_size (size_t size)
 
void set_batch_size (size_t batch_size)
 
bool valid () const
 
size_t size () const
 
size_t batch_size () const
 
var_accoperator<< (const computed< T > &src)
 
var_accoperator<< (const var_result< T, Strategy > &result)
 
size_t count () const
 
var_result< T, Strategy > result () const
 
var_result< T, Strategy > finalize ()
 
const bundle< value_type > & current () const
 
const var_data< T, Strategy > & store () const
 

Protected Member Functions

void add (const computed< T > &source, size_t count, var_acc *cascade)
 
void add_bundle (var_acc *cascade)
 
void finalize_to (var_result< T, Strategy > &result, var_acc *cascade)
 

Friends

class autocorr_acc< T >
 
class batch_result< T >
 

Detailed Description

template<typename T, typename Strategy = circular_var>
class alps::alea::var_acc< T, Strategy >

Accumulator which tracks the mean and a naive variance estimate.

Definition at line 21 of file variance.hpp.

Member Typedef Documentation

template<typename T, typename Strategy = circular_var>
using alps::alea::var_acc< T, Strategy >::value_type = T

Definition at line 122 of file variance.hpp.

template<typename T, typename Strategy = circular_var>
using alps::alea::var_acc< T, Strategy >::var_type = typename bind<Strategy, T>::var_type

Definition at line 123 of file variance.hpp.

Constructor & Destructor Documentation

template<typename T , typename Str >
alps::alea::var_acc< T, Str >::var_acc ( size_t  size = 1,
size_t  batch_size = 1 
)

Definition at line 77 of file variance.cpp.

template<typename T , typename Str >
alps::alea::var_acc< T, Str >::var_acc ( const var_acc< T, Strategy > &  other)

Definition at line 84 of file variance.cpp.

Member Function Documentation

template<typename T, typename Strategy = circular_var>
void alps::alea::var_acc< T, Str >::add ( const computed< T > &  source,
size_t  count,
var_acc< T, Strategy > *  cascade 
)
protected

Definition at line 124 of file variance.cpp.

template<typename T, typename Strategy = circular_var>
void alps::alea::var_acc< T, Str >::add_bundle ( var_acc< T, Strategy > *  cascade)
protected

Definition at line 190 of file variance.cpp.

template<typename T, typename Strategy = circular_var>
size_t alps::alea::var_acc< T, Strategy >::batch_size ( ) const
inline

Returns number of data points per batch

Definition at line 148 of file variance.hpp.

template<typename T, typename Strategy = circular_var>
size_t alps::alea::var_acc< T, Strategy >::count ( ) const
inline

Returns sample size, i.e., number of accumulated data points

Definition at line 157 of file variance.hpp.

template<typename T, typename Strategy = circular_var>
const bundle<value_type>& alps::alea::var_acc< T, Strategy >::current ( ) const
inline

Definition at line 165 of file variance.hpp.

template<typename T , typename Str >
var_result< T, Str > alps::alea::var_acc< T, Str >::finalize ( )

Frees data associated with accumulator and return result

Definition at line 164 of file variance.cpp.

template<typename T, typename Strategy = circular_var>
void alps::alea::var_acc< T, Str >::finalize_to ( var_result< T, Strategy > &  result,
var_acc< T, Strategy > *  cascade 
)
protected

Definition at line 172 of file variance.cpp.

template<typename T, typename Strategy = circular_var>
var_acc& alps::alea::var_acc< T, Strategy >::operator<< ( const computed< T > &  src)
inline

Add computed vector to the accumulator

Definition at line 151 of file variance.hpp.

template<typename T, typename Strategy = circular_var>
var_acc& alps::alea::var_acc< T, Strategy >::operator<< ( const var_result< T, Strategy > &  result)

Merge partial result into accumulator

template<typename T , typename Str >
var_acc< T, Str > & alps::alea::var_acc< T, Str >::operator= ( const var_acc< T, Strategy > &  other)

Definition at line 90 of file variance.cpp.

template<typename T , typename Str >
void alps::alea::var_acc< T, Str >::reset ( )

Re-allocate and thus clear all accumulated data

Definition at line 98 of file variance.cpp.

template<typename T , typename Str >
var_result< T, Str > alps::alea::var_acc< T, Str >::result ( ) const

Returns result corresponding to current state of accumulator

Definition at line 155 of file variance.cpp.

template<typename T , typename Str >
void alps::alea::var_acc< T, Str >::set_batch_size ( size_t  batch_size)

Update the batch size and discard current batch

Definition at line 116 of file variance.cpp.

template<typename T , typename Str >
void alps::alea::var_acc< T, Str >::set_size ( size_t  size)

Update the size and discard all measurements, if any

Definition at line 108 of file variance.cpp.

template<typename T, typename Strategy = circular_var>
size_t alps::alea::var_acc< T, Strategy >::size ( ) const
inline

Number of components of the random vector (e.g., size of mean)

Definition at line 145 of file variance.hpp.

template<typename T, typename Strategy = circular_var>
const var_data<T,Strategy>& alps::alea::var_acc< T, Strategy >::store ( ) const
inline

Return backend object used for storing estimands

Definition at line 168 of file variance.hpp.

template<typename T, typename Strategy = circular_var>
bool alps::alea::var_acc< T, Strategy >::valid ( ) const
inline

Returns false if finalize() has been called, true otherwise

Definition at line 142 of file variance.hpp.

Friends And Related Function Documentation

template<typename T, typename Strategy = circular_var>
friend class autocorr_acc< T >
friend

Definition at line 181 of file variance.hpp.

template<typename T, typename Strategy = circular_var>
friend class batch_result< T >
friend

Definition at line 182 of file variance.hpp.


The documentation for this class was generated from the following files: