Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::AccurateSum< FpNumber > Class Template Reference

#include <accurate_sum.h>

Public Member Functions

 AccurateSum ()
 You may copy-construct an AccurateSum.
 
void Add (const FpNumber &value)
 Adds an FpNumber to the sum.
 
FpNumber Value () const
 Gets the value of the sum.
 

Detailed Description

template<typename FpNumber>
class operations_research::AccurateSum< FpNumber >

Kahan summation compensation algorithm.

http://en.wikipedia.org/wiki/Kahan_summation_algorithm

Definition at line 23 of file accurate_sum.h.

Constructor & Destructor Documentation

◆ AccurateSum()

template<typename FpNumber >
operations_research::AccurateSum< FpNumber >::AccurateSum ( )
inline

You may copy-construct an AccurateSum.

Definition at line 26 of file accurate_sum.h.

Member Function Documentation

◆ Add()

template<typename FpNumber >
void operations_research::AccurateSum< FpNumber >::Add ( const FpNumber & value)
inline

Adds an FpNumber to the sum.

Definition at line 29 of file accurate_sum.h.

◆ Value()

template<typename FpNumber >
FpNumber operations_research::AccurateSum< FpNumber >::Value ( ) const
inline

Gets the value of the sum.

Definition at line 37 of file accurate_sum.h.


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