3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CappedAverage< num > Class Template Reference

This class is intended to calculate capped average values. Let you have positive values a[i]. Most of them are valid and regular, bot some (small amount) of them are erratic and getting big random value. You need to calculate average value without taking into account too big and too small values. Use this class for this purpose. Multithreaded addition supported. More...

#include <CappedAverage.h>

Public Member Functions

void operator+= (float value)
 add the value to summ More...
 
void finish (float top_cap_coef=8.0f, float bottom_cap_coef=0.01f)
 Call it once after finishing the summ. The top_cap_coef and bottom_cap_coef used to drop off values that are above average_value*top_cap_coef or below the average_value * bottom_cap_coef. More...
 
float average ()
 Get capped average value. More...
 

Detailed Description

template<int num = 2048>
class CappedAverage< num >

This class is intended to calculate capped average values. Let you have positive values a[i]. Most of them are valid and regular, bot some (small amount) of them are erratic and getting big random value. You need to calculate average value without taking into account too big and too small values. Use this class for this purpose. Multithreaded addition supported.

ca+=1.0;
ca+=3.0;
ca+=100.0;
ca.dinish();
float r=ca.Average();//r is 2.0

Member Function Documentation

template<int num>
float CappedAverage< num >::average ( )

Get capped average value.

template<int num>
void CappedAverage< num >::finish ( float  top_cap_coef = 8.0f,
float  bottom_cap_coef = 0.01f 
)

Call it once after finishing the summ. The top_cap_coef and bottom_cap_coef used to drop off values that are above average_value*top_cap_coef or below the average_value * bottom_cap_coef.

gradual average finding

template<int num>
void CappedAverage< num >::operator+= ( float  value)

add the value to summ


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