Logo ROOT   6.13/01
Reference Guide
BasicFunctionGradient.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 
10 #ifndef ROOT_Minuit2_BasicFunctionGradient
11 #define ROOT_Minuit2_BasicFunctionGradient
12 
13 #include "Minuit2/MnMatrix.h"
14 
15 #include "Minuit2/StackAllocator.h"
16 
17 namespace ROOT {
18 
19  namespace Minuit2 {
20 
21 
22 //extern StackAllocator gStackAllocator;
23 
25 
26 private:
27 
28 public:
29 
30  explicit BasicFunctionGradient(unsigned int n) :
33  fAnalytical(false) {}
34 
36  fGradient(grd), fG2ndDerivative(MnAlgebraicVector(grd.size())),
37  fGStepSize(MnAlgebraicVector(grd.size())), fValid(true),
38  fAnalytical(true) {}
39 
41  fGradient(grd), fG2ndDerivative(g2),
42  fGStepSize(gstep), fValid(true), fAnalytical(false) {}
43 
45 
47 
49  fGradient = grad.fGradient;
51  fGStepSize = grad.fGStepSize;
52  fValid = grad.fValid;
53  return *this;
54  }
55 
56  void* operator new(size_t nbytes) {
57  return StackAllocatorHolder::Get().Allocate(nbytes);
58  }
59 
60  void operator delete(void* p, size_t /*nbytes */) {
62  }
63 
64  const MnAlgebraicVector& Grad() const {return fGradient;}
65  const MnAlgebraicVector& Vec() const {return fGradient;}
66  bool IsValid() const {return fValid;}
67 
68  bool IsAnalytical() const {return fAnalytical;}
69  const MnAlgebraicVector& G2() const {return fG2ndDerivative;}
70  const MnAlgebraicVector& Gstep() const {return fGStepSize;}
71 
72 private:
73 
77  bool fValid;
79 };
80 
81  } // namespace Minuit2
82 
83 } // namespace ROOT
84 
85 #endif // ROOT_Minuit2_BasicFunctionGradient
const MnAlgebraicVector & Vec() const
Namespace for new ROOT classes and functions.
Definition: TFoamSampler.h:19
const MnAlgebraicVector & Grad() const
BasicFunctionGradient & operator=(const BasicFunctionGradient &grad)
BasicFunctionGradient(const BasicFunctionGradient &grad)
const MnAlgebraicVector & Gstep() const
void * Allocate(size_t nBytes)
const MnAlgebraicVector & G2() const
BasicFunctionGradient(const MnAlgebraicVector &grd)
static StackAllocator & Get()
BasicFunctionGradient(const MnAlgebraicVector &grd, const MnAlgebraicVector &g2, const MnAlgebraicVector &gstep)