20void transpone(
double* arr,
unsigned int Nrows,
unsigned int Ncols);
30void invert(
double* arr,
unsigned int Nrows,
unsigned int Ncols);
44double*
mulmat(
const double* matrix0,
47 const double* matrix1,
69 const double* weight);
86 const struct myarr* maxvals,
87 const struct myarr* maxes,
88 const struct myarr* subpos,
104 unsigned int Npoints,
106 const double* weightArr);
115size_t getmaxpos(
const int* array,
size_t ArrayLength);
127void linreg(
const double* xarr,
141int shiftHalf(
size_t value,
size_t ArrayLength);
int shiftHalf(size_t value, size_t ArrayLength)
Shifts a value by half the array length, wrapping around.
Definition: mymath.c:544
void invert(double *arr, unsigned int Nrows, unsigned int Ncols)
Inverts a square matrix in-place.
Definition: mymath.c:85
void transpone(double *arr, unsigned int Nrows, unsigned int Ncols)
Transposes a matrix in-place.
Definition: mymath.c:66
void linreg(const double *xarr, const double *yarr, size_t ArrayLength, double *intercept, double *slope, double *stdev)
Performs simple linear regression on two arrays.
Definition: mymath.c:34
void fitNpeaks(double *intercept, double *slope, unsigned int curPos, const struct myarr *maxvals, const struct myarr *maxes, const struct myarr *subpos, unsigned int npeaks, double SDthreshold)
Fits a line to N peaks in the data, with outlier rejection.
Definition: mymath.c:421
void fastlinreg(double coeffs[2], const double *xmat, unsigned int Npoints, const double *vec, const double *weightArr)
Performs fast weighted linear regression.
Definition: mymath.c:231
double * mulmat(const double *matrix0, unsigned int Nrows, unsigned int Ncols, const double *matrix1, unsigned int Mrows, unsigned int Mcols)
Multiplies two matrices and returns the result as a new matrix.
Definition: mymath.c:136
void matlinreg(double coeffs[2], const double *xmat, unsigned int Nrows, unsigned int Ncols, double *vec, const double *weight)
Performs linear regression on a dataset with optional weighting.
Definition: mymath.c:168
size_t getmaxpos(const int *array, size_t ArrayLength)
Returns the index of the maximum value in an integer array.
Definition: mymath.c:19
A struct to hold an array of integers or an array of doubles, along with the length of the arrays.
Definition: myarr.h:14