HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nanovdb::Stats< ValueT, 0 > Class Template Reference

This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values. More...

#include <GridStats.h>

+ Inheritance diagram for nanovdb::Stats< ValueT, 0 >:

Public Types

using ValueType = ValueT
 
- Public Types inherited from nanovdb::Extrema< ValueT, 0 >
using ValueType = ValueT
 

Public Member Functions

__hostdev__ Stats ()
 
__hostdev__ Stats (const ValueT &val)
 
__hostdev__ Statsadd (const ValueT &val)
 Add a single sample. More...
 
__hostdev__ Statsadd (const ValueT &val, uint64_t n)
 Add n samples with constant value val. More...
 
__hostdev__ Statsadd (const Stats &other)
 Add the samples from the other Stats instance. More...
 
__hostdev__ size_t size () const
 
template<typename NodeT >
__hostdev__ void setStats (NodeT &node) const
 
__hostdev__ double avg () const
 Return the arithmetic mean, i.e. average, value. More...
 
__hostdev__ double mean () const
 Return the arithmetic mean, i.e. average, value. More...
 
__hostdev__ double var () const
 Return the population variance. More...
 
__hostdev__ double variance () const
 Return the population variance. More...
 
__hostdev__ double std () const
 Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance. More...
 
__hostdev__ double stdDev () const
 Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance. More...
 
- Public Member Functions inherited from nanovdb::Extrema< ValueT, 0 >
__hostdev__ Extrema ()
 
__hostdev__ Extrema (const ValueT &v)
 
__hostdev__ Extrema (const ValueT &a, const ValueT &b)
 
__hostdev__ Extremamin (const ValueT &v)
 
__hostdev__ Extremamax (const ValueT &v)
 
__hostdev__ Extremaadd (const ValueT &v)
 
__hostdev__ Extremaadd (const ValueT &v, uint64_t)
 
__hostdev__ Extremaadd (const Extrema &other)
 
__hostdev__ const ValueT & min () const
 
__hostdev__ const ValueT & max () const
 
__hostdev__ operator bool () const
 
template<typename NodeT >
__hostdev__ void setStats (NodeT &node) const
 

Static Public Member Functions

static __hostdev__ constexpr bool hasMinMax ()
 
static __hostdev__ constexpr bool hasAverage ()
 
static __hostdev__ constexpr bool hasStdDeviation ()
 
static __hostdev__ constexpr bool hasStats ()
 
- Static Public Member Functions inherited from nanovdb::Extrema< ValueT, 0 >
static __hostdev__ constexpr bool hasMinMax ()
 
static __hostdev__ constexpr bool hasAverage ()
 
static __hostdev__ constexpr bool hasStdDeviation ()
 
static __hostdev__ constexpr bool hasStats ()
 
static __hostdev__ constexpr size_t size ()
 

Protected Types

using BaseT = Extrema< ValueT, 0 >
 
using RealT = double
 

Protected Attributes

size_t mSize
 
double mAvg
 
double mAux
 
- Protected Attributes inherited from nanovdb::Extrema< ValueT, 0 >
ValueT mMin
 
ValueT mMax
 

Detailed Description

template<typename ValueT>
class nanovdb::Stats< ValueT, 0 >

This class computes statistics (minimum value, maximum value, mean, variance and standard deviation) of a population of floating-point values.

variance = Mean[ (X-Mean[X])^2 ] = Mean[X^2] - Mean[X]^2, standard deviation = sqrt(variance)

Note
This class employs incremental computation and double precision.

Definition at line 231 of file GridStats.h.

Member Typedef Documentation

template<typename ValueT >
using nanovdb::Stats< ValueT, 0 >::BaseT = Extrema<ValueT, 0>
protected

Definition at line 234 of file GridStats.h.

template<typename ValueT >
using nanovdb::Stats< ValueT, 0 >::RealT = double
protected

Definition at line 235 of file GridStats.h.

template<typename ValueT >
using nanovdb::Stats< ValueT, 0 >::ValueType = ValueT

Definition at line 240 of file GridStats.h.

Constructor & Destructor Documentation

