Logo ROOT   6.13/01
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 
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
int Invert(LASymMatrix &)
Definition: LaInverse.cxx:22
Namespace for new ROOT classes and functions.
Definition: TFoamSampler.h:19
int mnvert(LASymMatrix &t)
Inverts a symmetric matrix.
Definition: mnvert.cxx:24
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:51
const double * Data() const
Definition: LASymMatrix.h:233
unsigned int size() const
Definition: LASymMatrix.h:237