GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GBilinear.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GBilinear.hpp - Bilinear interpolator class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2015 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file GBilinear.hpp
23  * @brief Bilinear interpolator class interface definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GBILINEAR_HPP
28 #define GBILINEAR_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GBase.hpp"
33 
34 
35 /***********************************************************************//**
36  * @class GBilinear
37  *
38  * @brief Bilinear interpolator class
39  ***************************************************************************/
40 class GBilinear : public GBase {
41 
42 public:
43  // Constructors and destructors
44  GBilinear(void);
45  GBilinear(const GBilinear& interpolator);
46  virtual ~GBilinear(void);
47 
48  // Operators
49  GBilinear& operator=(const GBilinear& interpolator);
50  double operator()(const double* array);
51 
52  // Methods
53  void clear(void);
54  GBilinear* clone(void) const;
55  std::string classname(void) const;
56  int& index1(void);
57  int& index2(void);
58  int& index3(void);
59  int& index4(void);
60  double& weight1(void);
61  double& weight2(void);
62  double& weight3(void);
63  double& weight4(void);
64  std::string print(const GChatter& chatter = NORMAL) const;
65 
66 private:
67  // Methods
68  void init_members(void);
69  void copy_members(const GBilinear& interpolator);
70  void free_members(void);
71 
72  // Members
73  int m_inx1;
74  int m_inx2;
75  int m_inx3;
76  int m_inx4;
77  double m_wgt1;
78  double m_wgt2;
79  double m_wgt3;
80  double m_wgt4;
81 };
82 
83 
84 /***********************************************************************//**
85  * @brief Return class name
86  *
87  * @return String containing the class name ("GBilinear").
88  ***************************************************************************/
89 inline
90 std::string GBilinear::classname(void) const
91 {
92  return ("GBilinear");
93 }
94 
95 
96 /***********************************************************************//**
97  * @brief Access index 1
98  *
99  * @return Reference to index 1.
100  ***************************************************************************/
101 inline
103 {
104  return (m_inx1);
105 }
106 
107 
108 /***********************************************************************//**
109  * @brief Access index 2
110  *
111  * @return Reference to index 2.
112  ***************************************************************************/
113 inline
115 {
116  return (m_inx2);
117 }
118 
119 
120 /***********************************************************************//**
121  * @brief Access index 3
122  *
123  * @return Reference to index 3.
124  ***************************************************************************/
125 inline
127 {
128  return (m_inx3);
129 }
130 
131 
132 /***********************************************************************//**
133  * @brief Access index 4
134  *
135  * @return Reference to index 4.
136  ***************************************************************************/
137 inline
139 {
140  return (m_inx4);
141 }
142 
143 
144 /***********************************************************************//**
145  * @brief Access weight 1
146  *
147  * @return Reference to weight 1.
148  ***************************************************************************/
149 inline
150 double& GBilinear::weight1(void)
151 {
152  return (m_wgt1);
153 }
154 
155 
156 /***********************************************************************//**
157  * @brief Access weight 2
158  *
159  * @return Reference to weight 2.
160  ***************************************************************************/
161 inline
162 double& GBilinear::weight2(void)
163 {
164  return (m_wgt2);
165 }
166 
167 
168 /***********************************************************************//**
169  * @brief Access weight 3
170  *
171  * @return Reference to weight 3.
172  ***************************************************************************/
173 inline
174 double& GBilinear::weight3(void)
175 {
176  return (m_wgt3);
177 }
178 
179 
180 /***********************************************************************//**
181  * @brief Access weight 4
182  *
183  * @return Reference to weight 4.
184  ***************************************************************************/
185 inline
186 double& GBilinear::weight4(void)
187 {
188  return (m_wgt4);
189 }
190 
191 #endif /* GBILINEAR_HPP */
virtual ~GBilinear(void)
Destructor.
Definition: GBilinear.cpp:85
double m_wgt4
Definition: GBilinear.hpp:80
GBilinear * clone(void) const
Clone bilinear interolator.
Definition: GBilinear.cpp:174
int m_inx1
Definition: GBilinear.hpp:73
double m_wgt1
Definition: GBilinear.hpp:77
int & index2(void)
Access index 2.
Definition: GBilinear.hpp:114
int m_inx2
Definition: GBilinear.hpp:74
Definition of interface for all GammaLib classes.
int m_inx3
Definition: GBilinear.hpp:75
double & weight2(void)
Access weight 2.
Definition: GBilinear.hpp:162
double m_wgt3
Definition: GBilinear.hpp:79
GBilinear & operator=(const GBilinear &interpolator)
Assignment operator.
Definition: GBilinear.cpp:107
void init_members(void)
Initialise class members.
Definition: GBilinear.cpp:227
std::string print(const GChatter &chatter=NORMAL) const
Print nodes.
Definition: GBilinear.cpp:186
void clear(void)
Clear node array.
Definition: GBilinear.cpp:156
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
Bilinear interpolator class.
Definition: GBilinear.hpp:40
void copy_members(const GBilinear &interpolator)
Copy class members.
Definition: GBilinear.cpp:249
int & index1(void)
Access index 1.
Definition: GBilinear.hpp:102
int & index4(void)
Access index 4.
Definition: GBilinear.hpp:138
GChatter
Definition: GTypemaps.hpp:33
GBilinear(void)
Void constructor.
Definition: GBilinear.cpp:54
double & weight3(void)
Access weight 3.
Definition: GBilinear.hpp:174
int & index3(void)
Access index 3.
Definition: GBilinear.hpp:126
std::string classname(void) const
Return class name.
Definition: GBilinear.hpp:90
double m_wgt2
Definition: GBilinear.hpp:78
double & weight4(void)
Access weight 4.
Definition: GBilinear.hpp:186
int m_inx4
Definition: GBilinear.hpp:76
double & weight1(void)
Access weight 1.
Definition: GBilinear.hpp:150
void free_members(void)
Delete class members.
Definition: GBilinear.cpp:269
double operator()(const double *array)
Interpolator.
Definition: GBilinear.cpp:134