Quad1F.h

Go to the documentation of this file.
00001 // @(#)root/minuit2:$Id: Quad1F.h 20880 2007-11-19 11:23:41Z rdm $
00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 #include "Minuit2/FCNGradientBase.h"
00011 
00012 namespace ROOT {
00013 
00014    namespace Minuit2 {
00015 
00016 
00017 class Quad1F : public FCNGradientBase {
00018 
00019 public:
00020 
00021   Quad1F() : fErrorDef(1.) {}
00022 
00023   ~Quad1F() {}
00024 
00025   double operator()(const std::vector<double>& par) const {
00026 
00027     double x = par[0];
00028 
00029     return ( x*x );
00030   }
00031   
00032   std::vector<double> Gradient(const std::vector<double>& par) const {
00033     
00034     double x = par[0];
00035     
00036     return ( std::vector<double>(1, 2.*x) );  
00037   }
00038 
00039   void SetErrorDef(double up) {fErrorDef = up;}
00040 
00041   double Up() const {return fErrorDef;}
00042 
00043   const FCNBase* Base() const {return this;}
00044 
00045 private:
00046   double fErrorDef;
00047 };
00048 
00049 
00050   }  // namespace Minuit2
00051 
00052 }  // namespace ROOT

Generated on Tue Jul 5 14:37:13 2011 for ROOT_528-00b_version by  doxygen 1.5.1