cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.3
A generic central exclusive processes event generator
Loading...
Searching...
No Matches
GridHandler< D, N > Class Template Reference

A generic class for \(\mathbb{R}^D\mapsto\mathbb{R}^N\) grid interpolation. More...

#include <CepGen/Utils/GridHandler.h>

+ Inheritance diagram for GridHandler< D, N >:

Public Types

typedef std::vector< double > coord_t
 Coordinates container.
 
typedef std::array< double, N > values_t
 Value(s) at a given coordinate.
 

Public Member Functions

 GridHandler (const GridType &grid_type)
 Build a grid interpolator from a grid type.
 
virtual ~GridHandler ()=default
 
values_t eval (coord_t in_coords) const
 Interpolate a point to a given coordinate.
 
void insert (coord_t coord, values_t value)
 Insert a new value in the grid.
 
std::map< coord_t, values_tvalues () const
 List of values in the grid.
 
void initialise ()
 Initialise the grid and all useful interpolators/accelerators.
 
std::array< Limits, D > boundaries () const
 Grid boundaries (collection of (min,max))
 
std::array< double, D > min () const
 Lowest bound of the grid coordinates.
 
std::array< double, D > max () const
 Highest bound of the grid coordinates.
 

Protected Attributes

const GridType grid_type_
 Type of interpolation for the grid members.
 
std::map< coord_t, values_tvalues_raw_
 List of coordinates and associated value(s) in the grid Grid interpolation accelerator.
 
std::vector< std::unique_ptr< gsl_interp_accel, void(*)(gsl_interp_accel *)> > accel_
 
std::vector< std::unique_ptr< gsl_spline, void(*)(gsl_spline *)> > splines_1d_
 Splines for linear interpolations.
 
std::array< coord_t, D > coords_
 Coordinates building up the grid.
 
std::array< std::unique_ptr< double[]>, N > values_
 Values for all points in the grid.
 

Detailed Description

template<size_t D, size_t N = 1>
class cepgen::GridHandler< D, N >
Template Parameters
DNumber of variables in the grid (dimension)
NNumber of values handled per point

Definition at line 44 of file GridHandler.h.

Member Typedef Documentation

◆ coord_t

template<size_t D, size_t N = 1>
typedef std::vector<double> coord_t

Definition at line 46 of file GridHandler.h.

◆ values_t

template<size_t D, size_t N = 1>
typedef std::array<double, N> values_t

Definition at line 47 of file GridHandler.h.

Constructor & Destructor Documentation

◆ GridHandler()

template<size_t D, size_t N>
GridHandler ( const GridType grid_type)
explicit

Definition at line 31 of file GridHandler.cpp.

◆ ~GridHandler()

template<size_t D, size_t N = 1>
virtual ~GridHandler ( )
virtualdefault

Member Function Documentation

◆ boundaries()

template<size_t D, size_t N>
std::array< Limits, D > boundaries

Definition at line 268 of file GridHandler.cpp.

◆ eval()

template<size_t D, size_t N>
GridHandler< D, N >::values_t eval ( coord_t  in_coords) const

Definition at line 37 of file GridHandler.cpp.

◆ initialise()

template<size_t D, size_t N>
void initialise

Definition at line 150 of file GridHandler.cpp.

◆ insert()

template<size_t D, size_t N>
void insert ( coord_t  coord,
values_t  value 
)

Definition at line 129 of file GridHandler.cpp.

◆ max()

template<size_t D, size_t N>
std::array< double, D > max

Definition at line 288 of file GridHandler.cpp.

◆ min()

template<size_t D, size_t N>
std::array< double, D > min

Definition at line 277 of file GridHandler.cpp.

◆ values()

template<size_t D, size_t N = 1>
std::map< coord_t, values_t > values ( ) const

Definition at line 56 of file GridHandler.h.

Member Data Documentation

◆ accel_

template<size_t D, size_t N = 1>
std::vector<std::unique_ptr<gsl_interp_accel, void (*)(gsl_interp_accel*)> > accel_
protected

Definition at line 67 of file GridHandler.h.

◆ coords_

template<size_t D, size_t N = 1>
std::array<coord_t, D> coords_
protected

Definition at line 73 of file GridHandler.h.

◆ grid_type_

template<size_t D, size_t N = 1>
const GridType grid_type_
protected

Definition at line 64 of file GridHandler.h.

◆ splines_1d_

template<size_t D, size_t N = 1>
std::vector<std::unique_ptr<gsl_spline, void (*)(gsl_spline*)> > splines_1d_
protected

Definition at line 68 of file GridHandler.h.

◆ values_

template<size_t D, size_t N = 1>
std::array<std::unique_ptr<double[]>, N> values_
protected

Definition at line 74 of file GridHandler.h.

◆ values_raw_

template<size_t D, size_t N = 1>
std::map<coord_t, values_t> values_raw_
protected

Definition at line 65 of file GridHandler.h.