00001 #pragma ident "$Id: SRIleastSquares.hpp 1894 2009-05-11 20:00:55Z afarris $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00049
00050 #ifndef CLASS_SRI_LEAST_SQUARES_INCLUDE
00051 #define CLASS_SRI_LEAST_SQUARES_INCLUDE
00052
00053
00054
00055 #include <ostream>
00056
00057 #include "Vector.hpp"
00058 #include "Matrix.hpp"
00059 #include "SRI.hpp"
00060
00061 namespace gpstk {
00062
00063
00073 class SRIleastSquares : public SRI {
00074 public:
00076 SRIleastSquares(void) throw();
00077
00080 SRIleastSquares(const unsigned int N)
00081 throw();
00082
00085 SRIleastSquares(const Namelist& NL)
00086 throw();
00087
00093 SRIleastSquares(const Matrix<double>& R,
00094 const Vector<double>& Z,
00095 const Namelist& NL)
00096 throw(MatrixException);
00097
00100 SRIleastSquares(const SRIleastSquares& right)
00101 throw()
00102 { *this = right; }
00103
00106 SRIleastSquares& operator=(const SRIleastSquares& right)
00107 throw();
00108
00136 int dataUpdate(Vector<double>& D,
00137 Vector<double>& X,
00138 Matrix<double>& Cov,
00139 void (LSF)(Vector<double>& X,
00140 Vector<double>& f,
00141 Matrix<double>& P)
00142 )
00143 throw(MatrixException);
00144
00146 friend std::ostream& operator<<(std::ostream& s,
00147 const SRIleastSquares& srif);
00148
00151 void zeroAll(void);
00152
00154 bool isValid() { return valid; }
00155
00160 void Reset(const int N=0) throw(Exception);
00161
00162
00165 Vector<double> Solution(void) { return Xsave; }
00166
00169 int Iterations() { return number_iterations; }
00170
00173 double Convergence() { return rms_convergence; }
00174
00178 double ConditionNumber() { return condition_number; }
00179
00180
00182 int iterationsLimit;
00183
00185 double convergenceLimit;
00186
00188 double divergenceLimit;
00189
00192 bool doWeight;
00193
00196 bool doRobust;
00197
00199 bool doSequential;
00200
00203 bool doLinearize;
00204
00206 bool doVerbose;
00207
00208 private:
00210 void defaults(void) throw()
00211 {
00212 iterationsLimit = 10;
00213 convergenceLimit = 1.e-8;
00214 divergenceLimit = 1.e10;
00215 doWeight = false;
00216 doRobust = false;
00217 doLinearize = false;
00218 doSequential = false;
00219 doVerbose = false;
00220 number_iterations = number_batches = 0;
00221 rms_convergence = condition_number = 0.0;
00222 valid = false;
00223 }
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00235 bool valid;
00236
00238 int number_iterations;
00239
00241 int number_batches;
00242
00244 double rms_convergence;
00245
00247 double condition_number;
00248
00250 Vector<double> Xsave;
00251
00252 };
00253
00254 }
00255
00256
00257 #endif