casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
LinearFitSVD.h
Go to the documentation of this file.
00001 //# LinearFitSVD.h: Linear fit using Singular Value Decomposition method. 
00002 //#
00003 //# Copyright (C) 1995,1999,2000,2001,2002,2004
00004 //# Associated Universities, Inc. Washington DC, USA.
00005 //#                                                             
00006 //# This library is free software; you can redistribute it and/or modify it
00007 //# under the terms of the GNU Library General Public License as published by
00008 //# the Free Software Foundation; either version 2 of the License, or (at your
00009 //# option) any later version.
00010 //#
00011 //# This library is distributed in the hope that it will be useful, but WITHOUT
00012 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014 //# License for more details.
00015 //#
00016 //# You should have received a copy of the GNU Library General Public License
00017 //# along with this library; if not, write to the Free Software Foundation,
00018 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00019 //#
00020 //# Correspondence concerning AIPS++ should be addressed as follows:
00021 //#        Internet email: aips2-request@nrao.edu.
00022 //#        Postal address: AIPS++ Project Office
00023 //#                        National Radio Astronomy Observatory
00024 //#                        520 Edgemont Road
00025 //#                        Charlottesville, VA 22903-2475 USA
00026 //#
00027 //# $Id: LinearFitSVD.h 20229 2008-01-29 15:19:06Z gervandiepen $
00028 
00029 #ifndef SCIMATH_LINEARFITSVD_H
00030 #define SCIMATH_LINEARFITSVD_H
00031 
00032 #include <casa/aips.h>
00033 #include <scimath/Fitting/LinearFit.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 // <summary> 
00038 // Linear least-squares fit using Singular Value Decomposition method. 
00039 // </summary>
00040 //
00041 // <reviewed reviewer="wbrouw" date="2004/06/15" tests="tLinearFitSVD.cc"
00042 //       demos="">
00043 // </reviewed>
00044 //
00045 // <prerequisite>
00046 //   <li> <linkto class="LinearFit">LinearFit</linkto>
00047 //   <li> <linkto module="Fitting">Fitting</linkto>
00048 // </prerequisite>
00049 //
00050 // <etymology>
00051 // Solves the linear least-squares fit problem using the singular value
00052 // decomposition method.
00053 // </etymology>
00054 //
00055 // <synopsis>
00056 // The operation, calls and results are identical to those for the
00057 // LinearFit class. The only difference is a collinearity default of 1e-8
00058 // rather than 0. The actual calculations do a singular value
00059 // decomposition solution. A method exists to get the constraints
00060 // used in solving for missing rank.
00061 //
00062 // </synopsis>
00063 //
00064 // <motivation>
00065 // The creation of this class was driven by the need to provide users with
00066 // a reliable least-squares fit method.  "Numerical Recipes" recommends that
00067 // singular value decomposition (SVD) method be always used for linear
00068 // least-squares problems, because of its robustness.
00069 // Not everybody agrees with this.
00070 // </motivation>
00071 
00072 template<class T> class LinearFitSVD: public LinearFit<T>
00073 {
00074 public: 
00075   //# Constructors
00076   // Create a fitter: the normal way to generate a fitter object. Necessary
00077   // data will be deduced from the Functional provided with
00078   // <src>setFunction()</src>
00079   LinearFitSVD();
00080   // Copy constructor (deep copy)
00081   LinearFitSVD(const LinearFitSVD &other);
00082   // Assignment (deep copy)
00083   LinearFitSVD &operator=(const LinearFitSVD &other);
00084 
00085   // Destructor
00086   virtual ~LinearFitSVD();
00087 
00088 protected:
00089   //# Make members of parent classes known.
00090   using LinearFit<T>::svd_p;
00091   using LinearFit<T>::COLLINEARITY;
00092 };
00093 
00094 
00095 } //# NAMESPACE CASA - END
00096 
00097 #ifndef CASACORE_NO_AUTO_TEMPLATES
00098 #include <scimath/Fitting/LinearFitSVD.tcc>
00099 #endif //# CASACORE_NO_AUTO_TEMPLATES
00100 #endif