ARLambda.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: ARLambda.hpp 2937 2011-10-23 19:23:33Z yanweignss $"
00002 
00008 #ifndef GPSTK_ARLAMBDA_HPP
00009 #define GPSTK_ARLAMBDA_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 //  Wei Yan - Chinese Academy of Sciences . 2011
00030 //
00031 //============================================================================
00032 
00033 #include "ARBase.hpp"
00034 
00035 namespace gpstk
00036 {
00045    class ARLambda : public ARBase
00046    {
00047    public:
00048       
00050       ARLambda() : squaredRatio(0.0) {}      
00051       
00052 
00054       virtual Vector<double> resolveIntegerAmbiguity( 
00055                                                 const Vector<double>& ambFloat, 
00056                                                 const Matrix<double>& ambCov )
00057          throw(ARException);
00058       
00059 
00061       virtual ~ARLambda(){}
00062 
00063 
00064       bool isFixedSuccessfully(double threshhold = 3.0)
00065       { return (squaredRatio>threshhold)?true:false; }
00066       
00067 
00068       double squaredRatio;
00069 
00070    protected:
00071 
00072       double sign(double x)
00073       { return (x<=0.0)?-1.0:1.0; }
00074 
00075 
00076       double round(double x)
00077       { return double(std::floor(x+0.5));}
00078 
00079 
00080       void swap(double& a,double& b)
00081       { double t(a); a = b; b = t; }
00082 
00083 
00084          // Q = L'*diag(D)*L
00085       int factorize( const Matrix<double>& Q,
00086                      Matrix<double>& L, 
00087                      Vector<double>& D );
00088 
00089 
00091       void gauss(Matrix<double>& L, Matrix<double>& Z, int i, int j );
00092 
00093 
00095       void permute( Matrix<double>& L, 
00096                     Vector<double>& D, 
00097                     int j, 
00098                     double del, 
00099                     Matrix<double>& Z);
00100 
00101 
00103       void reduction( Matrix<double>& L, 
00104                       Vector<double>& D, 
00105                       Matrix<double>& Z );
00106 
00107 
00108          // modified lambda (mlambda) search
00109       virtual int search( const Matrix<double>& L, 
00110                           const Vector<double>& D, 
00111                           const Vector<double>& zs, 
00112                           Matrix<double>& zn, 
00113                           Vector<double>& s, 
00114                           const int& m = 2 );
00115 
00116          // lambda/mlambda integer least-square estimation
00117          // a     Float parameters (n x 1)
00118          // Q     Covariance matrix of float parameters (n x n)
00119          // F     Fixed solutions (n x m)
00120          // s     Sum of squared residulas of fixed solutions (1 x m)
00121          // m     Number of fixed solutions
00122          //      status (0:ok,other:error)
00123       int lambda( const Vector<double>& a, 
00124                   const Matrix<double>& Q, 
00125                   Matrix<double>& F, 
00126                   Vector<double>& s, 
00127                   const int& m = 2 );
00128       
00129    protected:
00130 
00131       
00132          
00133    };   // End of class 'ARLambda'
00134    
00135 }   // End of namespace gpstk
00136 
00137 
00138 #endif  //GPSTK_ARLAMBDA_HPP
00139 

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