General Purpose Geodetic Library
SgCubicSpline.h
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 #ifndef SG_CUBIC_SPLINE_H
24 #define SG_CUBIC_SPLINE_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <QtCore/QString>
33 
34 
35 #include <SgMatrix.h>
36 #include <SgVector.h>
37 
38 
39 
40 /***===================================================================================================*/
47 {
48 public:
49  //
50  // constructors/destructors:
51  //
55  inline SgCubicSpline(int numOfRecords, int dimension);
56 
60  inline ~SgCubicSpline();
61 
62 
63 
64  //
65  // Interfaces:
66  //
67 
70  inline int numOfRecords() const;
71 
74  inline int dimension() const;
75 
76  inline bool isOk() const;
77 
78  inline SgVector& argument();
79 
80  inline SgMatrix& table();
81 
82  //
83  // Functions:
84  //
87  static const QString className();
88 
89  void prepare4Spline();
90 
91  double spline(double arg, int nColumn, double &r);
92 
93 
94  //
95  // Friends:
96  //
97 
98  //
99  // I/O:
100  //
101  // ...
102 
103 private:
109  bool isOk_;
110 
111  void solveSpline(int);
112 
113  inline double h(int i) const {return argument_.getElement(i) - argument_.getElement(i-1);};
114 };
115 /*=====================================================================================================*/
116 
117 
118 
119 
120 
121 
122 
123 
124 /*=====================================================================================================*/
125 /* */
126 /* SgCubicSpline inline members: */
127 /* */
128 /*=====================================================================================================*/
129 //
130 //
131 // CONSTRUCTORS:
132 //
133 // An empty constructor:
134 inline SgCubicSpline::SgCubicSpline(int numOfRecords, int dimension) :
135  argument_(numOfRecords),
136  table_(numOfRecords, dimension),
137  coeffs_(numOfRecords, dimension)
138 {
141  isOk_ = false;
142 };
143 
144 
145 
146 // A destructor:
148 {
149 };
150 
151 
152 
153 //
154 // INTERFACES:
155 //
156 //
157 //
158 inline int SgCubicSpline::dimension() const
159 {
160  return dimension_;
161 };
162 
163 
164 
165 //
166 inline int SgCubicSpline::numOfRecords() const
167 {
168  return numOfRecords_;
169 };
170 
171 
172 
173 //
174 inline bool SgCubicSpline::isOk() const
175 {
176  return isOk_;
177 };
178 
179 
180 
181 // sets:
182 //
184 {
185  return argument_;
186 };
187 
188 
189 
190 //
192 {
193  return table_;
194 };
195 
196 
197 
198 //
199 // FUNCTIONS:
200 //
201 //
202 //
203 
204 
205 //
206 // FRIENDS:
207 //
208 //
209 //
210 
211 
212 /*=====================================================================================================*/
213 
214 
215 
216 
217 
218 /*=====================================================================================================*/
219 //
220 // aux functions:
221 //
222 /*=====================================================================================================*/
223 #endif //SG_CUBIC_SPLINE_H
void prepare4Spline()
static const QString className()
SgMatrix table_
bool isOk() const
int numOfRecords() const
SgCubicSpline(int numOfRecords, int dimension)
SgMatrix coeffs_
void solveSpline(int)
SgMatrix & table()
double h(int i) const
double spline(double arg, int nColumn, double &r)
SgVector argument_
int dimension() const
SgVector & argument()
double getElement(unsigned int i) const
Definition: SgVector.h:362