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
22std::vector<double> ParametricFunction::GetGradient(std::vector<double> const &x) const
23{
24 // calculate the numerical gradient (using Numerical2PGradientCalculator)
25
26 // LM: this I believe is not very efficient
27 MnFcn mfcn(*this);
28
29 MnStrategy strategy(1);
30
31 // ????????? how does it know the transformation????????
32 std::vector<double> err(x.size());
33 err.assign(x.size(), 0.1);
34 // need to use parameters
35 MnUserParameterState st(x, err);
36
37 Numerical2PGradientCalculator gc(mfcn, st.Trafo(), strategy);
39 const MnAlgebraicVector &grad = g.Vec();
40 assert(grad.size() == x.size());
42 // std::cout << "Param Function Gradient " << grad << std::endl;
43 return vt(grad);
44}
45
46} // namespace Minuit2
47
48} // namespace ROOT
#define g(i)
Definition RSha256.hxx:105
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
unsigned int size() const
Definition LAVector.h:231
Wrapper class to FCNBase interface used internally by Minuit.
Definition MnFcn.h:30
API class for defining four levels of strategies: low (0), medium (1), high (2), very high (>=3); act...
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(std::vector< double > const &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...