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

#include <batch.hpp>

Collaboration diagram for alps::alea::batch_acc< T >:
Collaboration graph

Public Types

using value_type = T
 

Public Member Functions

 batch_acc (size_t size=1, size_t num_batches=256, size_t base_size=1)
 
 batch_acc (const batch_acc &other)
 
batch_accoperator= (const batch_acc &other)
 
void reset ()
 
void set_size (size_t size)
 
void set_num_batches (size_t batch_size)
 
void set_batch_size (size_t batch_size)
 
bool valid () const
 
size_t size () const
 
size_t num_batches () const
 
batch_accoperator<< (const computed< T > &src)
 
batch_accoperator<< (const batch_result< T > &result)
 
size_t count () const
 
batch_result< T > result () const
 
batch_result< T > finalize ()
 
const batch_data< T > & store () const
 
const internal::galois_hoppercursor () const
 
const eigen< size_t >::row & offset () const
 
size_t current_batch_size () const
 

Protected Member Functions

void add (const computed< T > &source, size_t count)
 
void next_batch ()
 
void finalize_to (batch_result< T > &result)
 

Detailed Description

template<typename T>
class alps::alea::batch_acc< T >

Accumulator which keeps track of batches of (consecutive) measurements

Definition at line 19 of file batch.hpp.

Member Typedef Documentation

template<typename T >
using alps::alea::batch_acc< T >::value_type = T

Definition at line 85 of file batch.hpp.

Constructor & Destructor Documentation

template<typename T >
alps::alea::batch_acc< T >::batch_acc ( size_t  size = 1,
size_t  num_batches = 256,
size_t  base_size = 1 
)

Definition at line 38 of file batch.cpp.

template<typename T >
alps::alea::batch_acc< T >::batch_acc ( const batch_acc< T > &  other)

Definition at line 55 of file batch.cpp.

Member Function Documentation

template<typename T >
void alps::alea::batch_acc< T >::add ( const computed< T > &  source,
size_t  count 
)
protected

Definition at line 119 of file batch.cpp.

template<typename T >
size_t alps::alea::batch_acc< T >::count ( ) const
inline

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

Definition at line 122 of file batch.hpp.

template<typename T >
size_t alps::alea::batch_acc< T >::current_batch_size ( ) const
inline

Definition at line 137 of file batch.hpp.

template<typename T >
const internal::galois_hopper& alps::alea::batch_acc< T >::cursor ( ) const
inline

Definition at line 133 of file batch.hpp.

template<typename T >
batch_result< T > alps::alea::batch_acc< T >::finalize ( )

Frees data associated with accumulator and return result

Definition at line 180 of file batch.cpp.

template<typename T >
void alps::alea::batch_acc< T >::finalize_to ( batch_result< T > &  result)
protected

Definition at line 188 of file batch.cpp.

template<typename T >
void alps::alea::batch_acc< T >::next_batch ( )
protected

Definition at line 151 of file batch.cpp.

template<typename T >
size_t alps::alea::batch_acc< T >::num_batches ( ) const
inline

Number of stores batches

Definition at line 113 of file batch.hpp.

template<typename T >
const eigen<size_t>::row& alps::alea::batch_acc< T >::offset ( ) const
inline

Definition at line 135 of file batch.hpp.

template<typename T >
batch_acc& alps::alea::batch_acc< T >::operator<< ( const computed< T > &  src)
inline

Add computed vector to the accumulator

Definition at line 116 of file batch.hpp.

template<typename T >
batch_acc< T > & alps::alea::batch_acc< T >::operator<< ( const batch_result< T > &  result)

Merge partial result into accumulator

Definition at line 134 of file batch.cpp.

template<typename T >
batch_acc< T > & alps::alea::batch_acc< T >::operator= ( const batch_acc< T > &  other)

Definition at line 65 of file batch.cpp.

template<typename T >
void alps::alea::batch_acc< T >::reset ( )

Re-allocate and thus clear all accumulated data

Definition at line 77 of file batch.cpp.

template<typename T >
batch_result< T > alps::alea::batch_acc< T >::result ( ) const

Returns result corresponding to current state of accumulator

Definition at line 172 of file batch.cpp.

template<typename T >
void alps::alea::batch_acc< T >::set_batch_size ( size_t  batch_size)

Update the batch size and discard all measurements, if any

Definition at line 100 of file batch.cpp.

template<typename T >
void alps::alea::batch_acc< T >::set_num_batches ( size_t  batch_size)

Update the number of batches and discard all measurements, if any

Definition at line 108 of file batch.cpp.

template<typename T >
void alps::alea::batch_acc< T >::set_size ( size_t  size)

Update the size and discard all measurements, if any

Definition at line 90 of file batch.cpp.

template<typename T >
size_t alps::alea::batch_acc< T >::size ( ) const
inline

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

Definition at line 110 of file batch.hpp.

template<typename T >
const batch_data<T>& alps::alea::batch_acc< T >::store ( ) const
inline

Return backend object used for storing estimands

Definition at line 131 of file batch.hpp.

template<typename T >
bool alps::alea::batch_acc< T >::valid ( ) const
inline

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

Definition at line 107 of file batch.hpp.


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