Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
FunctionGradient.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_FunctionGradient
11#define ROOT_Minuit2_FunctionGradient
12
13#include "Minuit2/MnMatrix.h"
14
15#include <memory>
16
17namespace ROOT {
18
19namespace Minuit2 {
20
22
23private:
24public:
25 explicit FunctionGradient(unsigned int n)
26 : fPtr{new Data{MnAlgebraicVector(n), MnAlgebraicVector(n), MnAlgebraicVector(n), false, false, false}}
27 {
28 }
29
31 : fPtr{new Data{grd, MnAlgebraicVector(0), MnAlgebraicVector(0), true, true, false}}
32 {
33 }
34
36 : fPtr{new Data{grd, g2, MnAlgebraicVector(0), true, true, true}}
37 {
38 }
39
40
42 : fPtr{new Data{grd, g2, gstep, true, false, true}}
43 {
44 }
45
46 const MnAlgebraicVector &Grad() const { return fPtr->fGradient; }
47 const MnAlgebraicVector &Vec() const { return Grad(); }
48 bool IsValid() const { return fPtr->fValid; }
49 bool IsAnalytical() const { return fPtr->fAnalytical; }
50 bool HasG2() const { return fPtr->fHasG2; }
51 const MnAlgebraicVector &G2() const { return fPtr->fG2ndDerivative; }
52 const MnAlgebraicVector &Gstep() const { return fPtr->fGStepSize; }
53
54private:
55 struct Data {
59 bool fValid;
61 bool fHasG2;
62 };
63
64 std::shared_ptr<Data> fPtr;
65};
66
67} // namespace Minuit2
68
69} // namespace ROOT
70
71#endif // ROOT_Minuit2_FunctionGradient
std::shared_ptr< Data > fPtr
const MnAlgebraicVector & Gstep() const
const MnAlgebraicVector & Grad() const
FunctionGradient(const MnAlgebraicVector &grd, const MnAlgebraicVector &g2, const MnAlgebraicVector &gstep)
const MnAlgebraicVector & Vec() const
const MnAlgebraicVector & G2() const
FunctionGradient(const MnAlgebraicVector &grd, const MnAlgebraicVector &g2)
FunctionGradient(const MnAlgebraicVector &grd)
const Int_t n
Definition legend1.C:16
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.