LaInverse.cxx

Go to the documentation of this file.
00001 // @(#)root/minuit2:$Id: LaInverse.cxx 20880 2007-11-19 11:23:41Z rdm $
00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  
00003 
00004 /**********************************************************************
00005  *                                                                    *
00006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
00007  *                                                                    *
00008  **********************************************************************/
00009 
00010 #include "Minuit2/LaInverse.h"
00011 #include "Minuit2/LASymMatrix.h"
00012 
00013 namespace ROOT {
00014 
00015    namespace Minuit2 {
00016 
00017 
00018 int mnvert(LASymMatrix& t);
00019 
00020 // symmetric matrix (positive definite only)
00021 
00022 int Invert(LASymMatrix& t) {
00023    // function for inversion of symmetric matrices using  mnvert function 
00024    // (from Fortran Minuit)
00025    
00026    int ifail = 0;
00027    
00028    if(t.size() == 1) {
00029       double tmp = t.Data()[0];
00030       if(!(tmp > 0.)) ifail = 1;
00031       else t.Data()[0] = 1./tmp;
00032    } else {
00033       ifail = mnvert(t);
00034    }
00035    
00036    return ifail;
00037 }
00038 
00039 
00040    }  // namespace Minuit2
00041 
00042 }  // namespace ROOT

Generated on Tue Jul 5 14:37:09 2011 for ROOT_528-00b_version by  doxygen 1.5.1