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
/***===================================================================================================*/
46
class
SgCubicSpline
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
:
104
int
dimension_
;
105
int
numOfRecords_
;
106
SgVector
argument_
;
107
SgMatrix
table_
;
108
SgMatrix
coeffs_
;
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
// CONSTRUCTORS:
131
//
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
{
139
numOfRecords_
=
numOfRecords
;
140
dimension_
=
dimension
;
141
isOk_
=
false
;
142
};
143
144
145
146
// A destructor:
147
inline
SgCubicSpline::~SgCubicSpline
()
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
//
183
inline
SgVector
&
SgCubicSpline::argument
()
184
{
185
return
argument_
;
186
};
187
188
189
190
//
191
inline
SgMatrix
&
SgCubicSpline::table
()
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
SgMatrix.h
SgVector.h
SgCubicSpline
Definition:
SgCubicSpline.h:47
SgCubicSpline::prepare4Spline
void prepare4Spline()
Definition:
SgCubicSpline.cpp:45
SgCubicSpline::className
static const QString className()
Definition:
SgCubicSpline.cpp:37
SgCubicSpline::dimension_
int dimension_
Definition:
SgCubicSpline.h:104
SgCubicSpline::~SgCubicSpline
~SgCubicSpline()
Definition:
SgCubicSpline.h:147
SgCubicSpline::table_
SgMatrix table_
Definition:
SgCubicSpline.h:107
SgCubicSpline::isOk
bool isOk() const
Definition:
SgCubicSpline.h:174
SgCubicSpline::numOfRecords
int numOfRecords() const
Definition:
SgCubicSpline.h:166
SgCubicSpline::SgCubicSpline
SgCubicSpline(int numOfRecords, int dimension)
Definition:
SgCubicSpline.h:134
SgCubicSpline::coeffs_
SgMatrix coeffs_
Definition:
SgCubicSpline.h:108
SgCubicSpline::numOfRecords_
int numOfRecords_
Definition:
SgCubicSpline.h:105
SgCubicSpline::solveSpline
void solveSpline(int)
Definition:
SgCubicSpline.cpp:74
SgCubicSpline::table
SgMatrix & table()
Definition:
SgCubicSpline.h:191
SgCubicSpline::h
double h(int i) const
Definition:
SgCubicSpline.h:113
SgCubicSpline::spline
double spline(double arg, int nColumn, double &r)
Definition:
SgCubicSpline.cpp:113
SgCubicSpline::argument_
SgVector argument_
Definition:
SgCubicSpline.h:106
SgCubicSpline::dimension
int dimension() const
Definition:
SgCubicSpline.h:158
SgCubicSpline::isOk_
bool isOk_
Definition:
SgCubicSpline.h:109
SgCubicSpline::argument
SgVector & argument()
Definition:
SgCubicSpline.h:183
SgMatrix
Definition:
SgMatrix.h:59
SgVector
Definition:
SgVector.h:63
SgVector::getElement
double getElement(unsigned int i) const
Definition:
SgVector.h:362
src
SgLib
SgCubicSpline.h
Generated by
1.9.1