ALPSCore reference
Public Member Functions | Friends | List of all members
alps::alea::mean_data< T > Class Template Reference

#include <mean.hpp>

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

Public Member Functions

 mean_data (size_t size)
 
void reset ()
 
size_t size () const
 
size_t count () const
 
size_t & count ()
 
const column< T > & data () const
 
column< T > & data ()
 
void convert_to_mean ()
 
void convert_to_sum ()
 

Friends

class mean_acc< T >
 
class mean_result< T >
 
void serialize (serializer &, const std::string &, const mean_result< T > &)
 
void deserialize (deserializer &, const std::string &, mean_result< T > &)
 

Detailed Description

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

Data which tracks only the mean/sum and the count.

Mean data may be particularly memory-constrained, therefore mean_acc is a "union"-like structure, which usually represents the sum (in the case of accumulating) or the mean (in the case of working with the mean).

Definition at line 17 of file mean.hpp.

Constructor & Destructor Documentation

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

Constructs new data with size elements

Definition at line 47 of file mean.hpp.

Member Function Documentation

template<typename T >
void alps::alea::mean_data< T >::convert_to_mean ( )

Re-interprets data that was a sum as mean

Definition at line 24 of file mean.cpp.

template<typename T >
void alps::alea::mean_data< T >::convert_to_sum ( )

Re-interprets data that was a mean as sum

Definition at line 30 of file mean.cpp.

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

Returns number of accumulated data points

Definition at line 56 of file mean.hpp.

template<typename T>
size_t& alps::alea::mean_data< T >::count ( )
inline

Returns number of accumulated data points

Definition at line 59 of file mean.hpp.

template<typename T>
const column<T>& alps::alea::mean_data< T >::data ( ) const
inline

Returns data vector (either mean or sum)

Definition at line 62 of file mean.hpp.

template<typename T>
column<T>& alps::alea::mean_data< T >::data ( )
inline

Returns data vector (either mean or sum)

Definition at line 65 of file mean.hpp.

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

Resets all data to zeros

Definition at line 17 of file mean.cpp.

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

Returns the size of the result vector

Definition at line 53 of file mean.hpp.

Friends And Related Function Documentation

template<typename T>
void deserialize ( deserializer s,
const std::string &  key,
mean_result< T > &  self 
)
friend

Definition at line 198 of file mean.cpp.

template<typename T>
friend class mean_acc< T >
friend

Definition at line 77 of file mean.hpp.

template<typename T>
friend class mean_result< T >
friend

Definition at line 78 of file mean.hpp.

template<typename T>
void serialize ( serializer s,
const std::string &  key,
const mean_result< T > &  self 
)
friend

Definition at line 185 of file mean.cpp.


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