Logo ROOT   6.18/05
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
16
17namespace ROOT {
18
19 namespace Minuit2 {
20
21
22//extern StackAllocator gStackAllocator;
23
25
26private:
27
28public:
29
30 explicit BasicFunctionGradient(unsigned int n) :
33 fAnalytical(false) {}
34
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;
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
72private:
73
77 bool fValid;
79};
80
81 } // namespace Minuit2
82
83} // namespace ROOT
84
85#endif // ROOT_Minuit2_BasicFunctionGradient
BasicFunctionGradient(const BasicFunctionGradient &grad)
const MnAlgebraicVector & G2() const
BasicFunctionGradient(const MnAlgebraicVector &grd, const MnAlgebraicVector &g2, const MnAlgebraicVector &gstep)
const MnAlgebraicVector & Vec() const
const MnAlgebraicVector & Gstep() const
BasicFunctionGradient & operator=(const BasicFunctionGradient &grad)
const MnAlgebraicVector & Grad() const
BasicFunctionGradient(const MnAlgebraicVector &grd)
static StackAllocator & Get()
void * Allocate(size_t nBytes)
const Int_t n
Definition: legend1.C:16
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21