EquationSystem.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: EquationSystem.hpp 2583 2011-05-04 01:26:05Z yanweignss $"
00002 
00008 #ifndef GPSTK_EQUATIONSYSTEM_HPP
00009 #define GPSTK_EQUATIONSYSTEM_HPP
00010 
00011 //============================================================================
00012 //
00013 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //
00029 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2009
00030 //
00031 //============================================================================
00032 
00033 
00034 #include <algorithm>
00035 
00036 #include "DataStructures.hpp"
00037 #include "StochasticModel.hpp"
00038 #include "Equation.hpp"
00039 #include "ConstraintSystem.hpp"
00040 
00041 
00042 namespace gpstk
00043 {
00044 
00047    NEW_EXCEPTION_CLASS(InvalidEquationSystem, gpstk::Exception);
00048 
00049 
00052 
00053 
00160    class EquationSystem
00161    {
00162    public:
00163 
00165       EquationSystem()
00166          : isPrepared(false)
00167       {};
00168 
00169 
00174       virtual EquationSystem& addEquation( const Equation& equation );
00175 
00176 
00186       virtual EquationSystem& removeEquation( const Variable& indterm );
00187 
00188 
00190       virtual EquationSystem& clearEquations();
00191 
00192 
00198       virtual EquationSystem& Prepare( gnssSatTypeValue& gData )
00199       { gnssRinex gds(gData); return ( Prepare(gds) ); };
00200 
00201 
00207       virtual EquationSystem& Prepare( gnssRinex& gData );
00208 
00209 
00216       virtual EquationSystem& Prepare( gnssDataMap& gdsMap );
00217 
00218 
00224       virtual int getTotalNumVariables() const
00225          throw(InvalidEquationSystem);
00226 
00227 
00233       virtual VariableSet getVarUnknowns() const
00234          throw(InvalidEquationSystem);
00235 
00236 
00243       virtual int getCurrentNumVariables() const
00244          throw(InvalidEquationSystem);
00245 
00246 
00252       virtual VariableSet getCurrentUnknowns() const
00253          throw(InvalidEquationSystem);
00254 
00255 
00262       virtual int getCurrentNumSources() const
00263          throw(InvalidEquationSystem);
00264 
00265 
00271       virtual SourceIDSet getCurrentSources() const
00272          throw(InvalidEquationSystem);
00273 
00274 
00281       virtual int getCurrentNumSats() const
00282          throw(InvalidEquationSystem);
00283 
00284 
00290       virtual SatIDSet getCurrentSats() const
00291          throw(InvalidEquationSystem);
00292 
00293 
00300       virtual Vector<double> getPrefitsVector() const
00301          throw(InvalidEquationSystem);
00302 
00303 
00310       virtual Matrix<double> getGeometryMatrix() const
00311          throw(InvalidEquationSystem);
00312 
00313 
00320       virtual Matrix<double> getWeightsMatrix() const
00321          throw(InvalidEquationSystem);
00322 
00323 
00330       virtual Matrix<double> getPhiMatrix() const
00331          throw(InvalidEquationSystem);
00332 
00333 
00340       virtual Matrix<double> getQMatrix() const
00341          throw(InvalidEquationSystem);
00342 
00343 
00345       virtual int getEquationDefinitionNumber() const
00346       { return equationDescriptionList.size(); };
00347 
00348 
00350       virtual std::list<Equation> getCurrentEquationsList() const
00351       { return currentEquationsList; };
00352 
00353 
00355       virtual ConstraintSystem getConstraintSystem() const
00356       { return equationConstraints; };
00357 
00358 
00363       virtual EquationSystem& setConstraintSystem(
00364                                          const ConstraintSystem& equationConst )
00365       { equationConstraints = equationConst; return (*this); };
00366 
00367          
00369       virtual EquationSystem& clearConstraintSystem()
00370       { equationConstraints.clearConstraint(); return (*this); };
00371 
00373       virtual ~EquationSystem() {};
00374 
00375 
00376    private:
00377 
00379       ConstraintSystem equationConstraints;
00380 
00382       std::list<Equation> equationDescriptionList;
00383 
00385       std::list<Equation> currentEquationsList;
00386 
00388       VariableSet varUnknowns;
00389 
00391       VariableSet currentUnknowns;
00392 
00394       VariableSet oldUnknowns;
00395 
00397       std::list<Variable> allUnknowns;
00398 
00400       VariableSet rejectUnknowns;
00401 
00403       bool isPrepared;
00404 
00406       SourceIDSet currentSourceSet;
00407 
00409       SatIDSet currentSatSet;
00410 
00412       Matrix<double> phiMatrix;
00413 
00415       Matrix<double> qMatrix;
00416 
00418       Matrix<double> hMatrix;
00419 
00421       Matrix<double> rMatrix;
00422 
00424       Vector<double> measVector;
00425 
00427       void prepareCurrentSourceSat( gnssDataMap& gdsMap );
00428 
00430       VariableSet prepareCurrentUnknownsAndEquations( gnssDataMap& gdsMap );
00431 
00433       void getPhiQ( const gnssDataMap& gdsMap );
00434 
00436       void getPrefit( gnssDataMap& gdsMap );
00437 
00439       void getGeometryWeights( gnssDataMap& gdsMap );
00440 
00443       void imposeConstraints();
00444 
00446       static WhiteNoiseModel whiteNoiseModel;
00447 
00448 
00449    }; // End of class 'EquationSystem'
00450 
00452 
00453 }  // End of namespace gpstk
00454 
00455 #endif   // GPSTK_EQUATIONSYSTEM_HPP

Generated on Wed Feb 8 03:30:59 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1