Chi2Distribution.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Chi2Distribution.hpp 1409 2008-09-24 16:56:22Z architest $"
00002 
00008 #ifndef CHI2DISTRIBUTION_HPP
00009 #define CHI2DISTRIBUTION_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 ). 2008
00030 //
00031 //============================================================================
00032 
00033 
00034 #include "BaseDistribution.hpp"
00035 
00036 
00037 namespace gpstk
00038 {
00039 
00042 
00069    class Chi2Distribution : public BaseDistribution
00070    {
00071    public:
00072 
00073 
00075       Chi2Distribution() : ndf(2) {};
00076 
00077 
00084       Chi2Distribution( int n )
00085       { setNDF(n); };
00086 
00087 
00092       virtual double pdf(double x);
00093 
00094 
00102       virtual double pdf(double x, int n)
00103       { setNDF(n); return pdf(x); };
00104 
00105 
00110       virtual double cdf(double x);
00111 
00112 
00120       virtual double cdf(double x, int n)
00121       { setNDF(n); return cdf(x); };
00122 
00123 
00129       virtual double Q(double x)
00130       { return ( 1.0 - cdf(x) ); };
00131 
00132 
00141       virtual double Q(double x, int n)
00142       { return ( 1.0 - cdf(x,n) ); };
00143 
00144 
00146       virtual double getNDF(void) const
00147       { return ndf; };
00148 
00149 
00156       virtual Chi2Distribution& setNDF(int n)
00157          throw(InvalidParameter);
00158 
00159 
00160    private:
00161 
00162 
00164       int ndf;
00165 
00166 
00167    };  // End of class "Chi2Distribution"
00168 
00170 
00171 }  // End of namespace gpstk
00172 #endif   // CHI2DISTRIBUTION_HPP

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