#include "clizFunctions.h"
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 |
void check_heap | ( | char * | file, |
int | line | ||
) |
float* clAbs | ( | float | arr[], |
uint32_t | n | ||
) |
Changes all values of an array to their absolute values
[in,out] | arr | Array to be converted to abs(arr) |
[in] | n | Number of values to be converted |
int clBinomial | ( | int | n, |
int | k | ||
) |
Binomial coefficient Number of combinations when choosing k elements from an n elements pool
[in] | n | Number of elements in pool |
[in] | k | number of chosen elements |
|
inline |
Approximation of error function by Abramowitz and Stegun
[in] | x | Input |
|
inline |
Approximation of error function by Abramowitz and Stegun
[in] | x | Input |
|
inline |
Approximation of error function by Abramowitz and Stegun
[in] | x | Input |
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)
[in] | arr | Array to be searched |
[in] | n | Up to which index the array should be searched |
[out] | output | Array to hold the indices of the highest values |
[in] | numindices | How many indices should be written to output |
void clFindLowestIndices | ( | float | arr[], |
uint32_t | n, | ||
uint32_t | output[], | ||
uint32_t | numindices, | ||
MemoryManager & | memMan | ||
) |
Writes the indices of the lowest values in output
[in] | arr | Array to be searched |
[in] | n | Up to which index the array should be searched |
[out] | output | Array to hold the indices of the lowest values |
[in] | numindices | How many indices should be written to output |
void clHaarWaveDecWithOffset | ( | float | spikes[], |
unsigned int | size, | ||
uint8_t | scales, | ||
float | output[], | ||
uint32_t | offset, | ||
MemoryManager & | memMan | ||
) |
Haar wavelet decomposition
[in] | spikes | Array of data points to be decomposed |
[in] | size | Number of data points |
[in] | scales | How deep the decomposition goes before plugging |
[out] | output | Store for the wavelet coefficients |
[in] | offset | Where in the output array to start storing the wavelet coefficients |
float clKSTest | ( | float | arr[], |
uint32_t | n, | ||
MemoryManager & | memMan | ||
) |
Lilliefors modification of the Kolmogorov-Smirnov (KS) test for normality
[in] | arr | Input array |
[in] | n | Up to which index deviation from normality should be calculated. |
int clMax | ( | int | a, |
int | b | ||
) |
Max Returns the bigger value
[in] | a | value |
[in] | b | value |
uint32_t clMaxAbsIndex | ( | float | arr[], |
uint32_t | begin, | ||
uint32_t | end | ||
) |
Returns the index of the absolute maximum value
[in] | arr | Array to be searched |
[in] | begin | Where the search starts |
[in] | end | Where the search ends |
uint32_t clMaxIndex | ( | float | arr[], |
uint32_t | begin, | ||
uint32_t | end | ||
) |
Returns the index of the maximum value
[in] | arr | Array to be searched |
[in] | begin | Where the search starts |
[in] | end | Where the search ends |
float clMean | ( | float | arr[], |
uint32_t | n | ||
) |
Mean
[in] | arr | Array from which the mean is calculated |
[in] | n | Number of values from which the mean is calculated |
double clMean | ( | double | arr[], |
uint32_t | n | ||
) |
Mean
[in] | arr | Array from which the mean is calculated |
[in] | n | Number 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
[in,out] | vec | Array to be sorted |
[in] | n | Number of values to be sorted |
float clMedian | ( | unsigned int | vec[], |
int | n | ||
) |
Median based on Quicksort Only correct for odd numbers of n
[in,out] | vec | Array to be sorted |
[in] | n | Number of values to be sorted |
uint32_t clMinIndex | ( | float | arr[], |
uint32_t | begin, | ||
uint32_t | end | ||
) |
Returns the index of the minimum value
[in] | arr | Array to be searched |
[in] | begin | Where the search starts |
[in] | end | Where the search ends |
float clSign | ( | float | x | ) |
Signum Returns 1 if x >= 0 and -1 otherwise
[in] | x | value |
|
inline |
Quicksort based on Sedgewick, R. (1978) "Implementing Quicksort Programs"
[in,out] | vec | Array to be sorted |
[in] | n | Number of values to be sorted |
void clSort | ( | unsigned int | vec[], |
int | n | ||
) |
Quicksort based on Sedgewick, R. (1978) "Implementing Quicksort Programs"
[in,out] | vec | Array to be sorted |
[in] | n | Number 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.
[in,out] | vec | Array to be sorted |
[in,out] | vec2 | Array to be sorted in the same was as vec |
[in] | n | Number of values to be sorted |
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.
[in,out] | vec | Array to be sorted |
[in,out] | vec2 | Array to be sorted in the same was as vec |
[in] | n | Number 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.
[in,out] | vec | Array to be sorted |
[in,out] | vec2 | Array to be sorted in the same was as vec |
[in] | n | Number 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.
[in] | y | y values of the data points |
[in] | n | Up to which index y2 should be calculated |
[out] | y2 | Second derivatives of the interpolating 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.
[in] | y | y values of the data points |
[in] | y2 | Second derivatives of the interpolating function |
[in] | x | x value of the point to be interpolated |
float clStd | ( | float | arr[], |
uint32_t | n | ||
) |
Standard deviation
[in] | arr | Array from which the std is calculated |
[in] | n | Number of values from which the std is calculated |
|
inline |
Standard deviation with mean as argument (reduced computation compared to clStd if the mean was already calculated)
[in] | arr | Array from which the std is calculated |
[in] | n | Number of values from which the std is calculated |
[in] | mean | Mean to use to calculate the std |
void clXCorr | ( | float * | X, |
float * | Y, | ||
unsigned int | n, | ||
int | maxshift, | ||
float *& | output, | ||
MemoryManager & | memMan | ||
) |
Cross-correlation
[in] | X | Input vector |
[in] | Y | Input vector |
[in] | n | Number of elements in input vectors |
[out] | maxshift | Maximum number of shifts |
[in] | output | cross-correlation of X and Y |
void clXCorr | ( | double * | X, |
double * | Y, | ||
unsigned int | n, | ||
int | maxshift, | ||
double *& | output, | ||
MemoryManager & | memMan | ||
) |
Cross-correlation
[in] | X | Input vector |
[in] | Y | Input vector |
[in] | n | Number of elements in input vectors |
[out] | maxshift | Maximum number of shifts |
[in] | output | cross-correlation of X and Y |
GlobalMemoryManager gMemMan |