GammaLib 2.0.0
Loading...
Searching...
No Matches
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 ***************************************************************************/
40class GBilinear : public GBase {
41
42public:
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
66private:
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 ***************************************************************************/
89inline
90std::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 ***************************************************************************/
101inline
103{
104 return (m_inx1);
105}
106
107
108/***********************************************************************//**
109 * @brief Access index 2
110 *
111 * @return Reference to index 2.
112 ***************************************************************************/
113inline
115{
116 return (m_inx2);
117}
118
119
120/***********************************************************************//**
121 * @brief Access index 3
122 *
123 * @return Reference to index 3.
124 ***************************************************************************/
125inline
127{
128 return (m_inx3);
129}
130
131
132/***********************************************************************//**
133 * @brief Access index 4
134 *
135 * @return Reference to index 4.
136 ***************************************************************************/
137inline
139{
140 return (m_inx4);
141}
142
143
144/***********************************************************************//**
145 * @brief Access weight 1
146 *
147 * @return Reference to weight 1.
148 ***************************************************************************/
149inline
151{
152 return (m_wgt1);
153}
154
155
156/***********************************************************************//**
157 * @brief Access weight 2
158 *
159 * @return Reference to weight 2.
160 ***************************************************************************/
161inline
163{
164 return (m_wgt2);
165}
166
167
168/***********************************************************************//**
169 * @brief Access weight 3
170 *
171 * @return Reference to weight 3.
172 ***************************************************************************/
173inline
175{
176 return (m_wgt3);
177}
178
179
180/***********************************************************************//**
181 * @brief Access weight 4
182 *
183 * @return Reference to weight 4.
184 ***************************************************************************/
185inline
187{
188 return (m_wgt4);
189}
190
191#endif /* GBILINEAR_HPP */
Definition of interface for all GammaLib classes.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Interface class for all GammaLib classes.
Definition GBase.hpp:52
Bilinear interpolator class.
Definition GBilinear.hpp:40
double m_wgt4
Definition GBilinear.hpp:80
void init_members(void)
Initialise class members.
GBilinear & operator=(const GBilinear &interpolator)
Assignment operator.
double m_wgt3
Definition GBilinear.hpp:79
int & index4(void)
Access index 4.
double operator()(const double *array)
Interpolator.
double m_wgt2
Definition GBilinear.hpp:78
int & index2(void)
Access index 2.
int & index3(void)
Access index 3.
void copy_members(const GBilinear &interpolator)
Copy class members.
double & weight1(void)
Access weight 1.
void clear(void)
Clear node array.
GBilinear * clone(void) const
Clone bilinear interolator.
std::string print(const GChatter &chatter=NORMAL) const
Print nodes.
double & weight3(void)
Access weight 3.
GBilinear(void)
Void constructor.
Definition GBilinear.cpp:54
std::string classname(void) const
Return class name.
Definition GBilinear.hpp:90
double & weight4(void)
Access weight 4.
void free_members(void)
Delete class members.
double & weight2(void)
Access weight 2.
double m_wgt1
Definition GBilinear.hpp:77
int & index1(void)
Access index 1.
virtual ~GBilinear(void)
Destructor.
Definition GBilinear.cpp:85