17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_Spline1DHelperOld_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_Spline1DHelperOld_H
34template <
typename DataT>
71 double xMin,
double xMax,
72 double x[],
double f[], int32_t nDataPoints);
76 double xMin,
double xMax, std::function<
void(
double x,
double f[])> F,
77 int32_t nAuxiliaryDataPoints = 4);
81 double xMin,
double xMax, std::function<
void(
double x,
double f[])> F,
82 int32_t nAuxiliaryDataPoints = 4);
86 double xMin,
double xMax, std::function<
void(
double x,
double f[])> F);
97 void approximateFunction(DataT* Fparameters,
double xMin,
double xMax, std::function<
void(
double x,
double f[])> F)
const;
129 double& cSl,
double& cDl,
double& cSr,
double& cDr);
132 double& cSl,
double& cDl,
double& cSr,
double& cDr);
135 double& cSl,
double& cDl,
double& cSr,
double& cDr);
138 double& cSl,
double& cDl,
double& cSr,
double& cDr);
141 double& cSl,
double& cDl,
double& cSr,
double& cDr);
143 double& cSl,
double& cDl,
double& cSr,
double& cDr);
148#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE)
150 static int32_t test(const bool draw = 0, const bool drawDataPoints = 1);
155 int32_t storeError(int32_t code,
const char*
msg);
157 std::string mError =
"";
162 int32_t mFdimensions;
163 std::vector<DataPoint> mDataPoints;
164 std::vector<int32_t> mKnotDataPoints;
165 std::vector<double> mLSMmatrixFull;
166 std::vector<double> mLSMmatrixSderivatives;
167 std::vector<double> mLSMmatrixSvalues;
Definition of Spline1D class.
static void getDDDScoefficients(const typename Spline1D< double >::KnotType &knotL, double &cSl, double &cDl, double &cSr, double &cDr)
void bandGauss(double A[], double b[], int32_t n)
_______________ Main functionality ________________________
const char * getLastError() const
Gives error string.
void approximateFunctionClassic(Spline1DContainer< DataT, FlatObject > &spline, double xMin, double xMax, std::function< void(double x, double f[])> F)
Create classic spline parameters for a given input function F.
~Spline1DHelperOld()=default
Destructor.
Spline1DHelperOld()
_____________ Constructors / destructors __________________________
static void getDDScoefficients(const typename Spline1D< double >::KnotType &knotL, double u, double &cSl, double &cDl, double &cSr, double &cDr)
void approximateFunctionGradually(Spline1DContainer< DataT, FlatObject > &spline, double xMin, double xMax, std::function< void(double x, double f[])> F, int32_t nAuxiliaryDataPoints=4)
Create best-fit spline parameters gradually for a given input function F.
static void getDScoefficients(const typename Spline1D< double >::KnotType &knotL, double u, double &cSl, double &cDl, double &cSr, double &cDr)
int32_t getKnotDataPoint(int32_t iknot) const
void copySfromDataPoints(DataT *Fparameters, const double DataPointF[]) const
a tool for the gradual approximation: set spline values S_i at knots == function values
static void getScoefficients(const typename Spline1D< double >::KnotType &knotL, double u, double &cSl, double &cDl, double &cSr, double &cDr)
void approximateDataPoints(Spline1DContainer< DataT, FlatObject > &spline, double xMin, double xMax, double x[], double f[], int32_t nDataPoints)
Create best-fit spline parameters for a given input function F.
const Spline1D< double > & getSpline() const
_______________ Utilities ________________________
static void getDDScoefficientsRight(const typename Spline1D< double >::KnotType &knotL, double &cSl, double &cDl, double &cSr, double &cDr)
Spline1DHelperOld & operator=(const Spline1DHelperOld &)=default
Assignment operator: disabled.
static void getDDScoefficientsLeft(const typename Spline1D< double >::KnotType &knotL, double &cSl, double &cDl, double &cSr, double &cDr)
void approximateDerivatives(DataT *Fparameters, const double DataPointF[]) const
void approximateFunction(Spline1DContainer< DataT, FlatObject > &spline, double xMin, double xMax, std::function< void(double x, double f[])> F, int32_t nAuxiliaryDataPoints=4)
Create best-fit spline parameters for a given input function F.
int32_t getNumberOfDataPoints() const
number of data points
const DataPoint & getDataPoint(int32_t ip) const
int32_t setSpline(const Spline1DContainer< DataT, FlatObject > &spline, int32_t nFdimensions, int32_t nAuxiliaryDataPoints)
_______________ Interface for a step-wise construction of the best-fit spline _______________________...
Spline1DHelperOld(const Spline1DHelperOld &)=default
Copy constructor: disabled.
Forward declaration — specializations below select ClassDefNV based on FlatBase.
GLboolean GLboolean GLboolean b
Helper structure for 1D spline construction.
double cZ0
a coefficient for s'0
double cS1
a coefficient for s1
double cS0
a coefficient for s0
bool isKnot
is the point placed at a knot
int32_t iKnot
index of the left knot of the segment
double cZ1
a coefficient for s'1
uint64_t const void const *restrict const msg