00001 // @(#)root/mathcore:$Id: IMinimizer1D.h 32583 2010-03-12 09:57:42Z moneta $ 00002 // Author: David Gonzalez Maline 2/2008 00003 /********************************************************************** 00004 * * 00005 * Copyright (c) 2004 Maline, CERN/PH-SFT * 00006 * * 00007 * This library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU General Public License * 00009 * as published by the Free Software Foundation; either version 2 * 00010 * of the License, or (at your option) any later version. * 00011 * * 00012 * This library 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 GNU * 00015 * General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this library (see file COPYING); if not, write * 00019 * to the Free Software Foundation, Inc., 59 Temple Place, Suite * 00020 * 330, Boston, MA 02111-1307 USA, or contact the author. * 00021 * * 00022 **********************************************************************/ 00023 00024 // Header file for class Minimizer1D 00025 // 00026 // Created by: Maline at Fri Feb 1 11:30:26 2008 00027 // 00028 00029 #ifndef ROOT_Math_IMinimizer1D 00030 #define ROOT_Math_IMinimizer1D 00031 00032 /** 00033 00034 @defgroup Min1D One-dimensional Minimization 00035 @ingroup NumAlgo 00036 */ 00037 00038 namespace ROOT { 00039 namespace Math { 00040 00041 //___________________________________________________________________________________________ 00042 /** 00043 Interface class for numerical methods for one-dimensional minimization 00044 00045 @ingroup Min1D 00046 00047 */ 00048 00049 class IMinimizer1D { 00050 00051 public: 00052 00053 IMinimizer1D() {} 00054 virtual ~IMinimizer1D() {} 00055 00056 public: 00057 00058 /** 00059 * Return current estimate of the position of the minimum 00060 */ 00061 virtual double XMinimum() const = 0; 00062 00063 /** 00064 * Return current lower bound of the minimization interval 00065 */ 00066 virtual double XLower() const = 0; 00067 00068 /** 00069 * Return current upper bound of the minimization interval 00070 */ 00071 virtual double XUpper() const = 0; 00072 00073 /** 00074 * Return function value at current estimate of the minimum 00075 */ 00076 virtual double FValMinimum() const = 0; 00077 00078 /** 00079 * Return function value at current lower bound of the minimization interval 00080 */ 00081 virtual double FValLower() const = 0; 00082 00083 /** 00084 * Return function value at current upper bound of the minimization interval 00085 */ 00086 virtual double FValUpper() const = 0; 00087 00088 /** 00089 * Find minimum position iterating until convergence specified by the absolute and relative tolerance or 00090 * the maximum number of iteration is reached 00091 * Return true if iterations converged successfully 00092 * \@param maxIter maximum number of iteration 00093 * \@param absTol desired absolute error in the minimum position 00094 * \@param absTol desired relative error in the minimum position 00095 */ 00096 virtual bool Minimize( int maxIter, double absTol, double relTol) = 0; 00097 00098 /** 00099 * Return number of iteration used to find minimum 00100 */ 00101 virtual int Iterations() const = 0; 00102 00103 /** 00104 * Return name of minimization algorithm 00105 */ 00106 virtual const char * Name() const = 0; 00107 00108 /** Returns the status of the previous estimate */ 00109 virtual int Status() const = 0; 00110 00111 00112 }; // end class IMinimizer1D 00113 00114 } // end namespace Math 00115 00116 } // end namespace ROOT 00117 00118 #endif /* ROOT_Math_IMinimizer1D */