Static Public Member Functions

pav::lib::Util Class Reference

List of all members.

Static Public Member Functions

static float[] quantize (float[] data, int steps)
static float[] quantize (float[] data, int steps, float dataMin, float dataMax)
static float[] calcMinMax (float[] data)

Detailed Description

Misc utility functions. This is a static class.

Author:
christopher

Member Function Documentation

static float [] pav::lib::Util::calcMinMax ( float[]  data  )  [inline, static]

Calculates the minimum and maximum of a data set.

Parameters:
data The data set. Must not be null
Returns:
An array of the form { min, max }
static float [] pav::lib::Util::quantize ( float[]  data,
int  steps 
) [inline, static]

Quantizes values to a number of integers, e.g. if data is {3,4,5,6} and steps is 2 the result will be {1.0,1.0,2.0,2.0}. The lowest value in data will always map to 1.0, the largest to steps.

Parameters:
data The data to quantize. Must not be null
steps The number of steps. Must be > 0
Returns:
The quantized data
static float [] pav::lib::Util::quantize ( float[]  data,
int  steps,
float  dataMin,
float  dataMax 
) [inline, static]

Quantizes values to a number of integers, e.g. if data is {3,4,5,6} and steps is 2 the result will be {1.0,1.0,2.0,2.0}. The lowest value in data will always map to 1, the largest to steps. Use this version if you know the min and max values of the data set.

Parameters:
data The data to quantize. Must not be null
steps The number of steps. Must be > 0
dataMin The minimum value in data
dataMax The maximum value in data
Returns:
The quantized data

The documentation for this class was generated from the following file:
 All Classes Functions Variables