![]() |
Project
|
#include <Chebyshev3D.h>
Inherits TNamed.
Public Member Functions | |
Chebyshev3D () | |
Chebyshev3D (const Chebyshev3D &src) | |
Chebyshev3D (const char *inpFile) | |
Chebyshev3D (FILE *stream) | |
~Chebyshev3D () override | |
Chebyshev3D & | operator= (const Chebyshev3D &rhs) |
void | Eval (const Float_t *par, Float_t *res) |
Evaluates Chebyshev parameterization for 3d->DimOut function. | |
Float_t | Eval (const Float_t *par, int idim) |
Evaluates Chebyshev parameterization for idim-th output dimension of 3d->DimOut function. | |
void | Eval (const Double_t *par, Double_t *res) |
Evaluates Chebyshev parameterization for 3d->DimOut function. | |
Double_t | Eval (const Double_t *par, int idim) |
Evaluates Chebyshev parameterization for idim-th output dimension of 3d->DimOut function. | |
void | evaluateDerivative (int dimd, const Float_t *par, Float_t *res) |
void | evaluateDerivative2 (int dimd1, int dimd2, const Float_t *par, Float_t *res) |
Float_t | evaluateDerivative (int dimd, const Float_t *par, int idim) |
Float_t | evaluateDerivative2 (int dimd1, int dimd2, const Float_t *par, int idim) |
void | evaluateDerivative3D (const Float_t *par, Float_t dbdr[3][3]) |
Returns the gradient matrix. | |
void | evaluateDerivative3D2 (const Float_t *par, Float_t dbdrdr[3][3][3]) |
Returns the gradient matrix. | |
void | Print (const Option_t *opt="") const override |
Bool_t | isInside (const Float_t *par) const |
Checks if the point is inside of the fitted box. | |
Bool_t | isInside (const Double_t *par) const |
Checks if the point is inside of the fitted box. | |
Chebyshev3DCalc * | getChebyshevCalc (int i) const |
Float_t | getBoundMin (int i) const |
Float_t | getBoundMax (int i) const |
Float_t * | getBoundMin () const |
Float_t * | getBoundMax () const |
Float_t * | getBoundaryMappingScale () const |
Float_t * | getBoundaryMappingOffset () const |
Float_t | getPrecision () const |
void | shiftBound (int id, float dif) |
void | loadData (const char *inpFile) |
void | loadData (FILE *stream) |
Protected Member Functions | |
void | Clear (const Option_t *option="") override |
void | setDimOut (const int d, const float *prec=nullptr) |
void | prepareBoundaries (const Float_t *bmin, const Float_t *bmax) |
Float_t | mapToInternal (Float_t x, Int_t d) const |
Μaps x to [-1:1]. | |
Float_t | mapToExternal (Float_t x, Int_t d) const |
Double_t | mapToInternal (Double_t x, Int_t d) const |
Μaps x to [-1:1]. | |
Double_t | mapToExternal (Double_t x, Int_t d) const |
Chebyshev3D produces the interpolation of the user 3D->NDimOut arbitrary function supplied in "void (*fcn)(float* inp,float* out)" format either in a separate macro file or as a function pointer. Only coefficients needed to guarantee the requested precision are kept. The user-callable methods are: To create the interpolation use: Cheb3D(const char* funName, // name of the file with user function or Cheb3D(void (ptr)(float,float*) // pointer on the user function
Int_t | DimOut dimensionality of the function's output |
Float_t | *bmin lower 3D bounds of interpolation domain |
Float_t | *bmax upper 3D bounds of interpolation domain |
Int_t | *npoints number of points in each of 3 input dimension, defining the interpolation grid |
Float_t | prec=1E-6); requested max.absolute difference between the interpolation and any point on grid To test obtained parameterization use the method TH1* TestRMS(int idim,int npoints = 1000,TH1* histo=0); it will compare the user output of the user function and interpolation for idim-th output dimension and fill the difference in the supplied histogram. If no histogram is supplied, it will be created. To save the interpolation data: saveData(const char* filename, Bool_t append ) write text file with data. If append is kTRUE and the output file already exists, data will be added in the end of the file. Alternatively, saveData(FILE* stream) will write the data to already existing stream. To read back already stored interpolation use either the constructor Chebyshev3D(const char* inpFile); or the default constructor Chebyshev3D() followed by Chebyshev3D::loadData(const char* inpFile); To compute the interpolation use Eval(float* par,float *res) method, with par being 3D vector of arguments (inside the validity region) and res is the array of DimOut elements for the output. If only one component (say, idim-th) of the output is needed, use faster Float_t Eval(Float_t *par,int idim) method void Print(option="") will print the name, the ranges of validity and the absolute precision of the parameterization. Option "l" will also print the information about the number of coefficients for each output dimension. NOTE: during the evaluation no check is done for parameter vector being outside the interpolation region. If there is such a risk, use Bool_t isInside(float *par) method. Chebyshev parameterization is not good for extrapolation! For the properties of Chebyshev parameterization see: H.Wind, CERN EP Internal Report, 81-12/Rev. |
Definition at line 64 of file Chebyshev3D.h.
Chebyshev3D::Chebyshev3D | ( | ) |
Definition at line 37 of file Chebyshev3D.cxx.
Chebyshev3D::Chebyshev3D | ( | const Chebyshev3D & | src | ) |
Definition at line 56 of file Chebyshev3D.cxx.
Chebyshev3D::Chebyshev3D | ( | const char * | inpFile | ) |
Definition at line 85 of file Chebyshev3D.cxx.
Chebyshev3D::Chebyshev3D | ( | FILE * | stream | ) |
Definition at line 105 of file Chebyshev3D.cxx.
|
inlineoverride |
Definition at line 124 of file Chebyshev3D.h.
|
overrideprotected |
Definition at line 291 of file Chebyshev3D.cxx.
|
inline |
Evaluates Chebyshev parameterization for 3d->DimOut function.
Definition at line 304 of file Chebyshev3D.h.
|
inline |
Evaluates Chebyshev parameterization for idim-th output dimension of 3d->DimOut function.
Definition at line 315 of file Chebyshev3D.h.
Evaluates Chebyshev parameterization for 3d->DimOut function.
Definition at line 293 of file Chebyshev3D.h.
Evaluates Chebyshev parameterization for idim-th output dimension of 3d->DimOut function.
Definition at line 324 of file Chebyshev3D.h.
|
inline |
Definition at line 362 of file Chebyshev3D.h.
|
inline |
Evaluates Chebyshev parameterization derivative over dimd dimention for idim-th output dimension of 3d->DimOut function
Definition at line 386 of file Chebyshev3D.h.
|
inline |
Definition at line 373 of file Chebyshev3D.h.
|
inline |
Evaluates Chebyshev parameterization 2ns derivative over dimd1 and dimd2 dimensions for idim-th output dimension of 3d->DimOut function
Definition at line 396 of file Chebyshev3D.h.
|
inline |
Returns the gradient matrix.
Definition at line 333 of file Chebyshev3D.h.
|
inline |
Returns the gradient matrix.
Definition at line 346 of file Chebyshev3D.h.
|
inline |
Definition at line 187 of file Chebyshev3D.h.
|
inline |
Definition at line 182 of file Chebyshev3D.h.
|
inline |
Definition at line 177 of file Chebyshev3D.h.
Definition at line 167 of file Chebyshev3D.h.
|
inline |
Definition at line 172 of file Chebyshev3D.h.
Definition at line 162 of file Chebyshev3D.h.
|
inline |
Definition at line 157 of file Chebyshev3D.h.
|
inline |
Definition at line 192 of file Chebyshev3D.h.
|
inline |
Checks if the point is inside of the fitted box.
Definition at line 282 of file Chebyshev3D.h.
|
inline |
Checks if the point is inside of the fitted box.
Definition at line 271 of file Chebyshev3D.h.
Definition at line 765 of file Chebyshev3D.cxx.
void Chebyshev3D::loadData | ( | FILE * | stream | ) |
Definition at line 775 of file Chebyshev3D.cxx.
|
inlineprotected |
Definition at line 241 of file Chebyshev3D.h.
Definition at line 236 of file Chebyshev3D.h.
|
inlineprotected |
Μaps x to [-1:1].
Definition at line 423 of file Chebyshev3D.h.
Μaps x to [-1:1].
Definition at line 406 of file Chebyshev3D.h.
Chebyshev3D & Chebyshev3D::operator= | ( | const Chebyshev3D & | rhs | ) |
Definition at line 264 of file Chebyshev3D.cxx.
Definition at line 327 of file Chebyshev3D.cxx.
|
override |
Definition at line 310 of file Chebyshev3D.cxx.
Definition at line 826 of file Chebyshev3D.cxx.
Definition at line 842 of file Chebyshev3D.cxx.