Project
Loading...
Searching...
No Matches
o2::gpu::Spline< DataT, XdimT, YdimT > Class Template Reference

#include <Spline.h>

Inherits o2::gpu::SplineSpec< DataT, XdimT, YdimT, SpecT >.

Public Types

typedef TVeryBase::SafetyLevel SafetyLevel
 
typedef TVeryBase::Knot Knot
 

Public Member Functions

Splineoperator= (const Spline &v)
 Assignment operator.
 
 ClassDefNV (Spline, 0)
 

Static Public Member Functions

static SplinereadFromFile (TFile &inpf, const char *name)
 read a class object from the file
 

Detailed Description

template<typename DataT, int32_t XdimT = 0, int32_t YdimT = 0>
class o2::gpu::Spline< DataT, XdimT, YdimT >

The Spline class performs a cubic spline interpolation on an two-dimensional nonunifom grid. The class is an extension of the Spline1D class. See Spline1D.h for more details.

The spline S(x) approximates a function F(x):R^n->R^m, with multi-dimensional domain and multi-dimensional codomain. x belongs to [xmin,xmax].

— Example of creating a spline —

constexpr int32_t nDimX = 2, nDimY = 1; int32_t nKnots[nDimX] = {2, 3}; // 2 x 3 knots int32_t knotsU1[] = {0, 1}; // relative knot positions int32_t knotsU2[] = {0, 2, 5}; int32_t *knotsU[nDimX] = {knotsU1, knotsU2};

o2::gpu::Spline<float, nDimX, nDimY> spline(nKnots, knotsU);

auto F = [&](const double x[], double f[]) { f[0] = 1.f + x[0] + x[1] * x[1]; // F(x) }; double xMin[nDimX] = {0.f, 0.f}; double xMax[nDimX] = {1.f, 1.f}; spline.approximateFunction( xMin, xMax, F); // initialize spline to approximate F on [0., 1.]x[0., 1.] area

float x[] = {.1, .3}; float S = spline.interpolate(x); // interpolated value at (.1,.3)

– another way to create of the spline is:

o2::gpu::Spline<float> spline(nDimX, nDimY, nKnots, knotsU ); spline.interpolate(x, &S);

— See also SplineHelper::test(); ==================================================================================================

Declare the Spline class as a template with two optional parameters.

Class specializations depend on the XdimT, YdimT values. They can be found in SplineSpecs.h

Parameters
DataTdata type: float or double
XdimTXdimT > 0 : the number of X dimensions is known at the compile time and is equal to XdimT XdimT = 0 : the number of X dimensions will be set in the runtime XdimT < 0 : the number of X dimensions will be set in the runtime, and it will not exceed abs(XdimT)
YdimTsame for the Y dimensions

Definition at line 77 of file Spline.h.

Member Typedef Documentation

◆ Knot

template<typename DataT , int32_t XdimT = 0, int32_t YdimT = 0>
typedef TVeryBase::Knot o2::gpu::Spline< DataT, XdimT, YdimT >::Knot

Definition at line 85 of file Spline.h.

◆ SafetyLevel

template<typename DataT , int32_t XdimT = 0, int32_t YdimT = 0>
typedef TVeryBase::SafetyLevel o2::gpu::Spline< DataT, XdimT, YdimT >::SafetyLevel

Definition at line 84 of file Spline.h.

Member Function Documentation

◆ ClassDefNV()

template<typename DataT , int32_t XdimT = 0, int32_t YdimT = 0>
o2::gpu::Spline< DataT, XdimT, YdimT >::ClassDefNV ( Spline< DataT, XdimT, YdimT >  ,
 
)

◆ operator=()

template<typename DataT , int32_t XdimT = 0, int32_t YdimT = 0>
Spline & o2::gpu::Spline< DataT, XdimT, YdimT >::operator= ( const Spline< DataT, XdimT, YdimT > &  v)
inline

Assignment operator.

Definition at line 91 of file Spline.h.

◆ readFromFile()

template<typename DataT , int32_t XdimT = 0, int32_t YdimT = 0>
static Spline * o2::gpu::Spline< DataT, XdimT, YdimT >::readFromFile ( TFile &  inpf,
const char name 
)
inlinestatic

read a class object from the file

Definition at line 104 of file Spline.h.


The documentation for this class was generated from the following file: