EDepSimInterpolator.hh
Go to the documentation of this file.
1 // * License and Disclaimer *
2 //
3 // MIT License
4 
5 // Copyright (c) 2020 Andrew Cudd
6 
7 // Permission is hereby granted, free of charge, to any person obtaining a
8 // copy of this software and associated documentation files (the "Software"),
9 // to deal in the Software without restriction, including without limitation
10 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 // and/or sell copies of the Software, and to permit persons to whom the
12 // Software is furnished to do so, subject to the following conditions:
13 
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
16 
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 // DEALINGS IN THE SOFTWARE.
24 //
25 // class EDepSim::Interpolator
26 //
27 // Class description:
28 //
29 // Class for routines for interpolating data on a regular grid.
30 //
31 // History:
32 // - 2020.04.14 A.Cudd created
33 // -------------------------------------------------------------------
34 
35 #ifndef EDEPSIMINTERPOLATOR_HH
36 #define EDEPSIMINTERPOLATOR_HH
37 
38 #include <cmath>
39 #include <iostream>
40 #include <vector>
41 
42 namespace EDepSim {class Cubic;}
43 
45 {
46  public:
47  Cubic();
48 
49  double interpolate(
50  const double* point,
51  const std::vector<std::vector<std::vector<double>>>& g,
52  const double* delta, const double* offset) const;
53  double interpolate(
54  double x, double y, double z,
55  const std::vector<std::vector<std::vector<double>>>& g,
56  double hx, double hy, double hz, double xo, double yo, double zo)
57  const;
58 
59  private:
60  double conv_kernel(double s) const;
61 };
62 
63 #endif
static constexpr double g
Definition: Units.h:144
struct vector vector
Construct a module from components.
Definition: TG4HitSegment.h:10
double conv_kernel(double s) const
double interpolate(const double *point, const std::vector< std::vector< std::vector< double >>> &g, const double *delta, const double *offset) const
list x
Definition: train.py:276
static QCString * s
Definition: config.cpp:1042