/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/src/mdcTwoInv.cxx

Go to the documentation of this file.
00001 /* Invert a symmetric 2x2 matrix.  Return 1 if inversion fails. */
00002 
00003 int mdcTwoInv( double matrix[3], double invmat[3]) {
00004 
00005   /* Declare variables. */
00006   double det, detinv;
00007 
00008   /**************************************************************************/
00009 
00010   det = matrix[0] * matrix[2] - matrix[1] * matrix[1];
00011   if (det == 0.0) {
00012     invmat[0] = 0.00001;
00013     invmat[2] = 0.00001;
00014     invmat[1] = 0.00000;
00015     return 1;
00016   }
00017   detinv = 1./det;
00018 
00019   invmat[0] = matrix[2] * detinv;
00020   invmat[2] = matrix[0] * detinv;
00021   invmat[1] = -matrix[1] * detinv;
00022 
00023   return 0;
00024 }

Generated on Tue Nov 29 23:13:35 2016 for BOSS_7.0.2 by  doxygen 1.4.7