Logo ROOT  
Reference Guide
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);
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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
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: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
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.