Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ParametricFunction.cxx
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#include "Minuit2/MnFcn.h"
12#include "Minuit2/MnStrategy.h"
17
18namespace ROOT {
19
20namespace Minuit2 {
21
22//#include "Minuit2/MnPrint.h"
23
24std::vector<double> ParametricFunction::GetGradient(const std::vector<double> &x) const
25{
26 // calculate the numerical gradient (using Numerical2PGradientCalculator)
27
28 // LM: this I believe is not very efficient
29 MnFcn mfcn(*this);
30
31 MnStrategy strategy(1);
32
33 // ????????? how does it know the transformation????????
34 std::vector<double> err(x.size());
35 err.assign(x.size(), 0.1);
36 // need to use parameters
37 MnUserParameterState st(x, err);
38
39 Numerical2PGradientCalculator gc(mfcn, st.Trafo(), strategy);
40 FunctionGradient g = gc(x);
41 const MnAlgebraicVector &grad = g.Vec();
42 assert(grad.size() == x.size());
44 // std::cout << "Param Function Gradient " << grad << std::endl;
45 return vt(grad);
46}
47
48} // namespace Minuit2
49
50} // namespace ROOT
#define g(i)
Definition RSha256.hxx:105
unsigned int size() const
Definition LAVector.h:227
Wrapper class to FCNBase interface used internally by Minuit.
Definition MnFcn.h:30
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition MnStrategy.h:27
class which holds the external user and/or internal Minuit representation of the parameters and error...
const MnUserTransformation & Trafo() const
class performing the numerical gradient calculation
virtual std::vector< double > GetGradient(const std::vector< double > &x) const
Member function returning the Gradient of the function with respect to its variables (but without inc...
Double_t x[n]
Definition legend1.C:17
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...