All Classes Namespaces Files Functions Variables Typedefs Macros
clizFunctions.cpp File Reference
#include "clizFunctions.h"
Include dependency graph for clizFunctions.cpp:

Functions

void check_heap (char *file, int line)
 
int clBinomial (int n, int k)
 
float clSign (float x)
 
int clMax (int a, int b)
 
void clSort (float vec[], int n)
 
void clSort (unsigned int vec[], int n)
 
void clSortTwo (unsigned int vec[], unsigned int vec2[], int n)
 
void clSortTwo (float vec[], float vec2[], int n)
 
void clSortTwo (float vec[], unsigned int vec2[], int n)
 
float clMedian (float vec[], int n)
 
float clMedian (unsigned int vec[], int n)
 
float clMean (float arr[], uint32_t n)
 
double clMean (double arr[], uint32_t n)
 
float clStd (float arr[], uint32_t n)
 
float clStdWithMean (float arr[], uint32_t n, float mean)
 
float * clAbs (float arr[], uint32_t n)
 
uint32_t clMaxIndex (float arr[], uint32_t begin, uint32_t end)
 
uint32_t clMaxAbsIndex (float arr[], uint32_t begin, uint32_t end)
 
uint32_t clMinIndex (float arr[], uint32_t begin, uint32_t end)
 
double clErfc (double x)
 
double clErfc2 (double x)
 
double clErfc3 (double x)
 
float clKSTest (float arr[], uint32_t n, MemoryManager &memMan)
 
void clFindHighestIndices (float arr[], uint32_t n, uint32_t output[], uint32_t numindices, MemoryManager &memMan)
 
void clFindLowestIndices (float arr[], uint32_t n, uint32_t output[], uint32_t numindices, MemoryManager &memMan)
 
void clSplineGetY2 (float y[], int n, float y2[], MemoryManager &memMan)
 
float clSplineInterp (float y[], float y2[], float x)
 
void clHaarWaveDecWithOffset (float spikes[], unsigned int size, uint8_t scales, float output[], uint32_t offset, MemoryManager &memMan)
 
void clXCorr (float *X, float *Y, unsigned int n, int maxshift, float *&output, MemoryManager &memMan)
 
void clXCorr (double *X, double *Y, unsigned int n, int maxshift, double *&output, MemoryManager &memMan)
 

Variables

GlobalMemoryManager gMemMan
 

Function Documentation

void check_heap ( char *  file,
int  line 
)
float* clAbs ( float  arr[],
uint32_t  n 
)

Changes all values of an array to their absolute values

Parameters
[in,out]arrArray to be converted to abs(arr)
[in]nNumber of values to be converted

Here is the caller graph for this function:

int clBinomial ( int  n,
int  k 
)

Binomial coefficient Number of combinations when choosing k elements from an n elements pool

Parameters
[in]nNumber of elements in pool
[in]knumber of chosen elements
Returns
Number of combinations
double clErfc ( double  x)
inline

Approximation of error function by Abramowitz and Stegun

Parameters
[in]xInput
double clErfc2 ( double  x)
inline

Approximation of error function by Abramowitz and Stegun

Parameters
[in]xInput
double clErfc3 ( double  x)
inline

Approximation of error function by Abramowitz and Stegun

Parameters
[in]xInput

Here is the caller graph for this function:

void clFindHighestIndices ( float  arr[],
uint32_t  n,
uint32_t  output[],
uint32_t  numindices,
MemoryManager memMan 
)

Writes the indices of the highest values in output (descending)

Parameters
[in]arrArray to be searched
[in]nUp to which index the array should be searched
[out]outputArray to hold the indices of the highest values
[in]numindicesHow many indices should be written to output

Here is the call graph for this function:

Here is the caller graph for this function:

void clFindLowestIndices ( float  arr[],
uint32_t  n,
uint32_t  output[],
uint32_t  numindices,
MemoryManager memMan 
)

Writes the indices of the lowest values in output

Parameters
[in]arrArray to be searched
[in]nUp to which index the array should be searched
[out]outputArray to hold the indices of the lowest values
[in]numindicesHow many indices should be written to output

Here is the call graph for this function:

void clHaarWaveDecWithOffset ( float  spikes[],
unsigned int  size,
uint8_t  scales,
float  output[],
uint32_t  offset,
MemoryManager memMan 
)

Haar wavelet decomposition

Parameters
[in]spikesArray of data points to be decomposed
[in]sizeNumber of data points
[in]scalesHow deep the decomposition goes before plugging
[out]outputStore for the wavelet coefficients
[in]offsetWhere in the output array to start storing the wavelet coefficients

Here is the call graph for this function:

Here is the caller graph for this function:

float clKSTest ( float  arr[],
uint32_t  n,
MemoryManager memMan 
)

Lilliefors modification of the Kolmogorov-Smirnov (KS) test for normality

Parameters
[in]arrInput array
[in]nUp to which index deviation from normality should be calculated.
Returns
Maximum deviation from normality

Here is the call graph for this function:

Here is the caller graph for this function:

int clMax ( int  a,
int  b 
)

Max Returns the bigger value

Parameters
[in]avalue
[in]bvalue

Here is the caller graph for this function:

uint32_t clMaxAbsIndex ( float  arr[],
uint32_t  begin,
uint32_t  end 
)

Returns the index of the absolute maximum value

Parameters
[in]arrArray to be searched
[in]beginWhere the search starts
[in]endWhere the search ends

Here is the caller graph for this function:

