A DataClipper gets a bunch of data and determines at what value to clip if a certain clippercentag is desired.
More...
List of all members.
Public Member Functions |
| | DataClipper () |
| bool | isEmpty () const |
| void | setApproxNrValues (od_int64 nrsamples, int statsize=2000) |
| void | putData (float) |
| void | putData (const float *, od_int64 sz) |
| void | putData (const ValueSeries< float > &, od_int64 sz) |
| void | putData (const ArrayND< float > &) |
| bool | calculateRange (float cliprate, Interval< float > &) |
| bool | calculateRange (float lowcliprate, float highcliprate, Interval< float > &) |
| bool | fullSort () |
| bool | getRange (float cliprate, Interval< float > &) const |
| bool | getRange (float lowcliprate, float highcliprate, Interval< float > &) const |
| bool | getSymmetricRange (float cliprate, float midval, Interval< float > &) const |
| void | reset () |
| const TypeSet< float > & | statPts () const |
Static Public Member Functions |
| static bool | calculateRange (float *vals, od_int64 nrvals, float lowcliprate, float highcliprate, Interval< float > &) |
Protected Attributes |
| int | approxstatsize_ |
| float | sampleprob_ |
| bool | subselect_ |
| TypeSet< float > | samples_ |
Detailed Description
A DataClipper gets a bunch of data and determines at what value to clip if a certain clippercentag is desired.
For simple cases, where no subselection is needed (i.e. the stats will be performed on all values, and only one dataset is used) the static function calculateRange is good enough:
If there are more than one dataset, or if a subselection is wanted, the class is used as follows:
- Create object
- If subselection is wanted, set total nr of samples and statsize with setApproxNrValues
- Add all your sources putData
- If you only want a fixed range, call calculateRange.
- If you want to come back an get multiple ranges, call fullSort. After fullSort, the getRange functions can be called, any number of times.
- To prepare the object for a new set of data, call reset.
Example
Constructor & Destructor Documentation
| DataClipper::DataClipper |
( |
|
) |
|
cliprate is between 0 and 0.5, cliprate0 is the bottom cliprate, cliprate1 is the top cliprate, when cliprate1 is -1, it will get the value of cliprate0
Member Function Documentation
| bool DataClipper::calculateRange |
( |
float |
cliprate, |
|
|
Interval< float > & |
| |
|
) |
| | |
Does not do a full sort. Also performes reset
| bool DataClipper::calculateRange |
( |
float |
lowcliprate, |
|
|
float |
highcliprate, |
|
|
Interval< float > & |
| |
|
) |
| | |
Does not do a full sort. Also performes reset
| static bool DataClipper::calculateRange |
( |
float * |
vals, |
|
|
od_int64 |
nrvals, |
|
|
float |
lowcliprate, |
|
|
float |
highcliprate, |
|
|
Interval< float > & |
| |
|
) |
| | [static] |
Does not do a full sort.
- Note:
- vals are modified.
| bool DataClipper::fullSort |
( |
|
) |
|
| bool DataClipper::getRange |
( |
float |
cliprate, |
|
|
Interval< float > & |
| |
|
) |
| | const |
| bool DataClipper::getRange |
( |
float |
lowcliprate, |
|
|
float |
highcliprate, |
|
|
Interval< float > & |
| |
|
) |
| | const |
| bool DataClipper::getSymmetricRange |
( |
float |
cliprate, |
|
|
float |
midval, |
|
|
Interval< float > & |
| |
|
) |
| | const |
| bool DataClipper::isEmpty |
( |
|
) |
const [inline] |
| void DataClipper::putData |
( |
const float * |
, |
|
|
od_int64 |
sz | |
|
) |
| | |
| void DataClipper::putData |
( |
float |
|
) |
|
| void DataClipper::putData |
( |
const ArrayND< float > & |
|
) |
|
| void DataClipper::putData |
( |
const ValueSeries< float > & |
, |
|
|
od_int64 |
sz | |
|
) |
| | |
| void DataClipper::reset |
( |
|
) |
|
| void DataClipper::setApproxNrValues |
( |
od_int64 |
nrsamples, |
|
|
int |
statsize = 2000 | |
|
) |
| | |
Will make it faster if large amount (>10000 samples) of data is used. The Object will then randomly subselect on the input to get about statsize samples to do the stats on.
| const TypeSet<float>& DataClipper::statPts |
( |
|
) |
const [inline] |
Member Data Documentation