JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
TNumericUtil::KahanAccumulator< T > Class Template Reference

#include <MELAAccumulators.h>

Public Member Functions

 KahanAccumulator ()
 
 KahanAccumulator (const T &value)
 
 KahanAccumulator (const KahanAccumulator< T > &other)
 
KahanAccumulatoroperator+= (const T &inc)
 
KahanAccumulatoroperator-= (const T &inc)
 
KahanAccumulatoroperator*= (const T &inc)
 
KahanAccumulatoroperator/= (const T &inc)
 
KahanAccumulator operator+ (const T &inc)
 
KahanAccumulator operator- (const T &inc)
 
KahanAccumulator operator* (const T &inc)
 
KahanAccumulator operator/ (const T &inc)
 
sum () const
 
 operator T () const
 

Protected Attributes

sum_
 
compensation_
 

Detailed Description

template<typename T>
class TNumericUtil::KahanAccumulator< T >

Definition at line 27 of file MELAAccumulators.h.

Constructor & Destructor Documentation

◆ KahanAccumulator() [1/3]

template<typename T >
TNumericUtil::KahanAccumulator< T >::KahanAccumulator ( )
inline

Definition at line 31 of file MELAAccumulators.h.

31 : sum_(0), compensation_(0) {}

◆ KahanAccumulator() [2/3]

template<typename T >
TNumericUtil::KahanAccumulator< T >::KahanAccumulator ( const T &  value)
inline

Definition at line 32 of file MELAAccumulators.h.

32 : sum_(value), compensation_(0) {}

◆ KahanAccumulator() [3/3]

template<typename T >
TNumericUtil::KahanAccumulator< T >::KahanAccumulator ( const KahanAccumulator< T > &  other)
inline

Definition at line 33 of file MELAAccumulators.h.

33 : sum_(other.sum_), compensation_(other.compensation_){}

Member Function Documentation

◆ operator T()

template<typename T >
TNumericUtil::KahanAccumulator< T >::operator T ( ) const
inline

Definition at line 50 of file MELAAccumulators.h.

50 { return sum_; }

◆ operator*()

template<typename T >
KahanAccumulator TNumericUtil::KahanAccumulator< T >::operator* ( const T &  inc)
inline

Definition at line 47 of file MELAAccumulators.h.

47 { KahanAccumulator<T> tmp(*this); tmp *= inc; return tmp; }

◆ operator*=()

template<typename T >
KahanAccumulator& TNumericUtil::KahanAccumulator< T >::operator*= ( const T &  inc)
inline

Definition at line 43 of file MELAAccumulators.h.

43 { sum_ *= inc; compensation_ *= inc; return *this; }

◆ operator+()

template<typename T >
KahanAccumulator TNumericUtil::KahanAccumulator< T >::operator+ ( const T &  inc)
inline

Definition at line 45 of file MELAAccumulators.h.

45 { KahanAccumulator<T> tmp(*this); tmp += inc; return tmp; }

◆ operator+=()

template<typename T >
KahanAccumulator& TNumericUtil::KahanAccumulator< T >::operator+= ( const T &  inc)
inline

Definition at line 34 of file MELAAccumulators.h.

34  {
35  T y = inc - compensation_;
36  T sumnew = sum_ + y;
37  T sumerr = (sumnew - sum_);
38  compensation_ = sumerr - y;
39  sum_ = sumnew;
40  return *this;
41  }

◆ operator-()

template<typename T >
KahanAccumulator TNumericUtil::KahanAccumulator< T >::operator- ( const T &  inc)
inline

Definition at line 46 of file MELAAccumulators.h.

46 { KahanAccumulator<T> tmp(*this); tmp -= inc; return tmp; }

◆ operator-=()

template<typename T >
KahanAccumulator& TNumericUtil::KahanAccumulator< T >::operator-= ( const T &  inc)
inline

Definition at line 42 of file MELAAccumulators.h.

42 { this->operator+=(-inc); return *this; }

◆ operator/()

template<typename T >
KahanAccumulator TNumericUtil::KahanAccumulator< T >::operator/ ( const T &  inc)
inline

Definition at line 48 of file MELAAccumulators.h.

48 { KahanAccumulator<T> tmp(*this); tmp /= inc; return tmp; }

◆ operator/=()

template<typename T >
KahanAccumulator& TNumericUtil::KahanAccumulator< T >::operator/= ( const T &  inc)
inline

Definition at line 44 of file MELAAccumulators.h.

44 { sum_ /= inc; compensation_ /= inc; return *this; }

◆ sum()

template<typename T >
T TNumericUtil::KahanAccumulator< T >::sum ( ) const
inline

Definition at line 49 of file MELAAccumulators.h.

49 { return sum_; }

Member Data Documentation

◆ compensation_

template<typename T >
T TNumericUtil::KahanAccumulator< T >::compensation_
protected

Definition at line 29 of file MELAAccumulators.h.

◆ sum_

template<typename T >
T TNumericUtil::KahanAccumulator< T >::sum_
protected

Definition at line 29 of file MELAAccumulators.h.


The documentation for this class was generated from the following file:
value
pymela::gHIGGS_KAPPA value("gHIGGS_KAPPA_TILDE", pymela::gHIGGS_KAPPA_TILDE) .value("SIZE_HQQ"
hto_rootw::inc
integer inc
Definition: CALLING_cpHTO.f:246
TNumericUtil::KahanAccumulator::sum_
T sum_
Definition: MELAAccumulators.h:29
TNumericUtil::KahanAccumulator::compensation_
T compensation_
Definition: MELAAccumulators.h:29
TNumericUtil::KahanAccumulator::operator+=
KahanAccumulator & operator+=(const T &inc)
Definition: MELAAccumulators.h:34