libBioLCCC
Loading...
Searching...
No Matches
auxiliary.h
1#ifndef AUXILIARY_H
2#define AUXILIARY_H
3
4namespace BioLCCC
5{
6
8
12void fitSpline(const double *x, const double *y, const int n, double * y2);
13
15
20double calculateSpline(const double *x, const double *y, const double * y2,
21 const int n, const double x_in);
22
24
28double linInterpolate(const double * x, const double * y, const int n,
29 const double x_in);
30
32
36double polInterpolate(const double * x, const double * y, const int n,
37 const double x_in);
38
40
44double partPolInterpolate(const double * x, const double * y,
45 const int n, const int n_part, const double x_in);
46
48
52void solveMatrixEquation(double * m, double * rhs, const int n);
53
55
59void fitPolynomial(double * x, double * y, const int n);
60
62
66double calculatePolynomial(const double * coeffs, const int n, const double x);
67
68}
69
70#endif
Apart from classes, BioLCCC contains calculation methods and constants.
Definition auxiliary.h:5
double linInterpolate(const double *x, const double *y, const int n, const double x_in)
Calculates the value of a function using a piecewise linear interpolation.
Definition auxiliary.cpp:62
double partPolInterpolate(const double *x, const double *y, const int n, const int n_part, const double x_in)
Calculates the value of a function using a partial polynomial interpolation.
Definition auxiliary.cpp:96
void solveMatrixEquation(double *m, double *rhs, const int n)
Solves a linear matrix equation m * x = rhs for square matrix m of size nxn.
Definition auxiliary.cpp:134
double calculatePolynomial(const double *coeffs, const int n, const double x)
Calculates the value of a polynomial of (n-1)th power at point x.
Definition auxiliary.cpp:225
void fitSpline(const double *x, const double *y, const int n, double *y2)
Calculates the second derivatives of a function.
Definition auxiliary.cpp:8
double calculateSpline(const double *x, const double *y, const double *y2, const int n, const double x_in)
Calculates the value of a function using the cubic spline interpolation.
Definition auxiliary.cpp:37
double polInterpolate(const double *x, const double *y, const int n, const double x_in)
Calculates the value of a function using a polynomial interpolation.
Definition auxiliary.cpp:75
void fitPolynomial(double *x, double *y, const int n)
Constructs a polynomial whose values at n points x equals y.
Definition auxiliary.cpp:210