SRIleastSquares.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SRIleastSquares.hpp 1894 2009-05-11 20:00:55Z afarris $"
00002 
00003 //============================================================================
00004 //
00005 
00006 //============================================================================
00007 //
00008 //  This file is part of GPSTk, the GPS Toolkit.
00009 //
00010 //  The GPSTk is free software; you can redistribute it and/or modify
00011 //  it under the terms of the GNU Lesser General Public License as published
00012 //  by the Free Software Foundation; either version 2.1 of the License, or
00013 //  any later version.
00014 //
00015 //  The GPSTk is distributed in the hope that it will be useful,
00016 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 //  GNU Lesser General Public License for more details.
00019 //
00020 //  You should have received a copy of the GNU Lesser General Public
00021 //  License along with GPSTk; if not, write to the Free Software Foundation,
00022 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023 //
00024 //  Copyright 2004, The University of Texas at Austin
00025 //
00026 //============================================================================
00027 
00028 //============================================================================
00029 //
00030 //This software developed by Applied Research Laboratories at the University of
00031 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00032 //Department of Defense. The U.S. Government retains all rights to use,
00033 //duplicate, distribute, disclose, or release this software. 
00034 //
00035 //Pursuant to DoD Directive 523024 
00036 //
00037 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00038 //                           release, distribution is unlimited.
00039 //
00040 //=============================================================================
00041 
00049 //------------------------------------------------------------------------------------
00050 #ifndef CLASS_SRI_LEAST_SQUARES_INCLUDE
00051 #define CLASS_SRI_LEAST_SQUARES_INCLUDE
00052 
00053 //------------------------------------------------------------------------------------
00054 // system
00055 #include <ostream>
00056 // GPSTk
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    // ------------- member functions ---------------
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    // ------------- member data ---------------
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    // private member data - inherits from SRI
00226       // inherit SRI Information matrix, an upper triangular (square) matrix
00227    //Matrix<double> R;
00228       // inherit SRI state vector, of length equal to dimension (row and col) of R.
00229    //Vector<double> Z;
00230       // inherit SRI Namelist parallel to R and Z, labelling elements of state vector.
00231    //Namelist names;
00232 
00233    // --------- private member data ------------
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 }; // end class SRIleastSquares
00253 
00254 } // end namespace gpstk
00255 
00256 //------------------------------------------------------------------------------------
00257 #endif

Generated on Tue May 22 03:31:02 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1