10 #ifndef ROOT_Minuit2_BasicFunctionGradient
11 #define ROOT_Minuit2_BasicFunctionGradient
24 class BasicFunctionGradient {
30 explicit BasicFunctionGradient(
unsigned int n) :
31 fGradient(MnAlgebraicVector(n)), fG2ndDerivative(MnAlgebraicVector(n)),
32 fGStepSize(MnAlgebraicVector(n)), fValid(false),
35 explicit BasicFunctionGradient(
const MnAlgebraicVector& grd) :
36 fGradient(grd), fG2ndDerivative(MnAlgebraicVector(grd.size())),
37 fGStepSize(MnAlgebraicVector(grd.size())), fValid(true),
40 BasicFunctionGradient(
const MnAlgebraicVector& grd,
const MnAlgebraicVector& g2,
const MnAlgebraicVector& gstep) :
41 fGradient(grd), fG2ndDerivative(g2),
42 fGStepSize(gstep), fValid(true), fAnalytical(false) {}
44 ~BasicFunctionGradient() {}
46 BasicFunctionGradient(
const BasicFunctionGradient& grad) : fGradient(grad.fGradient), fG2ndDerivative(grad.fG2ndDerivative), fGStepSize(grad.fGStepSize), fValid(grad.fValid) {}
48 BasicFunctionGradient& operator=(
const BasicFunctionGradient& grad) {
49 fGradient = grad.fGradient;
50 fG2ndDerivative = grad.fG2ndDerivative;
51 fGStepSize = grad.fGStepSize;
56 void*
operator new(
size_t nbytes) {
57 return StackAllocatorHolder::Get().Allocate(nbytes);
60 void operator delete(
void* p,
size_t ) {
61 StackAllocatorHolder::Get().Deallocate(p);
64 const MnAlgebraicVector& Grad()
const {
return fGradient;}
65 const MnAlgebraicVector& Vec()
const {
return fGradient;}
66 bool IsValid()
const {
return fValid;}
68 bool IsAnalytical()
const {
return fAnalytical;}
69 const MnAlgebraicVector& G2()
const {
return fG2ndDerivative;}
70 const MnAlgebraicVector& Gstep()
const {
return fGStepSize;}
74 MnAlgebraicVector fGradient;
75 MnAlgebraicVector fG2ndDerivative;
76 MnAlgebraicVector fGStepSize;
85 #endif // ROOT_Minuit2_BasicFunctionGradient