Logo ROOT  
Reference Guide
LaInverse.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/LaInverse.h"
11 #include "Minuit2/LASymMatrix.h"
12 
13 namespace ROOT {
14 
15  namespace Minuit2 {
16 
17 
18 int mnvert(LASymMatrix& t);
19 
20 // symmetric matrix (positive definite only)
21 
22 int Invert(LASymMatrix& t) {
23  // function for inversion of symmetric matrices using mnvert function
24  // (from Fortran Minuit)
25 
26  int ifail = 0;
27 
28  if(t.size() == 1) {
29  double tmp = t.Data()[0];
30  if(!(tmp > 0.)) ifail = 1;
31  else t.Data()[0] = 1./tmp;
32  } else {
33  ifail = mnvert(t);
34  }
35 
36  return ifail;
37 }
38 
39 
40  } // namespace Minuit2
41 
42 } // namespace ROOT
ROOT::Minuit2::Invert
int Invert(LASymMatrix &)
Definition: LaInverse.cxx:30
LASymMatrix.h
LaInverse.h
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Minuit2::mnvert
int mnvert(LASymMatrix &t)
Inverts a symmetric matrix.
Definition: mnvert.cxx:32