GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Private Attributes | List of all members
genie::Interpolator2D Class Reference

A 2D interpolator using the GSL spline type If GSL version is not sufficient, does an inefficient version using TGraph2D. More...

#include <Interpolator2D.h>

Collaboration diagram for genie::Interpolator2D:
Collaboration graph
[legend]

Classes

struct  interp_accel_container
 
struct  spline2d_container
 

Public Member Functions

 Interpolator2D (const size_t &size_x, const double *grid_x, const size_t &size_y, const double *grid_y, const double *knots)
 
 ~Interpolator2D ()
 
double Eval (const double &x, const double &y) const
 
double DerivX (const double &x, const double &y) const
 
double DerivY (const double &x, const double &y) const
 
double DerivXX (const double &x, const double &y) const
 
double DerivXY (const double &x, const double &y) const
 
double DerivYY (const double &x, const double &y) const
 

Private Attributes

spline2d_containerfSpline
 
interp_accel_containerfAcc_x
 
interp_accel_containerfAcc_y
 

Detailed Description

A 2D interpolator using the GSL spline type If GSL version is not sufficient, does an inefficient version using TGraph2D.

Author
Steve Dennis <s.r.dennis liverpool.ac.uk> University of Liverpool
Created:
November, 2017
License:
Copyright (c) 2003-2024, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 27 of file Interpolator2D.h.

Constructor & Destructor Documentation

Interpolator2D::Interpolator2D ( const size_t &  size_x,
const double *  grid_x,
const size_t &  size_y,
const double *  grid_y,
const double *  knots 
)

Definition at line 132 of file Interpolator2D.cxx.

References fSpline, and genie::Interpolator2D::spline2d_container::spl.

135  :
136  fSpline (new spline2d_container()),
137  fAcc_x (NULL),
138  fAcc_y (NULL)
139 {
140  fSpline->spl = new TGraph2D(size_x*size_y);
141  fSpline->spl->SetDirectory(0);
142  size_t iz = 0;
143  for (size_t iy = 0 ; iy < size_y ; iy++) {
144  for (size_t ix = 0 ; ix < size_x ; ix++) {
145  fSpline->spl->SetPoint(iz,grid_x[ix],grid_y[iy],knots[iz]);
146  iz++;
147  }
148  }
149 }
spline2d_container * fSpline
interp_accel_container * fAcc_y
interp_accel_container * fAcc_x
Interpolator2D::~Interpolator2D ( )

Definition at line 151 of file Interpolator2D.cxx.

References fAcc_x, fAcc_y, and fSpline.

152 {
153  if (fSpline) delete fSpline;
154  if (fAcc_x ) delete fAcc_x;
155  if (fAcc_y ) delete fAcc_y;
156 }
spline2d_container * fSpline
interp_accel_container * fAcc_y
interp_accel_container * fAcc_x

Member Function Documentation

double Interpolator2D::DerivX ( const double &  x,
const double &  y 
) const

Definition at line 163 of file Interpolator2D.cxx.

164 {
165  assert(!"Method requires GSL version 2 or higher.");
166  return -999;
167 }
double Interpolator2D::DerivXX ( const double &  x,
const double &  y 
) const

Definition at line 175 of file Interpolator2D.cxx.

176 {
177  assert(!"Method requires GSL version 2 or higher.");
178  return -999;
179 }
double Interpolator2D::DerivXY ( const double &  x,
const double &  y 
) const

Definition at line 181 of file Interpolator2D.cxx.

182 {
183  assert(!"Method requires GSL version 2 or higher.");
184  return -999;
185 }
double Interpolator2D::DerivY ( const double &  x,
const double &  y 
) const

Definition at line 169 of file Interpolator2D.cxx.

170 {
171  assert(!"Method requires GSL version 2 or higher.");
172  return -999;
173 }
double Interpolator2D::DerivYY ( const double &  x,
const double &  y 
) const

Definition at line 187 of file Interpolator2D.cxx.

188 {
189  assert(!"Method requires GSL version 2 or higher.");
190  return -999;
191 }
double Interpolator2D::Eval ( const double &  x,
const double &  y 
) const

Definition at line 158 of file Interpolator2D.cxx.

References fSpline, and genie::Interpolator2D::spline2d_container::spl.

Referenced by genie::GRV98LO::AllPDFs().

159 {
160  return fSpline->spl->Interpolate(x,y);
161 }
spline2d_container * fSpline

Member Data Documentation

interp_accel_container* genie::Interpolator2D::fAcc_x
mutableprivate

Definition at line 49 of file Interpolator2D.h.

Referenced by ~Interpolator2D().

interp_accel_container* genie::Interpolator2D::fAcc_y
mutableprivate

Definition at line 50 of file Interpolator2D.h.

Referenced by ~Interpolator2D().

spline2d_container* genie::Interpolator2D::fSpline
private

Definition at line 46 of file Interpolator2D.h.

Referenced by Eval(), Interpolator2D(), and ~Interpolator2D().


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