Logo ROOT   6.08/07
Reference Guide
Quad1F.h
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
11 
12 namespace ROOT {
13 
14  namespace Minuit2 {
15 
16 
17 class Quad1F : public FCNGradientBase {
18 
19 public:
20 
21  Quad1F() : fErrorDef(1.) {}
22 
23  ~Quad1F() {}
24 
25  double operator()(const std::vector<double>& par) const {
26 
27  double x = par[0];
28 
29  return ( x*x );
30  }
31 
32  std::vector<double> Gradient(const std::vector<double>& par) const {
33 
34  double x = par[0];
35 
36  return ( std::vector<double>(1, 2.*x) );
37  }
38 
39  void SetErrorDef(double up) {fErrorDef = up;}
40 
41  double Up() const {return fErrorDef;}
42 
43  const FCNBase* Base() const {return this;}
44 
45 private:
46  double fErrorDef;
47 };
48 
49 
50  } // namespace Minuit2
51 
52 } // namespace ROOT
double par[1]
Definition: unuranDistr.cxx:38
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
double Up() const
Error definition of the function.
Definition: Quad1F.h:41
Double_t x[n]
Definition: legend1.C:17
Extension of the FCNBase for providing the analytical Gradient of the function.
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
Definition: FCNBase.h:47
double operator()(const std::vector< double > &par) const
The meaning of the vector of parameters is of course defined by the user, who uses the values of thos...
Definition: Quad1F.h:25
const FCNBase * Base() const
Definition: Quad1F.h:43
void SetErrorDef(double up)
add interface to set dynamically a new error definition Re-implement this function if needed...
Definition: Quad1F.h:39
std::vector< double > Gradient(const std::vector< double > &par) const
Definition: Quad1F.h:32