preCICE v3.1.2
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
precice::utils::DoubleAggregator Class Reference

An accurate aggregator for doubles with usability in mind. More...

#include <DoubleAggregator.hpp>

Public Member Functions

void operator= (double d)
 Sets the aggregator to a value.
 
void add (double d)
 Adds a value to the aggregator.
 
void operator+= (double d)
 Natural version of adding a value.
 
void operator-= (double d)
 Natural version of subtracting a value.
 
double value () const
 Retrieves the corrected sum.
 
 operator double () const
 Allows implicit casting to a double.
 

Private Types

using Acc = boost::accumulators::accumulator_set<double, boost::accumulators::stats<boost::accumulators::tag::sum_kahan>>
 This class is mainly a wrapper for boost's Kahan accumulator which implements the Kahan summation algorithm (see https://en.wikipedia.org/wiki/Kahan_summation_algorithm)
 

Private Attributes

Acc acc
 

Detailed Description

An accurate aggregator for doubles with usability in mind.

Definition at line 8 of file DoubleAggregator.hpp.

Member Typedef Documentation

◆ Acc

using precice::utils::DoubleAggregator::Acc = boost::accumulators::accumulator_set<double, boost::accumulators::stats<boost::accumulators::tag::sum_kahan>>
private

This class is mainly a wrapper for boost's Kahan accumulator which implements the Kahan summation algorithm (see https://en.wikipedia.org/wiki/Kahan_summation_algorithm)

Definition at line 11 of file DoubleAggregator.hpp.

Member Function Documentation

◆ add()

void precice::utils::DoubleAggregator::add ( double d)
inline

Adds a value to the aggregator.

Definition at line 22 of file DoubleAggregator.hpp.

◆ operator double()

precice::utils::DoubleAggregator::operator double ( ) const
inline

Allows implicit casting to a double.

Definition at line 46 of file DoubleAggregator.hpp.

Here is the call graph for this function:

◆ operator+=()

void precice::utils::DoubleAggregator::operator+= ( double d)
inline

Natural version of adding a value.

Definition at line 28 of file DoubleAggregator.hpp.

Here is the call graph for this function:

◆ operator-=()

void precice::utils::DoubleAggregator::operator-= ( double d)
inline

Natural version of subtracting a value.

Definition at line 34 of file DoubleAggregator.hpp.

Here is the call graph for this function:

◆ operator=()

void precice::utils::DoubleAggregator::operator= ( double d)
inline

Sets the aggregator to a value.

Definition at line 15 of file DoubleAggregator.hpp.

◆ value()

double precice::utils::DoubleAggregator::value ( ) const
inline

Retrieves the corrected sum.

Definition at line 40 of file DoubleAggregator.hpp.

Member Data Documentation

◆ acc

Acc precice::utils::DoubleAggregator::acc
private

Definition at line 52 of file DoubleAggregator.hpp.


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