SRIleastSquares.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
45 //------------------------------------------------------------------------------------
46 #ifndef CLASS_SRI_LEAST_SQUARES_INCLUDE
47 #define CLASS_SRI_LEAST_SQUARES_INCLUDE
48 
49 //------------------------------------------------------------------------------------
50 // system
51 #include <ostream>
52 // GNSSTk
53 #include "Matrix.hpp"
54 #include "SRI.hpp"
55 #include "Vector.hpp"
56 
57 namespace gnsstk
58 {
59 
60  //---------------------------------------------------------------------------------
71  class SRIleastSquares : public SRI
72  {
73  public:
75  using LSFFunc = void (*)(Vector<double>& X, Vector<double>& f,
77 
80 
85  SRIleastSquares(const unsigned int N);
86 
92  SRIleastSquares(const Namelist& NL);
93 
102  const Namelist& NL);
103 
108  SRIleastSquares(const SRIleastSquares& right) { *this = right; }
109 
115 
147  LSFFunc LSF);
148 
150  friend std::ostream& operator<<(std::ostream& s,
151  const SRIleastSquares& srif);
152 
157  void zeroAll();
158 
163  bool isValid() { return valid; }
164 
172  void reset(const int N = 0);
173 
174  // ------------- member functions ---------------
180 
186  int iterations() { return numberIterations; }
187 
193  double convergence() { return rmsConvergence; }
194 
200  double conditionNumber() { return conditionNum; }
201 
202  // ------------- member data ---------------
205 
208 
211 
216  bool doWeight;
217 
223  bool doRobust;
224 
230 
237 
239  bool doVerbose;
240 
241  private:
243  void defaults()
244  {
245  iterationsLimit = 10;
246  convergenceLimit = 1.e-8;
247  divergenceLimit = 1.e10;
248  doWeight = false;
249  doRobust = false;
250  doLinearize = false;
251  doSequential = false;
252  doVerbose = false;
255  valid = false;
256  }
257 
258  // private member data - inherits from SRI
259  // inherit SRI Information matrix, an upper triangular (square) matrix
260  // Matrix<double> R;
261  // inherit SRI state vector, of length equal to dimension (row and col) of
262  // R.
263  // Vector<double> Z;
264  // inherit SRI Namelist parallel to R and Z, labelling elements of state
265  // vector.
266  // Namelist names;
267 
268  // --------- private member data ------------
270  bool valid;
271 
274 
277 
280 
282  double conditionNum;
283 
286 
287  }; // end class SRIleastSquares
288 
289 } // end namespace gnsstk
290 
291 //------------------------------------------------------------------------------------
292 #endif
gnsstk::SRIleastSquares::iterations
int iterations()
Definition: SRIleastSquares.hpp:186
gnsstk::SRIleastSquares::divergenceLimit
double divergenceLimit
upper limit on the RSS change in solution which produces an abort
Definition: SRIleastSquares.hpp:210
gnsstk::SRIleastSquares::SRIleastSquares
SRIleastSquares(const SRIleastSquares &right)
Definition: SRIleastSquares.hpp:108
gnsstk::SRIleastSquares::doLinearize
bool doLinearize
Definition: SRIleastSquares.hpp:236
gnsstk::SRIleastSquares::isValid
bool isValid()
Definition: SRIleastSquares.hpp:163
gnsstk::SRIleastSquares::dataUpdate
int dataUpdate(Vector< double > &D, Vector< double > &X, Matrix< double > &Cov, LSFFunc LSF)
Definition: SRIleastSquares.cpp:271
gnsstk::SRIleastSquares::convergence
double convergence()
Definition: SRIleastSquares.hpp:193
gnsstk::SRIleastSquares::Xsave
Vector< double > Xsave
solution X consistent with current information RX=z
Definition: SRIleastSquares.hpp:285
gnsstk::SRIleastSquares::SRIleastSquares
SRIleastSquares()
empty constructor
Definition: SRIleastSquares.cpp:61
gnsstk::SRIleastSquares::rmsConvergence
double rmsConvergence
RMS change in state, used for convergence test.
Definition: SRIleastSquares.hpp:279
gnsstk::SRI
Definition: SRI.hpp:175
gnsstk::SRIleastSquares::numberBatches
int numberBatches
current number of batches seen
Definition: SRIleastSquares.hpp:276
SRI.hpp
gnsstk::SRIleastSquares::reset
void reset(const int N=0)
Definition: SRIleastSquares.cpp:628
gnsstk::SRI::R
Matrix< double > R
Information matrix, an upper triangular (square) matrix.
Definition: SRI.hpp:601
gnsstk::SRIleastSquares::doSequential
bool doSequential
Definition: SRIleastSquares.hpp:229
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::SRI::Z
Vector< double > Z
SRI state vector, of length equal to the dimension (row and col) of R.
Definition: SRI.hpp:604
gnsstk::SRIleastSquares::operator<<
friend std::ostream & operator<<(std::ostream &s, const SRIleastSquares &srif)
output operator
gnsstk::SRIleastSquares::doRobust
bool doRobust
Definition: SRIleastSquares.hpp:223
gnsstk::SRIleastSquares::operator=
SRIleastSquares & operator=(const SRIleastSquares &right)
Definition: SRIleastSquares.cpp:111
gnsstk::Matrix< double >
gnsstk::SRIleastSquares::numberIterations
int numberIterations
current number of iterations
Definition: SRIleastSquares.hpp:273
gnsstk::SRIleastSquares
Definition: SRIleastSquares.hpp:71
gnsstk::SRIleastSquares::LSFFunc
void(*)(Vector< double > &X, Vector< double > &f, Matrix< double > &P) LSFFunc
Function to fit.
Definition: SRIleastSquares.hpp:76
gnsstk::SRIleastSquares::doVerbose
bool doVerbose
if true, output intermediate results
Definition: SRIleastSquares.hpp:239
gnsstk::SRIleastSquares::solution
Vector< double > solution()
Definition: SRIleastSquares.hpp:179
gnsstk::Vector< double >
gnsstk::TrackingCode::P
@ P
Legacy GPS precise code.
gnsstk::SRIleastSquares::conditionNumber
double conditionNumber()
Definition: SRIleastSquares.hpp:200
gnsstk::SRIleastSquares::zeroAll
void zeroAll()
Definition: SRIleastSquares.cpp:616
gnsstk::Namelist
Definition: Namelist.hpp:287
Matrix.hpp
gnsstk::SRIleastSquares::defaults
void defaults()
initialization used by constructors - leastSquaresEstimation() only
Definition: SRIleastSquares.hpp:243
gnsstk::SRIleastSquares::conditionNum
double conditionNum
condition number, defined in inversion to get state and covariance
Definition: SRIleastSquares.hpp:282
gnsstk::SRIleastSquares::doWeight
bool doWeight
Definition: SRIleastSquares.hpp:216
gnsstk::SRIleastSquares::convergenceLimit
double convergenceLimit
limit on the RSS change in solution which produces success
Definition: SRIleastSquares.hpp:207
gnsstk::SRIleastSquares::iterationsLimit
int iterationsLimit
limit on the number of iterations
Definition: SRIleastSquares.hpp:204
gnsstk::SRIleastSquares::valid
bool valid
indicates if the filter is valid - set false when singular
Definition: SRIleastSquares.hpp:270
Vector.hpp


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:41