24 sum += pow<Power>(value);
147 }
else if (p > 0._f) {
163 if (avgPow == 0._f) {
166 return 1._f / avgPow;
212 stream <<
"average = " << stats.
mean() <<
" (min = " << stats.
min() <<
", max = " << stats.
max()
INLINE bool isReal(const AntisymmetricTensor &t)
#define SPH_ASSERT(x,...)
Tuple< T, T > minMax(const T &t1, const T &t2)
Helper function sorting two values.
Function for generic manipulation with geometric types.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Object representing interval of real values.
INLINE Float weight(const Vector &r1, const Vector &r2)
INLINE Float powFastest(const Float value, const Float power)
constexpr INLINE Float pow(const Float v)
Power for floats.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
Geometric mean has to be specialized.
friend std::ostream & operator<<(std::ostream &stream, const GeneralizedMean &stats)
INLINE Float compute() const
INLINE Size count() const
GeneralizedMean()=default
INLINE void accumulate(const Float value)
Generalized mean with fixed (compile-time) power.
friend std::ostream & operator<<(std::ostream &stream, const GeneralizedMean &stats)
INLINE Size count() const
INLINE void reset()
Removes all values from the set.
INLINE Float compute() const
INLINE void accumulate(const Float value)
GeneralizedMean()=default
Object representing a 1D interval of real numbers.
Helper class for statistics, accumulating minimal, maximal and mean value of a set of numbers.
INLINE void reset()
Removes all values from the set.
INLINE void accumulate(const Float value)
INLINE Size count() const
INLINE Float mean() const
INLINE Interval range() const
friend std::ostream & operator<<(std::ostream &stream, const MinMaxMean &stats)
Generalized mean with negative (runtime) power.
INLINE void accumulate(const Float value)
INLINE Float compute() const
NegativeMean(const Float power)
INLINE void accumulate(const NegativeMean &other)
Generalized mean with positive (runtime) power.
INLINE Float compute() const
INLINE Size count() const
INLINE void accumulate(const Float value)
PositiveMean(const Float power)
INLINE void accumulate(const PositiveMean &other)
friend std::ostream & operator<<(std::ostream &stream, const PositiveMean &stats)