16#ifndef ALICEO2_MATHUTILS_CHEBYSHEV3DCALC_H_
17#define ALICEO2_MATHUTILS_CHEBYSHEV3DCALC_H_
27#define _INC_CREATION_Chebyshev3D_
59 void Print(
const Option_t* opt =
"")
const override;
72#ifdef _INC_CREATION_Chebyshev3D_
75 void saveData(
const char* outfile, Bool_t append = kFALSE)
const;
92 return mNumberOfCoefficients;
97 return (Int_t)mNumberOfColumns;
102 return (Int_t)mNumberOfRows;
107 return (Int_t)mNumberOfElementsBound2D;
114 return mNumberOfColumnsAtRow;
119 return mColumnAtRowBeginning;
138 return mCoefficientBound2D0;
143 return mCoefficientBound2D1;
147 void Clear(
const Option_t* option =
"")
override;
162 return mCoefficients;
170 Double_t
Eval(
const Double_t* par)
const;
173 Int_t mNumberOfCoefficients;
175 Int_t mNumberOfColumns;
176 Int_t mNumberOfElementsBound2D;
180 mNumberOfColumnsAtRow;
181 UShort_t* mColumnAtRowBeginning;
183 UShort_t* mCoefficientBound2D0;
186 UShort_t* mCoefficientBound2D1;
190 Float_t* mTemporaryCoefficients2D;
191 Float_t* mTemporaryCoefficients1D;
208 for (
int i = ncf;
i--;) {
220 for (
int id0 = mNumberOfRows; id0--;) {
221 int nCLoc = mNumberOfColumnsAtRow[id0];
222 int col0 = mColumnAtRowBeginning[id0];
223 for (
int id1 = nCLoc; id1--;) {
225 mTemporaryCoefficients2D[id1] =
chebyshevEvaluation1D(par[2], mCoefficients + mCoefficientBound2D1[
id], mCoefficientBound2D0[
id]);
236 for (
int id0 = mNumberOfRows; id0--;) {
237 int nCLoc = mNumberOfColumnsAtRow[id0];
238 int col0 = mColumnAtRowBeginning[id0];
239 for (
int id1 = nCLoc; id1--;) {
241 mTemporaryCoefficients2D[id1] =
chebyshevEvaluation1D(par[2], mCoefficients + mCoefficientBound2D1[
id], mCoefficientBound2D0[
id]);
const GPUTPCGMMerger::trackCluster & b1
Float_t Eval(const Float_t *par) const
Float_t getPrecision() const
void Print(const Option_t *opt="") const override
Prints info.
static Float_t chebyshevEvaluation1Derivative2(Float_t x, const Float_t *array, int ncf)
Evaluates 1D Chebyshev parameterization's 2nd derivative. x is the argument mapped to [-1:1] interval...
void Clear(const Option_t *option="") override
Deletes all dynamically allocated structures.
UShort_t * getNumberOfColumnsAtRow() const
UShort_t * getColAtRowBg() const
Chebyshev3DCalc & operator=(const Chebyshev3DCalc &rhs)
Assignment operator.
Float_t evaluateDerivative(int dim, const Float_t *par) const
void saveData(const char *outfile, Bool_t append=kFALSE) const
Writes coefficients data to output text file, optionally appending on the end of existing file.
static Float_t chebyshevEvaluation1D(Float_t x, const Float_t *array, int ncf)
Evaluates 1D Chebyshev parameterization. x is the argument mapped to [-1:1] interval.
void loadData(FILE *stream)
Loads coefficients from the stream.
UShort_t * getCoefficientBound2D0() const
void saveData(FILE *stream=stdout) const
Float_t evaluateDerivative2(int dim1, int dim2, const Float_t *par) const
static Float_t chebyshevEvaluation1Derivative(Float_t x, const Float_t *array, int ncf)
Evaluates 1D Chebyshev parameterization's derivative. x is the argument mapped to [-1:1] interval.
Int_t getMaxColumnsAtRow() const
void initializeElementBound2D(int ne)
Sets maximum number of significant coefficients for given row/column of coefficients 3D matrix.
static void readLine(TString &str, FILE *stream)
Reads single line from the stream, skipping empty and commented lines. EOF is not expected.
~Chebyshev3DCalc() override
Default destructor.
Float_t * getCoefficients() const
void initializeRows(int nr)
Sets maximum number of significant rows in the coefficients matrix.
Int_t getNumberOfColumns() const
UShort_t * getCoefficientBound2D1() const
Int_t getNumberOfElementsBound2D() const
void initializeCoefficients(int nc)
Sets total number of significant coefficients.
Chebyshev3DCalc()
Default constructor.
Int_t getNumberOfRows() const
void setPrecision(Float_t prc=1e-6)
Sets requested precision.
Int_t getNumberOfCoefficients() const
void initializeColumns(int nc)
Sets maximum number of significant columns in the coefficients matrix.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...