Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
BasicMinimumError.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
10#include "Minuit2/BasicMinimumError.h"
11
12#include "Minuit2/MnMatrix.h"
13
14#include "Minuit2/MnPrint.h"
15
16namespace ROOT {
17
18namespace Minuit2 {
19
20MnAlgebraicSymMatrix BasicMinimumError::Hessian() const
21{
22 // calculate Heassian: inverse of error matrix
23 MnAlgebraicSymMatrix tmp(fMatrix);
24 int ifail = Invert(tmp);
25 if (ifail != 0) {
26 MnPrint print("BasicMinimumError::Hessian");
27 print.Warn("Inversion fails; return diagonal matrix");
28 MnAlgebraicSymMatrix tmp2(fMatrix.Nrow());
29 for (unsigned int i = 0; i < fMatrix.Nrow(); i++) {
30 tmp2(i, i) = 1. / fMatrix(i, i);
31 }
32 return tmp2;
33 }
34 return tmp;
35}
36
37} // namespace Minuit2
38
39} // namespace ROOT
int Invert(LASymMatrix &)
Definition LaInverse.cxx:21
LASymMatrix MnAlgebraicSymMatrix
Definition MnMatrixfwd.h:21
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.