SPH
Public Member Functions | Protected Attributes | Friends | List of all members
PositiveMean Class Reference

Generalized mean with positive (runtime) power. More...

#include <Means.h>

Inheritance diagram for PositiveMean:
NegativeMean

Public Member Functions

 PositiveMean (const Float power)
 
INLINE void accumulate (const Float value)
 
INLINE void accumulate (const PositiveMean &other)
 
INLINE void reset ()
 
INLINE Float compute () const
 
INLINE Size count () const
 

Protected Attributes

double sum = 0.
 
Size weight = 0
 
Float power
 

Friends

std::ostream & operator<< (std::ostream &stream, const PositiveMean &stats)
 

Detailed Description

Generalized mean with positive (runtime) power.

Cannot be used to compute geometric mean. If constructed with non-positive power, it issues an assert.

Definition at line 92 of file Means.h.

Constructor & Destructor Documentation

◆ PositiveMean()

PositiveMean::PositiveMean ( const Float  power)
inline

Definition at line 99 of file Means.h.

Member Function Documentation

◆ accumulate() [1/2]

INLINE void PositiveMean::accumulate ( const Float  value)
inline

Definition at line 104 of file Means.h.

◆ accumulate() [2/2]

INLINE void PositiveMean::accumulate ( const PositiveMean other)
inline

Definition at line 109 of file Means.h.

◆ compute()

INLINE Float PositiveMean::compute ( ) const
inline

Definition at line 120 of file Means.h.

◆ count()

INLINE Size PositiveMean::count ( ) const
inline

Definition at line 124 of file Means.h.

◆ reset()

INLINE void PositiveMean::reset ( )
inline

Definition at line 115 of file Means.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const PositiveMean stats 
)
friend

Definition at line 128 of file Means.h.

Member Data Documentation

◆ power

Float PositiveMean::power
protected

Definition at line 96 of file Means.h.

◆ sum

double PositiveMean::sum = 0.
protected

Definition at line 94 of file Means.h.

◆ weight

Size PositiveMean::weight = 0
protected

Definition at line 95 of file Means.h.


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