BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
mdcTwoInv.cxx
Go to the documentation of this file.
1/* Invert a symmetric 2x2 matrix. Return 1 if inversion fails. */
2
3int mdcTwoInv( double matrix[3], double invmat[3]) {
4
5 /* Declare variables. */
6 double det, detinv;
7
8 /**************************************************************************/
9
10 det = matrix[0] * matrix[2] - matrix[1] * matrix[1];
11 if (det == 0.0) {
12 invmat[0] = 0.00001;
13 invmat[2] = 0.00001;
14 invmat[1] = 0.00000;
15 return 1;
16 }
17 detinv = 1./det;
18
19 invmat[0] = matrix[2] * detinv;
20 invmat[2] = matrix[0] * detinv;
21 invmat[1] = -matrix[1] * detinv;
22
23 return 0;
24}
int mdcTwoInv(double matrix[3], double invmat[3])
Definition: mdcTwoInv.cxx:3