template<typename ValueT >
__hostdev__ nanovdb::Stats< ValueT, 0 >::Stats ( )
inline

Definition at line 241 of file GridStats.h.

template<typename ValueT >
__hostdev__ nanovdb::Stats< ValueT, 0 >::Stats ( const ValueT &  val)
inline

Definition at line 248 of file GridStats.h.

Member Function Documentation

template<typename ValueT >
__hostdev__ Stats& nanovdb::Stats< ValueT, 0 >::add ( const ValueT &  val)
inline

Add a single sample.

Definition at line 256 of file GridStats.h.

template<typename ValueT >
__hostdev__ Stats& nanovdb::Stats< ValueT, 0 >::add ( const ValueT &  val,
uint64_t  n 
)
inline

Add n samples with constant value val.

Definition at line 266 of file GridStats.h.

template<typename ValueT >
__hostdev__ Stats& nanovdb::Stats< ValueT, 0 >::add ( const Stats< ValueT, 0 > &  other)
inline

Add the samples from the other Stats instance.

Definition at line 278 of file GridStats.h.

template<typename ValueT >
__hostdev__ double nanovdb::Stats< ValueT, 0 >::avg ( ) const
inline

Return the arithmetic mean, i.e. average, value.

Definition at line 300 of file GridStats.h.

template<typename ValueT >
static __hostdev__ constexpr bool nanovdb::Stats< ValueT, 0 >::hasAverage ( )
inlinestatic

Definition at line 292 of file GridStats.h.

template<typename ValueT >
static __hostdev__ constexpr bool nanovdb::Stats< ValueT, 0 >::hasMinMax ( )
inlinestatic

Definition at line 291 of file GridStats.h.

template<typename ValueT >
static __hostdev__ constexpr bool nanovdb::Stats< ValueT, 0 >::hasStats ( )
inlinestatic

Definition at line 294 of file GridStats.h.

template<typename ValueT >
static __hostdev__ constexpr bool nanovdb::Stats< ValueT, 0 >::hasStdDeviation ( )
inlinestatic

Definition at line 293 of file GridStats.h.

template<typename ValueT >
__hostdev__ double nanovdb::Stats< ValueT, 0 >::mean ( ) const
inline

Return the arithmetic mean, i.e. average, value.

Definition at line 301 of file GridStats.h.

template<typename ValueT >
template<typename NodeT >
__hostdev__ void nanovdb::Stats< ValueT, 0 >::setStats ( NodeT &  node) const
inline

Definition at line 320 of file GridStats.h.

template<typename ValueT >
__hostdev__ size_t nanovdb::Stats< ValueT, 0 >::size ( void  ) const
inline

Definition at line 296 of file GridStats.h.

template<typename ValueT >
__hostdev__ double nanovdb::Stats< ValueT, 0 >::std ( ) const
inline

Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance.

Definition at line 315 of file GridStats.h.

template<typename ValueT >
__hostdev__ double nanovdb::Stats< ValueT, 0 >::stdDev ( ) const
inline

Return the standard deviation (=Sqrt(variance)) as defined from the (biased) population variance.

Definition at line 316 of file GridStats.h.

template<typename ValueT >
__hostdev__ double nanovdb::Stats< ValueT, 0 >::var ( ) const
inline

Return the population variance.

Note
The unbiased sample variance = population variance * num/(num-1)

Definition at line 308 of file GridStats.h.

template<typename ValueT >
__hostdev__ double nanovdb::Stats< ValueT, 0 >::variance ( ) const
inline

Return the population variance.

Note
The unbiased sample variance = population variance * num/(num-1)

Definition at line 309 of file GridStats.h.

Member Data Documentation

template<typename ValueT >
double nanovdb::Stats< ValueT, 0 >::mAux
protected

Definition at line 237 of file GridStats.h.

template<typename ValueT >
double nanovdb::Stats< ValueT, 0 >::mAvg
protected

Definition at line 237 of file GridStats.h.

template<typename ValueT >
size_t nanovdb::Stats< ValueT, 0 >::mSize
protected

Definition at line 236 of file GridStats.h.


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