cepgen is hosted by Hepforge, IPPP Durham
CepGen N/A
Central exclusive processes event generator
GridHandler< D, N > Class Template Reference

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

#include <include/CepGen/Utils/GridHandler.h>

+ Inheritance diagram for GridHandler< D, N >:

Public Types

using coord_t = std::vector<double>
 Coordinates container.
 
using values_t = std::array<double, N>
 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 (const coord_t &in_coords) const
 Interpolate a point to a given coordinate.
 
void insert (const 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 *)> > accelerators_
 
std::vector< std::unique_ptr< gsl_spline, void(*)(gsl_spline *)> > splines_1d_
 Splines for linear interpolations.
 
std::array< coord_t, D > coordinates_
 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 43 of file GridHandler.h.

Member Typedef Documentation

◆ coord_t

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

Definition at line 48 of file GridHandler.h.

◆ values_t

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

Definition at line 49 of file GridHandler.h.

Constructor & Destructor Documentation

◆ GridHandler()

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

◆ ~GridHandler()

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

Member Function Documentation

◆ boundaries()

template<size_t D, size_t N = 1>
std::array< Limits, D > boundaries ( ) const

◆ eval()

template<size_t D, size_t N = 1>
values_t eval ( const coord_t & in_coords) const

◆ initialise()

template<size_t D, size_t N = 1>
void initialise ( )

◆ insert()

template<size_t D, size_t N = 1>
void insert ( const coord_t & coord,
values_t value )

◆ max()

template<size_t D, size_t N = 1>
std::array< double, D > max ( ) const

◆ min()

template<size_t D, size_t N = 1>
std::array< double, D > min ( ) const

◆ values()

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

Definition at line 54 of file GridHandler.h.

Member Data Documentation

◆ accelerators_

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

Definition at line 65 of file GridHandler.h.

◆ coordinates_

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

Definition at line 71 of file GridHandler.h.

◆ grid_type_

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

Definition at line 62 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 66 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 72 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 63 of file GridHandler.h.