![]() |
Project
|
#include <IrregularSpline2D3D.h>
Inherits o2::gpu::FlatObject.
Public Member Functions | |
IrregularSpline2D3D () | |
_____________ Constructors / destructors __________________________ | |
IrregularSpline2D3D (const IrregularSpline2D3D &)=delete | |
Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead. | |
IrregularSpline2D3D & | operator= (const IrregularSpline2D3D &)=delete |
Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead. | |
~IrregularSpline2D3D ()=default | |
Destructor. | |
void | cloneFromObject (const IrregularSpline2D3D &obj, char *newFlatBufferPtr) |
Construction interface. | |
void | destroy () |
void | moveBufferTo (char *newBufferPtr) |
void | setActualBufferAddress (char *actualFlatBufferPtr) |
Moving the class with its external buffer to another location. | |
void | setFutureBufferAddress (char *futureFlatBufferPtr) |
void | construct (int32_t numberOfKnotsU, const float knotsU[], int32_t numberOfAxisBinsU, int32_t numberOfKnotsV, const float knotsV[], int32_t numberOfAxisBinsV) |
_______________ Construction interface ________________________ | |
void | constructRegular (int32_t numberOfKnotsU, int32_t numberOfKnotsV) |
Constructor for a regular spline. | |
template<typename T > | |
GPUd () void correctEdges(T *data) const | |
_______________ Main functionality ________________________ | |
template<typename T > | |
GPUd () void getSpline(GPUgeneric() const T *correctedData | |
Get interpolated value for f(u,v) using data array correctedData[getNumberOfKnots()] with corrected edges. | |
float float | GPUgeneric () T &x |
float float | GPUgeneric () T &y |
float float | GPUgeneric () T &z) const |
GPUd () void getSplineVec(const float *correctedData | |
GPUd () int32_t getNumberOfKnots() const | |
Get number total of knots: UxV. | |
GPUd () const IrregularSpline1D &getGridU() const | |
Get 1-D grid for U coordinate. | |
GPUd () const IrregularSpline1D &getGridV() const | |
Get 1-D grid for V coordinate. | |
GPUd () const IrregularSpline1D &getGrid(int32_t uv) const | |
Get 1-D grid for U or V coordinate. | |
GPUd () void getKnotUV(int32_t iKnot | |
Get u,v of i-th knot. | |
size_t | getFlatBufferSize () const |
Get size of the mFlatBuffer data. | |
const char * | getFlatBufferPtr () const |
Get pointer to the flat buffer. | |
size_t | getGridUOffset () const |
technical stuff | |
size_t | getGridVOffset () const |
Get offset of GridV flat data in the flat buffer. | |
void | print () const |
Print method. | |
char * | releaseInternalBuffer () |
Making the data buffer external. | |
![]() | |
FlatObject ()=default | |
_____________ Constructors / destructors __________________________ | |
~FlatObject () | |
FlatObject (const FlatObject &)=delete | |
FlatObject & | operator= (const FlatObject &)=delete |
void | destroy () |
_______________ Utilities _______________________________________________ | |
size_t | getFlatBufferSize () const |
Gives size of the flat buffer. | |
const char * | getFlatBufferPtr () const |
Gives pointer to the flat buffer. | |
bool | isConstructed () const |
Tells if the object is constructed. | |
bool | isBufferInternal () const |
Tells if the buffer is internal. | |
void | adoptInternalBuffer (char *buf) |
void | clearInternalBufferPtr () |
void | printC () const |
Print the content of the flat buffer. | |
Static Public Member Functions | |
static constexpr size_t | getClassAlignmentBytes () |
Get minimal required alignment for the class. | |
static constexpr size_t | getBufferAlignmentBytes () |
Get minimal required alignment for the flat buffer. | |
static constexpr size_t | getDataAlignmentBytes () |
Get minimal required alignment for the spline data. | |
static constexpr size_t | getBufferAlignmentBytes () |
_____________ FlatObject functionality, see FlatObject class for description ____________ | |
static constexpr size_t | getClassAlignmentBytes () |
_____________ Memory alignment __________________________ | |
![]() | |
static size_t | alignSize (size_t sizeBytes, size_t alignmentBytes) |
_______________ Generic utilities _______________________________________________ | |
template<class T > | |
static T * | relocatePointer (const char *oldBase, char *newBase, const T *ptr) |
Relocates a pointer inside a buffer to the new buffer address. | |
template<class T , class TFile > | |
static int32_t | writeToFile (T &obj, TFile &outf, const char *name) |
write a child class object to the file | |
template<class T , class TFile > | |
static T * | readFromFile (TFile &inpf, const char *name) |
read a child class object from the file | |
template<class T > | |
static std::string | stressTest (T &obj) |
Test the flat object functionality for a child class T. | |
Public Attributes | |
float | u |
float float | v |
float float float & | x |
float float float float & | y |
float float float float float &z | const |
float & | u |
float float &v | const |
Additional Inherited Members | |
![]() | |
enum | ConstructionState : uint32_t { NotConstructed = 0x0 , Constructed = 0x1 , InProgress = 0x2 } |
GPUCA_GPUCODE. More... | |
![]() | |
void | startConstruction () |
_____________ Construction _________ | |
void | finishConstruction (int32_t flatBufferSize) |
void | cloneFromObject (const FlatObject &obj, char *newFlatBufferPtr) |
char * | releaseInternalBuffer () |
_____________ Methods for making the data buffer external __________________________ | |
void | moveBufferTo (char *newBufferPtr) |
void | setActualBufferAddress (char *actualFlatBufferPtr) |
_____________ Methods for moving the class with its external buffer to another location __________________________ | |
void | setFutureBufferAddress (char *futureFlatBufferPtr) |
ClassDefNV (FlatObject, 1) | |
Pointer to the flat buffer. | |
![]() | |
static constexpr size_t | getClassAlignmentBytes () |
_____________ Memory alignment __________________________ | |
static constexpr size_t | getBufferAlignmentBytes () |
Gives minimal alignment in bytes required for the flat buffer. | |
![]() | |
int32_t | mFlatBufferSize = 0 |
size of the flat buffer | |
uint32_t | mConstructionMask = ConstructionState::NotConstructed |
mask for constructed object members, first two bytes are used by this class | |
char * | mFlatBufferContainer = nullptr |
char * | mFlatBufferPtr = nullptr |
The IrregularSpline2D3D class represents twoo-dimensional spline interpolation on nonunifom (irregular) grid.
The class is flat C structure. No virtual methods, no ROOT types are used. It is designed for spline parameterisation of TPC transformation.
The spline interpolates a generic function F:[u,v)->(x,y,z), where u,v belong to [0,1]x[0,1]
It is an extension of IrregularSpline1D class, see IrregularSpline1D.h for more details.
Important: – The number of knots and their positions may change during initialisation – Don't forget to call correctEdges() for the array of F values (see IrregularSpline1D.h )
Example of creating a spline:
const int32_t nKnotsU=5; const int32_t nKnotsV=6; float knotsU[nKnotsU] = {0., 0.25, 0.5, 0.7, 1.}; float knotsV[nKnotsV] = {0., 0.2, 0.3, 0.45, 0.8, 1.}; IrregularSpline2D3D spline(nKnotsU, knotsU, 4, nKnotsV, knotsV, 10 ); float f[nKnotsU*nKnotsV] = { 3.5, 2.0, 1.4, 3.8, 2.3, .... }; spline.correctEdges( f ); spline.getSpline( f, 0., 0. ); // == 3.5 spline.getSpline( f, 0.1, 0.32 ); // == some interpolated value
Definition at line 64 of file IrregularSpline2D3D.h.
IrregularSpline2D3D::IrregularSpline2D3D | ( | ) |
_____________ Constructors / destructors __________________________
Default constructor. Creates an empty uninitialised object
Default constructor. Creates an empty uninitialised object
Definition at line 26 of file IrregularSpline2D3D.cxx.
|
delete |
Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead.
|
default |
Destructor.
void IrregularSpline2D3D::cloneFromObject | ( | const IrregularSpline2D3D & | obj, |
char * | newFlatBufferPtr | ||
) |
Construction interface.
See FlatObject for description
Definition at line 39 of file IrregularSpline2D3D.cxx.
void IrregularSpline2D3D::construct | ( | int32_t | numberOfKnotsU, |
const float | knotsU[], | ||
int32_t | numberOfAxisBinsU, | ||
int32_t | numberOfKnotsV, | ||
const float | knotsV[], | ||
int32_t | numberOfAxisBinsV | ||
) |
_______________ Construction interface ________________________
Constructor
Number of knots created and their values may differ from the input values:
numberOfKnotsU | U axis: Number of knots in knots[] array |
knotsU | U axis: Array of knots. |
numberOfAxisBinsU | U axis: Number of axis bins to map U coordinate to an appropriate [knot(i),knot(i+1)] interval. The knot positions have a "granularity" of 1./numberOfAxisBins |
numberOfKnotsV | V axis: Number of knots in knots[] array |
knotsV | V axis: Array of knots. |
numberOfAxisBinsV | V axis: Number of axis bins to map U coordinate to an appropriate [knot(i),knot(i+1)] interval. The knot positions have a "granularity" of 1./numberOfAxisBins |
Constructor
Number of knots created and their values may differ from the input values:
numberOfKnotsU | U axis: Number of knots in knots[] array |
knotsU | U axis: Array of knots. |
numberOfAxisBinsU | U axis: Number of axis bins to map U coordinate to an appropriate [knot(i),knot(i+1)] interval. The knot positions have a "granularity" of 1./numberOfAxisBins |
numberOfKnotsV | V axis: Number of knots in knots[] array |
knotsV | V axis: Array of knots. |
numberOfAxisBinsV | V axis: Number of axis bins to map U coordinate to an appropriate [knot(i),knot(i+1)] interval. The knot positions have a "granularity" of 1./numberOfAxisBins |
Definition at line 84 of file IrregularSpline2D3D.cxx.
void IrregularSpline2D3D::constructRegular | ( | int32_t | numberOfKnotsU, |
int32_t | numberOfKnotsV | ||
) |
Constructor for a regular spline.
Constructor for a regular spline
numberOfKnotsU | U axis: Number of knots in knots[] array |
numberOfKnotsV | V axis: Number of knots in knots[] array |
Definition at line 120 of file IrregularSpline2D3D.cxx.
void IrregularSpline2D3D::destroy | ( | ) |
See FlatObject for description
Definition at line 31 of file IrregularSpline2D3D.cxx.
|
inlinestaticconstexpr |
_____________ FlatObject functionality, see FlatObject class for description ____________
Memory alignment
Definition at line 197 of file FlatObject.h.
|
inlinestaticconstexpr |
Get minimal required alignment for the flat buffer.
Definition at line 173 of file IrregularSpline2D3D.h.
|
inlinestaticconstexpr |
_____________ Memory alignment __________________________
Gives minimal alignment in bytes required for the class object
Definition at line 194 of file FlatObject.h.
|
inlinestaticconstexpr |
Get minimal required alignment for the class.
Definition at line 170 of file IrregularSpline2D3D.h.
|
inlinestaticconstexpr |
Get minimal required alignment for the spline data.
Definition at line 176 of file IrregularSpline2D3D.h.
Get pointer to the flat buffer.
Definition at line 167 of file IrregularSpline2D3D.h.
|
inline |
Get size of the mFlatBuffer data.
Definition at line 164 of file IrregularSpline2D3D.h.
|
inline |
technical stuff
Get offset of GridU flat data in the flat buffer
Definition at line 181 of file IrregularSpline2D3D.h.
|
inline |
Get offset of GridV flat data in the flat buffer.
Definition at line 184 of file IrregularSpline2D3D.h.
|
inline |
Get 1-D grid for U or V coordinate.
Definition at line 158 of file IrregularSpline2D3D.h.
|
inline |
Get 1-D grid for U coordinate.
Definition at line 152 of file IrregularSpline2D3D.h.
|
inline |
Get 1-D grid for V coordinate.
Definition at line 155 of file IrregularSpline2D3D.h.
|
inline |
Get number total of knots: UxV.
Definition at line 149 of file IrregularSpline2D3D.h.
o2::gpu::IrregularSpline2D3D::GPUd | ( | ) | const |
_______________ Main functionality ________________________
Correction of data values at edge knots.
It is needed for the fast spline mathematics to work correctly. See explanation in IrregularSpline1D.h header
data | array of function values. It has the size of getNumberOfKnots() |
o2::gpu::IrregularSpline2D3D::GPUd | ( | ) |
Get u,v of i-th knot.
o2::gpu::IrregularSpline2D3D::GPUd | ( | ) | const |
Get interpolated value for f(u,v) using data array correctedData[getNumberOfKnots()] with corrected edges.
o2::gpu::IrregularSpline2D3D::GPUd | ( | ) | const |
Same as getSpline, but using vectorized calculation.
correctedData | should be at least 128-bit aligned |
float float o2::gpu::IrregularSpline2D3D::GPUgeneric | ( | ) | & |
float float o2::gpu::IrregularSpline2D3D::GPUgeneric | ( | ) | & |
float float o2::gpu::IrregularSpline2D3D::GPUgeneric | ( | ) | const & |
See FlatObject for description
Definition at line 54 of file IrregularSpline2D3D.cxx.
|
delete |
Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead.
void IrregularSpline2D3D::print | ( | ) | const |
Print method.
Definition at line 140 of file IrregularSpline2D3D.cxx.
|
inline |
Making the data buffer external.
Definition at line 220 of file FlatObject.h.
Moving the class with its external buffer to another location.
See FlatObject for description
Definition at line 61 of file IrregularSpline2D3D.cxx.
See FlatObject for description
Definition at line 70 of file IrregularSpline2D3D.cxx.
float float float float float& z o2::gpu::IrregularSpline2D3D::const |
Definition at line 146 of file IrregularSpline2D3D.h.
float float& v o2::gpu::IrregularSpline2D3D::const |
Definition at line 161 of file IrregularSpline2D3D.h.
float o2::gpu::IrregularSpline2D3D::u |
Definition at line 142 of file IrregularSpline2D3D.h.
float& o2::gpu::IrregularSpline2D3D::u |
Definition at line 161 of file IrregularSpline2D3D.h.
float float o2::gpu::IrregularSpline2D3D::v |
Definition at line 142 of file IrregularSpline2D3D.h.
float float float& o2::gpu::IrregularSpline2D3D::x |
Definition at line 146 of file IrregularSpline2D3D.h.
float float float float& o2::gpu::IrregularSpline2D3D::y |
Definition at line 146 of file IrregularSpline2D3D.h.