SRI.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SRI.hpp 2293 2010-02-12 18:14:16Z btolman $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //  
00021 //  Copyright 2004, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00025 //============================================================================
00026 //
00027 //This software developed by Applied Research Laboratories at the University of
00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00029 //Department of Defense. The U.S. Government retains all rights to use,
00030 //duplicate, distribute, disclose, or release this software. 
00031 //
00032 //Pursuant to DoD Directive 523024 
00033 //
00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00035 //                           release, distribution is unlimited.
00036 //
00037 //=============================================================================
00038 
00049 //------------------------------------------------------------------------------------
00050 // TD go back thru and add const and throw() everywhere, also in Namelist
00051 // TD check that names CAN have different length than R and Z -- see zeroAll
00052 
00053 //------------------------------------------------------------------------------------
00054 #ifndef CLASS_SQUAREROOTINFORMATION_INCLUDE
00055 #define CLASS_SQUAREROOTINFORMATION_INCLUDE
00056 
00057 //------------------------------------------------------------------------------------
00058 // system includes
00059 #include <string>
00060 // GPSTk
00061 #include "Matrix.hpp"
00062 #include "StringUtils.hpp"
00063 // geomatics
00064 #include "Namelist.hpp"
00065 #include "SRIMatrix.hpp"
00066 
00067 namespace gpstk
00068 {
00069 
00070 //------------------------------------------------------------------------------------
00072 extern const Matrix<double> SRINullMatrix;
00073 
00074 //------------------------------------------------------------------------------------
00166 class SRI {
00167 public:
00169    SRI(void) throw() { }
00170 
00172    SRI(const unsigned int)
00173       throw();
00174 
00176    SRI(const Namelist&)
00177       throw();
00178 
00180    SRI(const Matrix<double>&,
00181        const Vector<double>&,
00182        const Namelist&)
00183       throw(MatrixException);
00184 
00186    SRI(const SRI&)
00187       throw();
00188 
00190    SRI& operator=(const SRI& right)
00191       throw();
00192 
00193    // modify SRIs
00194 
00197    void permute(const Namelist&)
00198       throw(MatrixException,VectorException);
00199 
00207    void split(const Namelist&, SRI&)
00208       throw(MatrixException,VectorException);
00209 
00212    SRI& operator+=(const Namelist&)
00213       throw(MatrixException,VectorException);
00214 
00217    void reshape(const Namelist&)
00218       throw(MatrixException,VectorException);
00219 
00221    void merge(const SRI& S)
00222       throw(MatrixException,VectorException)
00223    { *this += S; }
00224 
00227    SRI& operator+=(const SRI&)
00228       throw(MatrixException,VectorException);
00229 
00231    friend SRI operator+(const SRI&,
00232                         const SRI&)
00233       throw(MatrixException,VectorException);
00234 
00239    SRI& append(const SRI& S)
00240       throw(MatrixException,VectorException);
00241 
00244    void zeroOne(const unsigned int n)
00245       throw();
00246 
00250    void zeroAll(const int n=0)
00251       throw();
00252 
00254    void zeroState(void)
00255       throw()
00256    { Z = 0.0; }
00257 
00260    //void reset(int n=0)
00261    //   throw();
00262 
00266    void shift(const Vector<double>& X0)
00267       throw(MatrixException);
00268 
00272    void shiftZ(const Vector<double>& Z0)
00273       throw(MatrixException);
00274 
00281    void transform(const Matrix<double>& T,
00282                   const Matrix<double>& invT=SRINullMatrix)
00283       throw(MatrixException,VectorException);
00284 
00290    void transformState(const Matrix<double>& invT)
00291       throw(MatrixException);
00292 
00299    void Qbump(const unsigned int& in,
00300               const double& q=0.0)
00301       throw(MatrixException,VectorException);
00302 
00306    void stateFix(const unsigned int& index,
00307                  const double& value)
00308       throw(MatrixException,VectorException);
00309 
00314    void stateFix(const Namelist& drops,
00315                  const Vector<double>& values)
00316       throw(MatrixException,VectorException);
00317 
00323    void addAPriori(const Matrix<double>& Cov, const Vector<double>& X)
00324       throw(MatrixException);
00325 
00331    void addAPrioriInformation(const Matrix<double>& ICov, const Vector<double>& X)
00332       throw(MatrixException);
00333 
00337    void measurementUpdate(Matrix<double>& Partials,
00338                           Vector<double>& Data)
00339       throw(MatrixException)
00340    { SrifMU(R, Z, Partials, Data); }
00341 
00346    void getConditionNumber(double& small, double& big)
00347       throw(MatrixException);
00348 
00359    void getState(Vector<double>& X, int *ptrSingularIndex=NULL)
00360       throw(MatrixException);
00361 
00374    void getStateAndCovariance(Vector<double>& X,
00375                               Matrix<double>& C,
00376                               double *ptrSmall=NULL,
00377                               double *ptrBig=NULL)
00378       throw(MatrixException,VectorException);
00379 
00380       // member access
00383    unsigned int size(void) const
00384       throw()
00385    { return R.rows(); }
00386 
00388    Namelist getNames(void)
00389       throw()
00390    { return names; }
00391 
00394    std::string getName(const unsigned int in)
00395       throw()
00396    { return names.getName(in); }
00397 
00401    bool setName(const unsigned int in,
00402                 const std::string& name)
00403       throw()
00404    { return names.setName(in,name); }
00405 
00408    unsigned int index(std::string& name)
00409       throw()
00410    { return names.index(name); }
00411 
00413    Matrix<double> getR(void)
00414       throw()
00415    { return R; }
00416 
00418    Vector<double> getZ(void)
00419       throw()
00420    { return Z; }
00421 
00423    friend std::ostream& operator<<(std::ostream& s,
00424                                    const SRI&);
00425 
00426 protected:
00427    // member data
00429    Matrix<double> R;
00430 
00432    Vector<double> Z;
00433 
00435    Namelist names;
00436 
00437 }; // end class SRI
00438 
00439 } // end namespace gpstk
00440 
00441 //------------------------------------------------------------------------------------
00442 #endif

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