uint32_t clMaxIndex ( float  arr[],
uint32_t  begin,
uint32_t  end 
)

Returns the index of the maximum value

Parameters
[in]arrArray to be searched
[in]beginWhere the search starts
[in]endWhere the search ends

Here is the caller graph for this function:

float clMean ( float  arr[],
uint32_t  n 
)

Mean

Parameters
[in]arrArray from which the mean is calculated
[in]nNumber of values from which the mean is calculated

Here is the caller graph for this function:

double clMean ( double  arr[],
uint32_t  n 
)

Mean

Parameters
[in]arrArray from which the mean is calculated
[in]nNumber of values from which the mean is calculated
float clMedian ( float  vec[],
int  n 
)

Median based on Quicksort Only correct for odd numbers of n

Parameters
[in,out]vecArray to be sorted
[in]nNumber of values to be sorted

Here is the caller graph for this function:

float clMedian ( unsigned int  vec[],
int  n 
)

Median based on Quicksort Only correct for odd numbers of n

Parameters
[in,out]vecArray to be sorted
[in]nNumber of values to be sorted
uint32_t clMinIndex ( float  arr[],
uint32_t  begin,
uint32_t  end 
)

Returns the index of the minimum value

Parameters
[in]arrArray to be searched
[in]beginWhere the search starts
[in]endWhere the search ends

Here is the caller graph for this function:

float clSign ( float  x)

Signum Returns 1 if x >= 0 and -1 otherwise

Parameters
[in]xvalue
void clSort ( float  vec[],
int  n 
)
inline

Quicksort based on Sedgewick, R. (1978) "Implementing Quicksort Programs"

Parameters
[in,out]vecArray to be sorted
[in]nNumber of values to be sorted

Here is the caller graph for this function:

void clSort ( unsigned int  vec[],
int  n 
)

Quicksort based on Sedgewick, R. (1978) "Implementing Quicksort Programs"

Parameters
[in,out]vecArray to be sorted
[in]nNumber of values to be sorted
void clSortTwo ( unsigned int  vec[],
unsigned int  vec2[],
int  n 
)

Quicksort based on Sedgewick, R. (1978) "Implementing Quicksort Programs" To sort a second array the same way, the first is sorted.

Parameters
[in,out]vecArray to be sorted
[in,out]vec2Array to be sorted in the same was as vec
[in]nNumber of values to be sorted

Here is the caller graph for this function:

void clSortTwo ( float  vec[],
float  vec2[],
int  n 
)

Quicksort based on Sedgewick, R. (1978) "Implementing Quicksort Programs" To sort a second array the same way, the first is sorted.

Parameters
[in,out]vecArray to be sorted
[in,out]vec2Array to be sorted in the same was as vec
[in]nNumber of values to be sorted
void clSortTwo ( float  vec[],
unsigned int  vec2[],
int  n 
)

Quicksort based on Sedgewick, R. (1978) "Implementing Quicksort Programs" To sort a second array the same way, the first is sorted.

Parameters
[in,out]vecArray to be sorted
[in,out]vec2Array to be sorted in the same was as vec
[in]nNumber of values to be sorted
void clSplineGetY2 ( float  y[],
int  n,
float  y2[],
MemoryManager memMan 
)

Cubic spline interpolation. Calculates second derivatives for cubic spline interpolation Works under the following assumptions: length(y)=length(x)=n x[i]=x(i) for i=0:1:n-1 Therefore, no x vector is needed as input.

Parameters
[in]yy values of the data points
[in]nUp to which index y2 should be calculated
[out]y2Second derivatives of the interpolating function

Here is the call graph for this function:

Here is the caller graph for this function:

float clSplineInterp ( float  y[],
float  y2[],
float  x 
)

Cubic spline interpolation. Interpolates y value for x based on second derivatives. Works under the following assumptions: length(y)=length(x)=n x[i]=x(i) for i=0:1:n-1 Therefore, no x vector is needed as input.

Parameters
[in]yy values of the data points
[in]y2Second derivatives of the interpolating function
[in]xx value of the point to be interpolated

Here is the caller graph for this function:

float clStd ( float  arr[],
uint32_t  n 
)

Standard deviation

Parameters
[in]arrArray from which the std is calculated
[in]nNumber of values from which the std is calculated

Here is the call graph for this function:

float clStdWithMean ( float  arr[],
uint32_t  n,
float  mean 
)
inline

Standard deviation with mean as argument (reduced computation compared to clStd if the mean was already calculated)

Parameters
[in]arrArray from which the std is calculated
[in]nNumber of values from which the std is calculated
[in]meanMean to use to calculate the std

Here is the caller graph for this function:

void clXCorr ( float *  X,
float *  Y,
unsigned int  n,
int  maxshift,
float *&  output,
MemoryManager memMan 
)

Cross-correlation

Parameters
[in]XInput vector
[in]YInput vector
[in]nNumber of elements in input vectors
[out]maxshiftMaximum number of shifts
[in]outputcross-correlation of X and Y

Here is the call graph for this function:

Here is the caller graph for this function:

void clXCorr ( double *  X,
double *  Y,
unsigned int  n,
int  maxshift,
double *&  output,
MemoryManager memMan 
)

Cross-correlation

Parameters
[in]XInput vector
[in]YInput vector
[in]nNumber of elements in input vectors
[out]maxshiftMaximum number of shifts
[in]outputcross-correlation of X and Y

Here is the call graph for this function:

Variable Documentation