ROOT   6.08/07 Reference Guide
TMatrixTCramerInv.cxx
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Authors: Fons Rademakers, Eddy Offermann Jan 2004
3
4 /*************************************************************************
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. * 9 * For the list of contributors see$ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11
12 /** \class TMatrixTCramerInv
13  \ingroup Matrix
14
15 TMatrixTCramerInv
16
17 Encapsulate templates of Cramer Inversion routines.
18
19 The 4x4, 5x5 and 6x6 are adapted from routines written by
20 Mark Fischler and Steven Haywood as part of the CLHEP package
21
22 Although for sizes <= 6x6 the Cramer Inversion has a gain in speed
23 compared to factorization schemes (like LU) , one pays a price in
24 accuracy .
25
26 For Example:
27 ~~~
28  H * H^-1 = U, where H is a 5x5 Hilbert matrix
29  U is a 5x5 Unity matrix
30
31  LU : |U_jk| < 10e-13 for j!=k
32  Cramer: |U_jk| < 10e-7 for j!=k
33 ~~~
34
35 however Cramer algorithm is about 10 (!) times faster
36 */
37
38 #include "TMatrixTCramerInv.h"
39
40 #if !defined(R__SOLARIS) && !defined(R__ACC) && !defined(R__FBSD)
42 #endif
43
44 ////////////////////////////////////////////////////////////////////////////////
45
46 template<class Element>
48 {
49  if (m.GetNrows() != 2 || m.GetNcols() != 2 || m.GetRowLwb() != m.GetColLwb()) {
50  Error("Inv2x2","matrix should be square 2x2");
51  return kFALSE;
52  }
53
54  Element *pM = m.GetMatrixArray();
55
56  const Double_t det = pM[0] * pM[3] - pM[2] * pM[1];
57
58  if (determ)
59  *determ = det;
60
61  const Double_t s = 1./det;
62  if ( det == 0 ) {
63  Error("Inv2x2","matrix is singular");
64  return kFALSE;
65  }
66
67  const Double_t tmp = s*pM[3];
68  pM[1] *= -s;
69  pM[2] *= -s;
70  pM[3] = s*pM[0];
71  pM[0] = tmp;
72
73  return kTRUE;
74 }
75
76 ////////////////////////////////////////////////////////////////////////////////
77
78 template<class Element>
80 {
81  if (m.GetNrows() != 3 || m.GetNcols() != 3 || m.GetRowLwb() != m.GetColLwb()) {
82  Error("Inv3x3","matrix should be square 3x3");
83  return kFALSE;
84  }
85
86  Element *pM = m.GetMatrixArray();
87
88  const Double_t c00 = pM[4] * pM[8] - pM[5] * pM[7];
89  const Double_t c01 = pM[5] * pM[6] - pM[3] * pM[8];
90  const Double_t c02 = pM[3] * pM[7] - pM[4] * pM[6];
91  const Double_t c10 = pM[7] * pM[2] - pM[8] * pM[1];
92  const Double_t c11 = pM[8] * pM[0] - pM[6] * pM[2];
93  const Double_t c12 = pM[6] * pM[1] - pM[7] * pM[0];
94  const Double_t c20 = pM[1] * pM[5] - pM[2] * pM[4];
95  const Double_t c21 = pM[2] * pM[3] - pM[0] * pM[5];
96  const Double_t c22 = pM[0] * pM[4] - pM[1] * pM[3];
97
98  const Double_t t0 = TMath::Abs(pM[0]);
99  const Double_t t1 = TMath::Abs(pM[3]);
100  const Double_t t2 = TMath::Abs(pM[6]);
101  Double_t det;
102  Double_t tmp;
103  if (t0 >= t1) {
104  if (t2 >= t0) {
105  tmp = pM[6];
106  det = c12*c01-c11*c02;
107  } else {
108  tmp = pM[0];
109  det = c11*c22-c12*c21;
110  }
111  } else if (t2 >= t1) {
112  tmp = pM[6];
113  det = c12*c01-c11*c02;
114  } else {
115  tmp = pM[3];
116  det = c02*c21-c01*c22;
117  }
118
119  if ( det == 0 || tmp == 0) {
120  Error("Inv3x3","matrix is singular");
121  return kFALSE;
122  }
123
124  const Double_t s = tmp/det;
125  if (determ)
126  *determ = 1./s;
127
128  pM[0] = s*c00;
129  pM[1] = s*c10;
130  pM[2] = s*c20;
131  pM[3] = s*c01;
132  pM[4] = s*c11;
133  pM[5] = s*c21;
134  pM[6] = s*c02;
135  pM[7] = s*c12;
136  pM[8] = s*c22;
137
138  return kTRUE;
139 }
140
141 // GFij are indices for a 4x4 matrix.
142
143 #define GF00 0
144 #define GF01 1
145 #define GF02 2
146 #define GF03 3
147
148 #define GF10 4
149 #define GF11 5
150 #define GF12 6
151 #define GF13 7
152
153 #define GF20 8
154 #define GF21 9
155 #define GF22 10
156 #define GF23 11
157
158 #define GF30 12
159 #define GF31 13
160 #define GF32 14
161 #define GF33 15
162
163 ////////////////////////////////////////////////////////////////////////////////
164
165 template<class Element>
167 {
168  if (m.GetNrows() != 4 || m.GetNcols() != 4 || m.GetRowLwb() != m.GetColLwb()) {
169  Error("Inv4x4","matrix should be square 4x4");
170  return kFALSE;
171  }
172
173  Element *pM = m.GetMatrixArray();
174
175  // Find all NECESSARY 2x2 dets: (18 of them)
176
177  const Double_t det2_12_01 = pM[GF10]*pM[GF21] - pM[GF11]*pM[GF20];
178  const Double_t det2_12_02 = pM[GF10]*pM[GF22] - pM[GF12]*pM[GF20];
179  const Double_t det2_12_03 = pM[GF10]*pM[GF23] - pM[GF13]*pM[GF20];
180  const Double_t det2_12_13 = pM[GF11]*pM[GF23] - pM[GF13]*pM[GF21];
181  const Double_t det2_12_23 = pM[GF12]*pM[GF23] - pM[GF13]*pM[GF22];
182  const Double_t det2_12_12 = pM[GF11]*pM[GF22] - pM[GF12]*pM[GF21];
183  const Double_t det2_13_01 = pM[GF10]*pM[GF31] - pM[GF11]*pM[GF30];
184  const Double_t det2_13_02 = pM[GF10]*pM[GF32] - pM[GF12]*pM[GF30];
185  const Double_t det2_13_03 = pM[GF10]*pM[GF33] - pM[GF13]*pM[GF30];
186  const Double_t det2_13_12 = pM[GF11]*pM[GF32] - pM[GF12]*pM[GF31];
187  const Double_t det2_13_13 = pM[GF11]*pM[GF33] - pM[GF13]*pM[GF31];
188  const Double_t det2_13_23 = pM[GF12]*pM[GF33] - pM[GF13]*pM[GF32];
189  const Double_t det2_23_01 = pM[GF20]*pM[GF31] - pM[GF21]*pM[GF30];
190  const Double_t det2_23_02 = pM[GF20]*pM[GF32] - pM[GF22]*pM[GF30];
191  const Double_t det2_23_03 = pM[GF20]*pM[GF33] - pM[GF23]*pM[GF30];
192  const Double_t det2_23_12 = pM[GF21]*pM[GF32] - pM[GF22]*pM[GF31];
193  const Double_t det2_23_13 = pM[GF21]*pM[GF33] - pM[GF23]*pM[GF31];
194  const Double_t det2_23_23 = pM[GF22]*pM[GF33] - pM[GF23]*pM[GF32];
195
196  // Find all NECESSARY 3x3 dets: (16 of them)
197
198  const Double_t det3_012_012 = pM[GF00]*det2_12_12 - pM[GF01]*det2_12_02
199  + pM[GF02]*det2_12_01;
200  const Double_t det3_012_013 = pM[GF00]*det2_12_13 - pM[GF01]*det2_12_03
201  + pM[GF03]*det2_12_01;
202  const Double_t det3_012_023 = pM[GF00]*det2_12_23 - pM[GF02]*det2_12_03
203  + pM[GF03]*det2_12_02;
204  const Double_t det3_012_123 = pM[GF01]*det2_12_23 - pM[GF02]*det2_12_13
205  + pM[GF03]*det2_12_12;
206  const Double_t det3_013_012 = pM[GF00]*det2_13_12 - pM[GF01]*det2_13_02
207  + pM[GF02]*det2_13_01;
208  const Double_t det3_013_013 = pM[GF00]*det2_13_13 - pM[GF01]*det2_13_03
209  + pM[GF03]*det2_13_01;
210  const Double_t det3_013_023 = pM[GF00]*det2_13_23 - pM[GF02]*det2_13_03
211  + pM[GF03]*det2_13_02;
212  const Double_t det3_013_123 = pM[GF01]*det2_13_23 - pM[GF02]*det2_13_13
213  + pM[GF03]*det2_13_12;
214  const Double_t det3_023_012 = pM[GF00]*det2_23_12 - pM[GF01]*det2_23_02
215  + pM[GF02]*det2_23_01;
216  const Double_t det3_023_013 = pM[GF00]*det2_23_13 - pM[GF01]*det2_23_03
217  + pM[GF03]*det2_23_01;
218  const Double_t det3_023_023 = pM[GF00]*det2_23_23 - pM[GF02]*det2_23_03
219  + pM[GF03]*det2_23_02;
220  const Double_t det3_023_123 = pM[GF01]*det2_23_23 - pM[GF02]*det2_23_13
221  + pM[GF03]*det2_23_12;
222  const Double_t det3_123_012 = pM[GF10]*det2_23_12 - pM[GF11]*det2_23_02
223  + pM[GF12]*det2_23_01;
224  const Double_t det3_123_013 = pM[GF10]*det2_23_13 - pM[GF11]*det2_23_03
225  + pM[GF13]*det2_23_01;
226  const Double_t det3_123_023 = pM[GF10]*det2_23_23 - pM[GF12]*det2_23_03
227  + pM[GF13]*det2_23_02;
228  const Double_t det3_123_123 = pM[GF11]*det2_23_23 - pM[GF12]*det2_23_13
229  + pM[GF13]*det2_23_12;
230
231  // Find the 4x4 det:
232
233  const Double_t det = pM[GF00]*det3_123_123 - pM[GF01]*det3_123_023
234  + pM[GF02]*det3_123_013 - pM[GF03]*det3_123_012;
235  if (determ)
236  *determ = det;
237
238  if ( det == 0 ) {
239  Error("Inv4x4","matrix is singular");
240  return kFALSE;
241  }
242
243  const Double_t oneOverDet = 1.0/det;
244  const Double_t mn1OverDet = - oneOverDet;
245
246  pM[GF00] = det3_123_123 * oneOverDet;
247  pM[GF01] = det3_023_123 * mn1OverDet;
248  pM[GF02] = det3_013_123 * oneOverDet;
249  pM[GF03] = det3_012_123 * mn1OverDet;
250
251  pM[GF10] = det3_123_023 * mn1OverDet;
252  pM[GF11] = det3_023_023 * oneOverDet;
253  pM[GF12] = det3_013_023 * mn1OverDet;
254  pM[GF13] = det3_012_023 * oneOverDet;
255
256  pM[GF20] = det3_123_013 * oneOverDet;
257  pM[GF21] = det3_023_013 * mn1OverDet;
258  pM[GF22] = det3_013_013 * oneOverDet;
259  pM[GF23] = det3_012_013 * mn1OverDet;
260
261  pM[GF30] = det3_123_012 * mn1OverDet;
262  pM[GF31] = det3_023_012 * oneOverDet;
263  pM[GF32] = det3_013_012 * mn1OverDet;
264  pM[GF33] = det3_012_012 * oneOverDet;
265
266  return kTRUE;
267 }
268
269 // GMij are indices for a 5x5 matrix.
270
271 #define GM00 0
272 #define GM01 1
273 #define GM02 2
274 #define GM03 3
275 #define GM04 4
276
277 #define GM10 5
278 #define GM11 6
279 #define GM12 7
280 #define GM13 8
281 #define GM14 9
282
283 #define GM20 10
284 #define GM21 11
285 #define GM22 12
286 #define GM23 13
287 #define GM24 14
288
289 #define GM30 15
290 #define GM31 16
291 #define GM32 17
292 #define GM33 18
293 #define GM34 19
294
295 #define GM40 20
296 #define GM41 21
297 #define GM42 22
298 #define GM43 23
299 #define GM44 24
300
301 ////////////////////////////////////////////////////////////////////////////////
302
303 template<class Element>
305 {
306  if (m.GetNrows() != 5 || m.GetNcols() != 5 || m.GetRowLwb() != m.GetColLwb()) {
307  Error("Inv5x5","matrix should be square 5x5");
308  return kFALSE;
309  }
310
311  Element *pM = m.GetMatrixArray();
312
313  // Find all NECESSARY 2x2 dets: (30 of them)
314
315  const Double_t det2_23_01 = pM[GM20]*pM[GM31] - pM[GM21]*pM[GM30];
316  const Double_t det2_23_02 = pM[GM20]*pM[GM32] - pM[GM22]*pM[GM30];
317  const Double_t det2_23_03 = pM[GM20]*pM[GM33] - pM[GM23]*pM[GM30];
318  const Double_t det2_23_04 = pM[GM20]*pM[GM34] - pM[GM24]*pM[GM30];
319  const Double_t det2_23_12 = pM[GM21]*pM[GM32] - pM[GM22]*pM[GM31];
320  const Double_t det2_23_13 = pM[GM21]*pM[GM33] - pM[GM23]*pM[GM31];
321  const Double_t det2_23_14 = pM[GM21]*pM[GM34] - pM[GM24]*pM[GM31];
322  const Double_t det2_23_23 = pM[GM22]*pM[GM33] - pM[GM23]*pM[GM32];
323  const Double_t det2_23_24 = pM[GM22]*pM[GM34] - pM[GM24]*pM[GM32];
324  const Double_t det2_23_34 = pM[GM23]*pM[GM34] - pM[GM24]*pM[GM33];
325  const Double_t det2_24_01 = pM[GM20]*pM[GM41] - pM[GM21]*pM[GM40];
326  const Double_t det2_24_02 = pM[GM20]*pM[GM42] - pM[GM22]*pM[GM40];
327  const Double_t det2_24_03 = pM[GM20]*pM[GM43] - pM[GM23]*pM[GM40];
328  const Double_t det2_24_04 = pM[GM20]*pM[GM44] - pM[GM24]*pM[GM40];
329  const Double_t det2_24_12 = pM[GM21]*pM[GM42] - pM[GM22]*pM[GM41];
330  const Double_t det2_24_13 = pM[GM21]*pM[GM43] - pM[GM23]*pM[GM41];
331  const Double_t det2_24_14 = pM[GM21]*pM[GM44] - pM[GM24]*pM[GM41];
332  const Double_t det2_24_23 = pM[GM22]*pM[GM43] - pM[GM23]*pM[GM42];
333  const Double_t det2_24_24 = pM[GM22]*pM[GM44] - pM[GM24]*pM[GM42];
334  const Double_t det2_24_34 = pM[GM23]*pM[GM44] - pM[GM24]*pM[GM43];
335  const Double_t det2_34_01 = pM[GM30]*pM[GM41] - pM[GM31]*pM[GM40];
336  const Double_t det2_34_02 = pM[GM30]*pM[GM42] - pM[GM32]*pM[GM40];
337  const Double_t det2_34_03 = pM[GM30]*pM[GM43] - pM[GM33]*pM[GM40];
338  const Double_t det2_34_04 = pM[GM30]*pM[GM44] - pM[GM34]*pM[GM40];
339  const Double_t det2_34_12 = pM[GM31]*pM[GM42] - pM[GM32]*pM[GM41];
340  const Double_t det2_34_13 = pM[GM31]*pM[GM43] - pM[GM33]*pM[GM41];
341  const Double_t det2_34_14 = pM[GM31]*pM[GM44] - pM[GM34]*pM[GM41];
342  const Double_t det2_34_23 = pM[GM32]*pM[GM43] - pM[GM33]*pM[GM42];
343  const Double_t det2_34_24 = pM[GM32]*pM[GM44] - pM[GM34]*pM[GM42];
344  const Double_t det2_34_34 = pM[GM33]*pM[GM44] - pM[GM34]*pM[GM43];
345
346  // Find all NECESSARY 3x3 dets: (40 of them)
347
348  const Double_t det3_123_012 = pM[GM10]*det2_23_12 - pM[GM11]*det2_23_02 + pM[GM12]*det2_23_01;
349  const Double_t det3_123_013 = pM[GM10]*det2_23_13 - pM[GM11]*det2_23_03 + pM[GM13]*det2_23_01;
350  const Double_t det3_123_014 = pM[GM10]*det2_23_14 - pM[GM11]*det2_23_04 + pM[GM14]*det2_23_01;
351  const Double_t det3_123_023 = pM[GM10]*det2_23_23 - pM[GM12]*det2_23_03 + pM[GM13]*det2_23_02;
352  const Double_t det3_123_024 = pM[GM10]*det2_23_24 - pM[GM12]*det2_23_04 + pM[GM14]*det2_23_02;
353  const Double_t det3_123_034 = pM[GM10]*det2_23_34 - pM[GM13]*det2_23_04 + pM[GM14]*det2_23_03;
354  const Double_t det3_123_123 = pM[GM11]*det2_23_23 - pM[GM12]*det2_23_13 + pM[GM13]*det2_23_12;
355  const Double_t det3_123_124 = pM[GM11]*det2_23_24 - pM[GM12]*det2_23_14 + pM[GM14]*det2_23_12;
356  const Double_t det3_123_134 = pM[GM11]*det2_23_34 - pM[GM13]*det2_23_14 + pM[GM14]*det2_23_13;
357  const Double_t det3_123_234 = pM[GM12]*det2_23_34 - pM[GM13]*det2_23_24 + pM[GM14]*det2_23_23;
358  const Double_t det3_124_012 = pM[GM10]*det2_24_12 - pM[GM11]*det2_24_02 + pM[GM12]*det2_24_01;
359  const Double_t det3_124_013 = pM[GM10]*det2_24_13 - pM[GM11]*det2_24_03 + pM[GM13]*det2_24_01;
360  const Double_t det3_124_014 = pM[GM10]*det2_24_14 - pM[GM11]*det2_24_04 + pM[GM14]*det2_24_01;
361  const Double_t det3_124_023 = pM[GM10]*det2_24_23 - pM[GM12]*det2_24_03 + pM[GM13]*det2_24_02;
362  const Double_t det3_124_024 = pM[GM10]*det2_24_24 - pM[GM12]*det2_24_04 + pM[GM14]*det2_24_02;
363  const Double_t det3_124_034 = pM[GM10]*det2_24_34 - pM[GM13]*det2_24_04 + pM[GM14]*det2_24_03;
364  const Double_t det3_124_123 = pM[GM11]*det2_24_23 - pM[GM12]*det2_24_13 + pM[GM13]*det2_24_12;
365  const Double_t det3_124_124 = pM[GM11]*det2_24_24 - pM[GM12]*det2_24_14 + pM[GM14]*det2_24_12;
366  const Double_t det3_124_134 = pM[GM11]*det2_24_34 - pM[GM13]*det2_24_14 + pM[GM14]*det2_24_13;
367  const Double_t det3_124_234 = pM[GM12]*det2_24_34 - pM[GM13]*det2_24_24 + pM[GM14]*det2_24_23;
368  const Double_t det3_134_012 = pM[GM10]*det2_34_12 - pM[GM11]*det2_34_02 + pM[GM12]*det2_34_01;
369  const Double_t det3_134_013 = pM[GM10]*det2_34_13 - pM[GM11]*det2_34_03 + pM[GM13]*det2_34_01;
370  const Double_t det3_134_014 = pM[GM10]*det2_34_14 - pM[GM11]*det2_34_04 + pM[GM14]*det2_34_01;
371  const Double_t det3_134_023 = pM[GM10]*det2_34_23 - pM[GM12]*det2_34_03 + pM[GM13]*det2_34_02;
372  const Double_t det3_134_024 = pM[GM10]*det2_34_24 - pM[GM12]*det2_34_04 + pM[GM14]*det2_34_02;
373  const Double_t det3_134_034 = pM[GM10]*det2_34_34 - pM[GM13]*det2_34_04 + pM[GM14]*det2_34_03;
374  const Double_t det3_134_123 = pM[GM11]*det2_34_23 - pM[GM12]*det2_34_13 + pM[GM13]*det2_34_12;
375  const Double_t det3_134_124 = pM[GM11]*det2_34_24 - pM[GM12]*det2_34_14 + pM[GM14]*det2_34_12;
376  const Double_t det3_134_134 = pM[GM11]*det2_34_34 - pM[GM13]*det2_34_14 + pM[GM14]*det2_34_13;
377  const Double_t det3_134_234 = pM[GM12]*det2_34_34 - pM[GM13]*det2_34_24 + pM[GM14]*det2_34_23;
378  const Double_t det3_234_012 = pM[GM20]*det2_34_12 - pM[GM21]*det2_34_02 + pM[GM22]*det2_34_01;
379  const Double_t det3_234_013 = pM[GM20]*det2_34_13 - pM[GM21]*det2_34_03 + pM[GM23]*det2_34_01;
380  const Double_t det3_234_014 = pM[GM20]*det2_34_14 - pM[GM21]*det2_34_04 + pM[GM24]*det2_34_01;
381  const Double_t det3_234_023 = pM[GM20]*det2_34_23 - pM[GM22]*det2_34_03 + pM[GM23]*det2_34_02;
382  const Double_t det3_234_024 = pM[GM20]*det2_34_24 - pM[GM22]*det2_34_04 + pM[GM24]*det2_34_02;
383  const Double_t det3_234_034 = pM[GM20]*det2_34_34 - pM[GM23]*det2_34_04 + pM[GM24]*det2_34_03;
384  const Double_t det3_234_123 = pM[GM21]*det2_34_23 - pM[GM22]*det2_34_13 + pM[GM23]*det2_34_12;
385  const Double_t det3_234_124 = pM[GM21]*det2_34_24 - pM[GM22]*det2_34_14 + pM[GM24]*det2_34_12;
386  const Double_t det3_234_134 = pM[GM21]*det2_34_34 - pM[GM23]*det2_34_14 + pM[GM24]*det2_34_13;
387  const Double_t det3_234_234 = pM[GM22]*det2_34_34 - pM[GM23]*det2_34_24 + pM[GM24]*det2_34_23;
388
389  // Find all NECESSARY 4x4 dets: (25 of them)
390
391  const Double_t det4_0123_0123 = pM[GM00]*det3_123_123 - pM[GM01]*det3_123_023
392  + pM[GM02]*det3_123_013 - pM[GM03]*det3_123_012;
393  const Double_t det4_0123_0124 = pM[GM00]*det3_123_124 - pM[GM01]*det3_123_024
394  + pM[GM02]*det3_123_014 - pM[GM04]*det3_123_012;
395  const Double_t det4_0123_0134 = pM[GM00]*det3_123_134 - pM[GM01]*det3_123_034
396  + pM[GM03]*det3_123_014 - pM[GM04]*det3_123_013;
397  const Double_t det4_0123_0234 = pM[GM00]*det3_123_234 - pM[GM02]*det3_123_034
398  + pM[GM03]*det3_123_024 - pM[GM04]*det3_123_023;
399  const Double_t det4_0123_1234 = pM[GM01]*det3_123_234 - pM[GM02]*det3_123_134
400  + pM[GM03]*det3_123_124 - pM[GM04]*det3_123_123;
401  const Double_t det4_0124_0123 = pM[GM00]*det3_124_123 - pM[GM01]*det3_124_023
402  + pM[GM02]*det3_124_013 - pM[GM03]*det3_124_012;
403  const Double_t det4_0124_0124 = pM[GM00]*det3_124_124 - pM[GM01]*det3_124_024
404  + pM[GM02]*det3_124_014 - pM[GM04]*det3_124_012;
405  const Double_t det4_0124_0134 = pM[GM00]*det3_124_134 - pM[GM01]*det3_124_034
406  + pM[GM03]*det3_124_014 - pM[GM04]*det3_124_013;
407  const Double_t det4_0124_0234 = pM[GM00]*det3_124_234 - pM[GM02]*det3_124_034
408  + pM[GM03]*det3_124_024 - pM[GM04]*det3_124_023;
409  const Double_t det4_0124_1234 = pM[GM01]*det3_124_234 - pM[GM02]*det3_124_134
410  + pM[GM03]*det3_124_124 - pM[GM04]*det3_124_123;
411  const Double_t det4_0134_0123 = pM[GM00]*det3_134_123 - pM[GM01]*det3_134_023
412  + pM[GM02]*det3_134_013 - pM[GM03]*det3_134_012;
413  const Double_t det4_0134_0124 = pM[GM00]*det3_134_124 - pM[GM01]*det3_134_024
414  + pM[GM02]*det3_134_014 - pM[GM04]*det3_134_012;
415  const Double_t det4_0134_0134 = pM[GM00]*det3_134_134 - pM[GM01]*det3_134_034
416  + pM[GM03]*det3_134_014 - pM[GM04]*det3_134_013;
417  const Double_t det4_0134_0234 = pM[GM00]*det3_134_234 - pM[GM02]*det3_134_034
418  + pM[GM03]*det3_134_024 - pM[GM04]*det3_134_023;
419  const Double_t det4_0134_1234 = pM[GM01]*det3_134_234 - pM[GM02]*det3_134_134
420  + pM[GM03]*det3_134_124 - pM[GM04]*det3_134_123;
421  const Double_t det4_0234_0123 = pM[GM00]*det3_234_123 - pM[GM01]*det3_234_023
422  + pM[GM02]*det3_234_013 - pM[GM03]*det3_234_012;
423  const Double_t det4_0234_0124 = pM[GM00]*det3_234_124 - pM[GM01]*det3_234_024
424  + pM[GM02]*det3_234_014 - pM[GM04]*det3_234_012;
425  const Double_t det4_0234_0134 = pM[GM00]*det3_234_134 - pM[GM01]*det3_234_034
426  + pM[GM03]*det3_234_014 - pM[GM04]*det3_234_013;
427  const Double_t det4_0234_0234 = pM[GM00]*det3_234_234 - pM[GM02]*det3_234_034
428  + pM[GM03]*det3_234_024 - pM[GM04]*det3_234_023;
429  const Double_t det4_0234_1234 = pM[GM01]*det3_234_234 - pM[GM02]*det3_234_134
430  + pM[GM03]*det3_234_124 - pM[GM04]*det3_234_123;
431  const Double_t det4_1234_0123 = pM[GM10]*det3_234_123 - pM[GM11]*det3_234_023
432  + pM[GM12]*det3_234_013 - pM[GM13]*det3_234_012;
433  const Double_t det4_1234_0124 = pM[GM10]*det3_234_124 - pM[GM11]*det3_234_024
434  + pM[GM12]*det3_234_014 - pM[GM14]*det3_234_012;
435  const Double_t det4_1234_0134 = pM[GM10]*det3_234_134 - pM[GM11]*det3_234_034
436  + pM[GM13]*det3_234_014 - pM[GM14]*det3_234_013;
437  const Double_t det4_1234_0234 = pM[GM10]*det3_234_234 - pM[GM12]*det3_234_034
438  + pM[GM13]*det3_234_024 - pM[GM14]*det3_234_023;
439  const Double_t det4_1234_1234 = pM[GM11]*det3_234_234 - pM[GM12]*det3_234_134
440  + pM[GM13]*det3_234_124 - pM[GM14]*det3_234_123;
441
442  // Find the 5x5 det:
443
444  const Double_t det = pM[GM00]*det4_1234_1234 - pM[GM01]*det4_1234_0234 + pM[GM02]*det4_1234_0134
445  - pM[GM03]*det4_1234_0124 + pM[GM04]*det4_1234_0123;
446  if (determ)
447  *determ = det;
448
449  if ( det == 0 ) {
450  Error("Inv5x5","matrix is singular");
451  return kFALSE;
452  }
453
454  const Double_t oneOverDet = 1.0/det;
455  const Double_t mn1OverDet = - oneOverDet;
456
457  pM[GM00] = det4_1234_1234 * oneOverDet;
458  pM[GM01] = det4_0234_1234 * mn1OverDet;
459  pM[GM02] = det4_0134_1234 * oneOverDet;
460  pM[GM03] = det4_0124_1234 * mn1OverDet;
461  pM[GM04] = det4_0123_1234 * oneOverDet;
462
463  pM[GM10] = det4_1234_0234 * mn1OverDet;
464  pM[GM11] = det4_0234_0234 * oneOverDet;
465  pM[GM12] = det4_0134_0234 * mn1OverDet;
466  pM[GM13] = det4_0124_0234 * oneOverDet;
467  pM[GM14] = det4_0123_0234 * mn1OverDet;
468
469  pM[GM20] = det4_1234_0134 * oneOverDet;
470  pM[GM21] = det4_0234_0134 * mn1OverDet;
471  pM[GM22] = det4_0134_0134 * oneOverDet;
472  pM[GM23] = det4_0124_0134 * mn1OverDet;
473  pM[GM24] = det4_0123_0134 * oneOverDet;
474
475  pM[GM30] = det4_1234_0124 * mn1OverDet;
476  pM[GM31] = det4_0234_0124 * oneOverDet;
477  pM[GM32] = det4_0134_0124 * mn1OverDet;
478  pM[GM33] = det4_0124_0124 * oneOverDet;
479  pM[GM34] = det4_0123_0124 * mn1OverDet;
480
481  pM[GM40] = det4_1234_0123 * oneOverDet;
482  pM[GM41] = det4_0234_0123 * mn1OverDet;
483  pM[GM42] = det4_0134_0123 * oneOverDet;
484  pM[GM43] = det4_0124_0123 * mn1OverDet;
485  pM[GM44] = det4_0123_0123 * oneOverDet;
486
487  return kTRUE;
488 }
489
490 // Aij are indices for a 6x6 matrix.
491
492 #define GA00 0
493 #define GA01 1
494 #define GA02 2
495 #define GA03 3
496 #define GA04 4
497 #define GA05 5
498
499 #define GA10 6
500 #define GA11 7
501 #define GA12 8
502 #define GA13 9
503 #define GA14 10
504 #define GA15 11
505
506 #define GA20 12
507 #define GA21 13
508 #define GA22 14
509 #define GA23 15
510 #define GA24 16
511 #define GA25 17
512
513 #define GA30 18
514 #define GA31 19
515 #define GA32 20
516 #define GA33 21
517 #define GA34 22
518 #define GA35 23
519
520 #define GA40 24
521 #define GA41 25
522 #define GA42 26
523 #define GA43 27
524 #define GA44 28
525 #define GA45 29
526
527 #define GA50 30
528 #define GA51 31
529 #define GA52 32
530 #define GA53 33
531 #define GA54 34
532 #define GA55 35
533
534 ////////////////////////////////////////////////////////////////////////////////
535
536 template<class Element>
538 {
539  if (m.GetNrows() != 6 || m.GetNcols() != 6 || m.GetRowLwb() != m.GetColLwb()) {
540  Error("Inv6x6","matrix should be square 6x6");
541  return kFALSE;
542  }
543
544  Element *pM = m.GetMatrixArray();
545
546  // Find all NECESSGARY 2x2 dets: (45 of them)
547
548  const Double_t det2_34_01 = pM[GA30]*pM[GA41] - pM[GA31]*pM[GA40];
549  const Double_t det2_34_02 = pM[GA30]*pM[GA42] - pM[GA32]*pM[GA40];
550  const Double_t det2_34_03 = pM[GA30]*pM[GA43] - pM[GA33]*pM[GA40];
551  const Double_t det2_34_04 = pM[GA30]*pM[GA44] - pM[GA34]*pM[GA40];
552  const Double_t det2_34_05 = pM[GA30]*pM[GA45] - pM[GA35]*pM[GA40];
553  const Double_t det2_34_12 = pM[GA31]*pM[GA42] - pM[GA32]*pM[GA41];
554  const Double_t det2_34_13 = pM[GA31]*pM[GA43] - pM[GA33]*pM[GA41];
555  const Double_t det2_34_14 = pM[GA31]*pM[GA44] - pM[GA34]*pM[GA41];
556  const Double_t det2_34_15 = pM[GA31]*pM[GA45] - pM[GA35]*pM[GA41];
557  const Double_t det2_34_23 = pM[GA32]*pM[GA43] - pM[GA33]*pM[GA42];
558  const Double_t det2_34_24 = pM[GA32]*pM[GA44] - pM[GA34]*pM[GA42];
559  const Double_t det2_34_25 = pM[GA32]*pM[GA45] - pM[GA35]*pM[GA42];
560  const Double_t det2_34_34 = pM[GA33]*pM[GA44] - pM[GA34]*pM[GA43];
561  const Double_t det2_34_35 = pM[GA33]*pM[GA45] - pM[GA35]*pM[GA43];
562  const Double_t det2_34_45 = pM[GA34]*pM[GA45] - pM[GA35]*pM[GA44];
563  const Double_t det2_35_01 = pM[GA30]*pM[GA51] - pM[GA31]*pM[GA50];
564  const Double_t det2_35_02 = pM[GA30]*pM[GA52] - pM[GA32]*pM[GA50];
565  const Double_t det2_35_03 = pM[GA30]*pM[GA53] - pM[GA33]*pM[GA50];
566  const Double_t det2_35_04 = pM[GA30]*pM[GA54] - pM[GA34]*pM[GA50];
567  const Double_t det2_35_05 = pM[GA30]*pM[GA55] - pM[GA35]*pM[GA50];
568  const Double_t det2_35_12 = pM[GA31]*pM[GA52] - pM[GA32]*pM[GA51];
569  const Double_t det2_35_13 = pM[GA31]*pM[GA53] - pM[GA33]*pM[GA51];
570  const Double_t det2_35_14 = pM[GA31]*pM[GA54] - pM[GA34]*pM[GA51];
571  const Double_t det2_35_15 = pM[GA31]*pM[GA55] - pM[GA35]*pM[GA51];
572  const Double_t det2_35_23 = pM[GA32]*pM[GA53] - pM[GA33]*pM[GA52];
573  const Double_t det2_35_24 = pM[GA32]*pM[GA54] - pM[GA34]*pM[GA52];
574  const Double_t det2_35_25 = pM[GA32]*pM[GA55] - pM[GA35]*pM[GA52];
575  const Double_t det2_35_34 = pM[GA33]*pM[GA54] - pM[GA34]*pM[GA53];
576  const Double_t det2_35_35 = pM[GA33]*pM[GA55] - pM[GA35]*pM[GA53];
577  const Double_t det2_35_45 = pM[GA34]*pM[GA55] - pM[GA35]*pM[GA54];
578  const Double_t det2_45_01 = pM[GA40]*pM[GA51] - pM[GA41]*pM[GA50];
579  const Double_t det2_45_02 = pM[GA40]*pM[GA52] - pM[GA42]*pM[GA50];
580  const Double_t det2_45_03 = pM[GA40]*pM[GA53] - pM[GA43]*pM[GA50];
581  const Double_t det2_45_04 = pM[GA40]*pM[GA54] - pM[GA44]*pM[GA50];
582  const Double_t det2_45_05 = pM[GA40]*pM[GA55] - pM[GA45]*pM[GA50];
583  const Double_t det2_45_12 = pM[GA41]*pM[GA52] - pM[GA42]*pM[GA51];
584  const Double_t det2_45_13 = pM[GA41]*pM[GA53] - pM[GA43]*pM[GA51];
585  const Double_t det2_45_14 = pM[GA41]*pM[GA54] - pM[GA44]*pM[GA51];
586  const Double_t det2_45_15 = pM[GA41]*pM[GA55] - pM[GA45]*pM[GA51];
587  const Double_t det2_45_23 = pM[GA42]*pM[GA53] - pM[GA43]*pM[GA52];
588  const Double_t det2_45_24 = pM[GA42]*pM[GA54] - pM[GA44]*pM[GA52];
589  const Double_t det2_45_25 = pM[GA42]*pM[GA55] - pM[GA45]*pM[GA52];
590  const Double_t det2_45_34 = pM[GA43]*pM[GA54] - pM[GA44]*pM[GA53];
591  const Double_t det2_45_35 = pM[GA43]*pM[GA55] - pM[GA45]*pM[GA53];
592  const Double_t det2_45_45 = pM[GA44]*pM[GA55] - pM[GA45]*pM[GA54];
593
594  // Find all NECESSGARY 3x3 dets: (80 of them)
595
596  const Double_t det3_234_012 = pM[GA20]*det2_34_12 - pM[GA21]*det2_34_02 + pM[GA22]*det2_34_01;
597  const Double_t det3_234_013 = pM[GA20]*det2_34_13 - pM[GA21]*det2_34_03 + pM[GA23]*det2_34_01;
598  const Double_t det3_234_014 = pM[GA20]*det2_34_14 - pM[GA21]*det2_34_04 + pM[GA24]*det2_34_01;
599  const Double_t det3_234_015 = pM[GA20]*det2_34_15 - pM[GA21]*det2_34_05 + pM[GA25]*det2_34_01;
600  const Double_t det3_234_023 = pM[GA20]*det2_34_23 - pM[GA22]*det2_34_03 + pM[GA23]*det2_34_02;
601  const Double_t det3_234_024 = pM[GA20]*det2_34_24 - pM[GA22]*det2_34_04 + pM[GA24]*det2_34_02;
602  const Double_t det3_234_025 = pM[GA20]*det2_34_25 - pM[GA22]*det2_34_05 + pM[GA25]*det2_34_02;
603  const Double_t det3_234_034 = pM[GA20]*det2_34_34 - pM[GA23]*det2_34_04 + pM[GA24]*det2_34_03;
604  const Double_t det3_234_035 = pM[GA20]*det2_34_35 - pM[GA23]*det2_34_05 + pM[GA25]*det2_34_03;
605  const Double_t det3_234_045 = pM[GA20]*det2_34_45 - pM[GA24]*det2_34_05 + pM[GA25]*det2_34_04;
606  const Double_t det3_234_123 = pM[GA21]*det2_34_23 - pM[GA22]*det2_34_13 + pM[GA23]*det2_34_12;
607  const Double_t det3_234_124 = pM[GA21]*det2_34_24 - pM[GA22]*det2_34_14 + pM[GA24]*det2_34_12;
608  const Double_t det3_234_125 = pM[GA21]*det2_34_25 - pM[GA22]*det2_34_15 + pM[GA25]*det2_34_12;
609  const Double_t det3_234_134 = pM[GA21]*det2_34_34 - pM[GA23]*det2_34_14 + pM[GA24]*det2_34_13;
610  const Double_t det3_234_135 = pM[GA21]*det2_34_35 - pM[GA23]*det2_34_15 + pM[GA25]*det2_34_13;
611  const Double_t det3_234_145 = pM[GA21]*det2_34_45 - pM[GA24]*det2_34_15 + pM[GA25]*det2_34_14;
612  const Double_t det3_234_234 = pM[GA22]*det2_34_34 - pM[GA23]*det2_34_24 + pM[GA24]*det2_34_23;
613  const Double_t det3_234_235 = pM[GA22]*det2_34_35 - pM[GA23]*det2_34_25 + pM[GA25]*det2_34_23;
614  const Double_t det3_234_245 = pM[GA22]*det2_34_45 - pM[GA24]*det2_34_25 + pM[GA25]*det2_34_24;
615  const Double_t det3_234_345 = pM[GA23]*det2_34_45 - pM[GA24]*det2_34_35 + pM[GA25]*det2_34_34;
616  const Double_t det3_235_012 = pM[GA20]*det2_35_12 - pM[GA21]*det2_35_02 + pM[GA22]*det2_35_01;
617  const Double_t det3_235_013 = pM[GA20]*det2_35_13 - pM[GA21]*det2_35_03 + pM[GA23]*det2_35_01;
618  const Double_t det3_235_014 = pM[GA20]*det2_35_14 - pM[GA21]*det2_35_04 + pM[GA24]*det2_35_01;
619  const Double_t det3_235_015 = pM[GA20]*det2_35_15 - pM[GA21]*det2_35_05 + pM[GA25]*det2_35_01;
620  const Double_t det3_235_023 = pM[GA20]*det2_35_23 - pM[GA22]*det2_35_03 + pM[GA23]*det2_35_02;
621  const Double_t det3_235_024 = pM[GA20]*det2_35_24 - pM[GA22]*det2_35_04 + pM[GA24]*det2_35_02;
622  const Double_t det3_235_025 = pM[GA20]*det2_35_25 - pM[GA22]*det2_35_05 + pM[GA25]*det2_35_02;
623  const Double_t det3_235_034 = pM[GA20]*det2_35_34 - pM[GA23]*det2_35_04 + pM[GA24]*det2_35_03;
624  const Double_t det3_235_035 = pM[GA20]*det2_35_35 - pM[GA23]*det2_35_05 + pM[GA25]*det2_35_03;
625  const Double_t det3_235_045 = pM[GA20]*det2_35_45 - pM[GA24]*det2_35_05 + pM[GA25]*det2_35_04;
626  const Double_t det3_235_123 = pM[GA21]*det2_35_23 - pM[GA22]*det2_35_13 + pM[GA23]*det2_35_12;
627  const Double_t det3_235_124 = pM[GA21]*det2_35_24 - pM[GA22]*det2_35_14 + pM[GA24]*det2_35_12;
628  const Double_t det3_235_125 = pM[GA21]*det2_35_25 - pM[GA22]*det2_35_15 + pM[GA25]*det2_35_12;
629  const Double_t det3_235_134 = pM[GA21]*det2_35_34 - pM[GA23]*det2_35_14 + pM[GA24]*det2_35_13;
630  const Double_t det3_235_135 = pM[GA21]*det2_35_35 - pM[GA23]*det2_35_15 + pM[GA25]*det2_35_13;
631  const Double_t det3_235_145 = pM[GA21]*det2_35_45 - pM[GA24]*det2_35_15 + pM[GA25]*det2_35_14;
632  const Double_t det3_235_234 = pM[GA22]*det2_35_34 - pM[GA23]*det2_35_24 + pM[GA24]*det2_35_23;
633  const Double_t det3_235_235 = pM[GA22]*det2_35_35 - pM[GA23]*det2_35_25 + pM[GA25]*det2_35_23;
634  const Double_t det3_235_245 = pM[GA22]*det2_35_45 - pM[GA24]*det2_35_25 + pM[GA25]*det2_35_24;
635  const Double_t det3_235_345 = pM[GA23]*det2_35_45 - pM[GA24]*det2_35_35 + pM[GA25]*det2_35_34;
636  const Double_t det3_245_012 = pM[GA20]*det2_45_12 - pM[GA21]*det2_45_02 + pM[GA22]*det2_45_01;
637  const Double_t det3_245_013 = pM[GA20]*det2_45_13 - pM[GA21]*det2_45_03 + pM[GA23]*det2_45_01;
638  const Double_t det3_245_014 = pM[GA20]*det2_45_14 - pM[GA21]*det2_45_04 + pM[GA24]*det2_45_01;
639  const Double_t det3_245_015 = pM[GA20]*det2_45_15 - pM[GA21]*det2_45_05 + pM[GA25]*det2_45_01;
640  const Double_t det3_245_023 = pM[GA20]*det2_45_23 - pM[GA22]*det2_45_03 + pM[GA23]*det2_45_02;
641  const Double_t det3_245_024 = pM[GA20]*det2_45_24 - pM[GA22]*det2_45_04 + pM[GA24]*det2_45_02;
642  const Double_t det3_245_025 = pM[GA20]*det2_45_25 - pM[GA22]*det2_45_05 + pM[GA25]*det2_45_02;
643  const Double_t det3_245_034 = pM[GA20]*det2_45_34 - pM[GA23]*det2_45_04 + pM[GA24]*det2_45_03;
644  const Double_t det3_245_035 = pM[GA20]*det2_45_35 - pM[GA23]*det2_45_05 + pM[GA25]*det2_45_03;
645  const Double_t det3_245_045 = pM[GA20]*det2_45_45 - pM[GA24]*det2_45_05 + pM[GA25]*det2_45_04;
646  const Double_t det3_245_123 = pM[GA21]*det2_45_23 - pM[GA22]*det2_45_13 + pM[GA23]*det2_45_12;
647  const Double_t det3_245_124 = pM[GA21]*det2_45_24 - pM[GA22]*det2_45_14 + pM[GA24]*det2_45_12;
648  const Double_t det3_245_125 = pM[GA21]*det2_45_25 - pM[GA22]*det2_45_15 + pM[GA25]*det2_45_12;
649  const Double_t det3_245_134 = pM[GA21]*det2_45_34 - pM[GA23]*det2_45_14 + pM[GA24]*det2_45_13;
650  const Double_t det3_245_135 = pM[GA21]*det2_45_35 - pM[GA23]*det2_45_15 + pM[GA25]*det2_45_13;
651  const Double_t det3_245_145 = pM[GA21]*det2_45_45 - pM[GA24]*det2_45_15 + pM[GA25]*det2_45_14;
652  const Double_t det3_245_234 = pM[GA22]*det2_45_34 - pM[GA23]*det2_45_24 + pM[GA24]*det2_45_23;
653  const Double_t det3_245_235 = pM[GA22]*det2_45_35 - pM[GA23]*det2_45_25 + pM[GA25]*det2_45_23;
654  const Double_t det3_245_245 = pM[GA22]*det2_45_45 - pM[GA24]*det2_45_25 + pM[GA25]*det2_45_24;
655  const Double_t det3_245_345 = pM[GA23]*det2_45_45 - pM[GA24]*det2_45_35 + pM[GA25]*det2_45_34;
656  const Double_t det3_345_012 = pM[GA30]*det2_45_12 - pM[GA31]*det2_45_02 + pM[GA32]*det2_45_01;
657  const Double_t det3_345_013 = pM[GA30]*det2_45_13 - pM[GA31]*det2_45_03 + pM[GA33]*det2_45_01;
658  const Double_t det3_345_014 = pM[GA30]*det2_45_14 - pM[GA31]*det2_45_04 + pM[GA34]*det2_45_01;
659  const Double_t det3_345_015 = pM[GA30]*det2_45_15 - pM[GA31]*det2_45_05 + pM[GA35]*det2_45_01;
660  const Double_t det3_345_023 = pM[GA30]*det2_45_23 - pM[GA32]*det2_45_03 + pM[GA33]*det2_45_02;
661  const Double_t det3_345_024 = pM[GA30]*det2_45_24 - pM[GA32]*det2_45_04 + pM[GA34]*det2_45_02;
662  const Double_t det3_345_025 = pM[GA30]*det2_45_25 - pM[GA32]*det2_45_05 + pM[GA35]*det2_45_02;
663  const Double_t det3_345_034 = pM[GA30]*det2_45_34 - pM[GA33]*det2_45_04 + pM[GA34]*det2_45_03;
664  const Double_t det3_345_035 = pM[GA30]*det2_45_35 - pM[GA33]*det2_45_05 + pM[GA35]*det2_45_03;
665  const Double_t det3_345_045 = pM[GA30]*det2_45_45 - pM[GA34]*det2_45_05 + pM[GA35]*det2_45_04;
666  const Double_t det3_345_123 = pM[GA31]*det2_45_23 - pM[GA32]*det2_45_13 + pM[GA33]*det2_45_12;
667  const Double_t det3_345_124 = pM[GA31]*det2_45_24 - pM[GA32]*det2_45_14 + pM[GA34]*det2_45_12;
668  const Double_t det3_345_125 = pM[GA31]*det2_45_25 - pM[GA32]*det2_45_15 + pM[GA35]*det2_45_12;
669  const Double_t det3_345_134 = pM[GA31]*det2_45_34 - pM[GA33]*det2_45_14 + pM[GA34]*det2_45_13;
670  const Double_t det3_345_135 = pM[GA31]*det2_45_35 - pM[GA33]*det2_45_15 + pM[GA35]*det2_45_13;
671  const Double_t det3_345_145 = pM[GA31]*det2_45_45 - pM[GA34]*det2_45_15 + pM[GA35]*det2_45_14;
672  const Double_t det3_345_234 = pM[GA32]*det2_45_34 - pM[GA33]*det2_45_24 + pM[GA34]*det2_45_23;
673  const Double_t det3_345_235 = pM[GA32]*det2_45_35 - pM[GA33]*det2_45_25 + pM[GA35]*det2_45_23;
674  const Double_t det3_345_245 = pM[GA32]*det2_45_45 - pM[GA34]*det2_45_25 + pM[GA35]*det2_45_24;
675  const Double_t det3_345_345 = pM[GA33]*det2_45_45 - pM[GA34]*det2_45_35 + pM[GA35]*det2_45_34;
676
677  // Find all NECESSGARY 4x4 dets: (75 of them)
678
679  const Double_t det4_1234_0123 = pM[GA10]*det3_234_123 - pM[GA11]*det3_234_023
680  + pM[GA12]*det3_234_013 - pM[GA13]*det3_234_012;
681  const Double_t det4_1234_0124 = pM[GA10]*det3_234_124 - pM[GA11]*det3_234_024
682  + pM[GA12]*det3_234_014 - pM[GA14]*det3_234_012;
683  const Double_t det4_1234_0125 = pM[GA10]*det3_234_125 - pM[GA11]*det3_234_025
684  + pM[GA12]*det3_234_015 - pM[GA15]*det3_234_012;
685  const Double_t det4_1234_0134 = pM[GA10]*det3_234_134 - pM[GA11]*det3_234_034
686  + pM[GA13]*det3_234_014 - pM[GA14]*det3_234_013;
687  const Double_t det4_1234_0135 = pM[GA10]*det3_234_135 - pM[GA11]*det3_234_035
688  + pM[GA13]*det3_234_015 - pM[GA15]*det3_234_013;
689  const Double_t det4_1234_0145 = pM[GA10]*det3_234_145 - pM[GA11]*det3_234_045
690  + pM[GA14]*det3_234_015 - pM[GA15]*det3_234_014;
691  const Double_t det4_1234_0234 = pM[GA10]*det3_234_234 - pM[GA12]*det3_234_034
692  + pM[GA13]*det3_234_024 - pM[GA14]*det3_234_023;
693  const Double_t det4_1234_0235 = pM[GA10]*det3_234_235 - pM[GA12]*det3_234_035
694  + pM[GA13]*det3_234_025 - pM[GA15]*det3_234_023;
695  const Double_t det4_1234_0245 = pM[GA10]*det3_234_245 - pM[GA12]*det3_234_045
696  + pM[GA14]*det3_234_025 - pM[GA15]*det3_234_024;
697  const Double_t det4_1234_0345 = pM[GA10]*det3_234_345 - pM[GA13]*det3_234_045
698  + pM[GA14]*det3_234_035 - pM[GA15]*det3_234_034;
699  const Double_t det4_1234_1234 = pM[GA11]*det3_234_234 - pM[GA12]*det3_234_134
700  + pM[GA13]*det3_234_124 - pM[GA14]*det3_234_123;
701  const Double_t det4_1234_1235 = pM[GA11]*det3_234_235 - pM[GA12]*det3_234_135
702  + pM[GA13]*det3_234_125 - pM[GA15]*det3_234_123;
703  const Double_t det4_1234_1245 = pM[GA11]*det3_234_245 - pM[GA12]*det3_234_145
704  + pM[GA14]*det3_234_125 - pM[GA15]*det3_234_124;
705  const Double_t det4_1234_1345 = pM[GA11]*det3_234_345 - pM[GA13]*det3_234_145
706  + pM[GA14]*det3_234_135 - pM[GA15]*det3_234_134;
707  const Double_t det4_1234_2345 = pM[GA12]*det3_234_345 - pM[GA13]*det3_234_245
708  + pM[GA14]*det3_234_235 - pM[GA15]*det3_234_234;
709  const Double_t det4_1235_0123 = pM[GA10]*det3_235_123 - pM[GA11]*det3_235_023
710  + pM[GA12]*det3_235_013 - pM[GA13]*det3_235_012;
711  const Double_t det4_1235_0124 = pM[GA10]*det3_235_124 - pM[GA11]*det3_235_024
712  + pM[GA12]*det3_235_014 - pM[GA14]*det3_235_012;
713  const Double_t det4_1235_0125 = pM[GA10]*det3_235_125 - pM[GA11]*det3_235_025
714  + pM[GA12]*det3_235_015 - pM[GA15]*det3_235_012;
715  const Double_t det4_1235_0134 = pM[GA10]*det3_235_134 - pM[GA11]*det3_235_034
716  + pM[GA13]*det3_235_014 - pM[GA14]*det3_235_013;
717  const Double_t det4_1235_0135 = pM[GA10]*det3_235_135 - pM[GA11]*det3_235_035
718  + pM[GA13]*det3_235_015 - pM[GA15]*det3_235_013;
719  const Double_t det4_1235_0145 = pM[GA10]*det3_235_145 - pM[GA11]*det3_235_045
720  + pM[GA14]*det3_235_015 - pM[GA15]*det3_235_014;
721  const Double_t det4_1235_0234 = pM[GA10]*det3_235_234 - pM[GA12]*det3_235_034
722  + pM[GA13]*det3_235_024 - pM[GA14]*det3_235_023;
723  const Double_t det4_1235_0235 = pM[GA10]*det3_235_235 - pM[GA12]*det3_235_035
724  + pM[GA13]*det3_235_025 - pM[GA15]*det3_235_023;
725  const Double_t det4_1235_0245 = pM[GA10]*det3_235_245 - pM[GA12]*det3_235_045
726  + pM[GA14]*det3_235_025 - pM[GA15]*det3_235_024;
727  const Double_t det4_1235_0345 = pM[GA10]*det3_235_345 - pM[GA13]*det3_235_045
728  + pM[GA14]*det3_235_035 - pM[GA15]*det3_235_034;
729  const Double_t det4_1235_1234 = pM[GA11]*det3_235_234 - pM[GA12]*det3_235_134
730  + pM[GA13]*det3_235_124 - pM[GA14]*det3_235_123;
731  const Double_t det4_1235_1235 = pM[GA11]*det3_235_235 - pM[GA12]*det3_235_135
732  + pM[GA13]*det3_235_125 - pM[GA15]*det3_235_123;
733  const Double_t det4_1235_1245 = pM[GA11]*det3_235_245 - pM[GA12]*det3_235_145
734  + pM[GA14]*det3_235_125 - pM[GA15]*det3_235_124;
735  const Double_t det4_1235_1345 = pM[GA11]*det3_235_345 - pM[GA13]*det3_235_145
736  + pM[GA14]*det3_235_135 - pM[GA15]*det3_235_134;
737  const Double_t det4_1235_2345 = pM[GA12]*det3_235_345 - pM[GA13]*det3_235_245
738  + pM[GA14]*det3_235_235 - pM[GA15]*det3_235_234;
739  const Double_t det4_1245_0123 = pM[GA10]*det3_245_123 - pM[GA11]*det3_245_023
740  + pM[GA12]*det3_245_013 - pM[GA13]*det3_245_012;
741  const Double_t det4_1245_0124 = pM[GA10]*det3_245_124 - pM[GA11]*det3_245_024
742  + pM[GA12]*det3_245_014 - pM[GA14]*det3_245_012;
743  const Double_t det4_1245_0125 = pM[GA10]*det3_245_125 - pM[GA11]*det3_245_025
744  + pM[GA12]*det3_245_015 - pM[GA15]*det3_245_012;
745  const Double_t det4_1245_0134 = pM[GA10]*det3_245_134 - pM[GA11]*det3_245_034
746  + pM[GA13]*det3_245_014 - pM[GA14]*det3_245_013;
747  const Double_t det4_1245_0135 = pM[GA10]*det3_245_135 - pM[GA11]*det3_245_035
748  + pM[GA13]*det3_245_015 - pM[GA15]*det3_245_013;
749  const Double_t det4_1245_0145 = pM[GA10]*det3_245_145 - pM[GA11]*det3_245_045
750  + pM[GA14]*det3_245_015 - pM[GA15]*det3_245_014;
751  const Double_t det4_1245_0234 = pM[GA10]*det3_245_234 - pM[GA12]*det3_245_034
752  + pM[GA13]*det3_245_024 - pM[GA14]*det3_245_023;
753  const Double_t det4_1245_0235 = pM[GA10]*det3_245_235 - pM[GA12]*det3_245_035
754  + pM[GA13]*det3_245_025 - pM[GA15]*det3_245_023;
755  const Double_t det4_1245_0245 = pM[GA10]*det3_245_245 - pM[GA12]*det3_245_045
756  + pM[GA14]*det3_245_025 - pM[GA15]*det3_245_024;
757  const Double_t det4_1245_0345 = pM[GA10]*det3_245_345 - pM[GA13]*det3_245_045
758  + pM[GA14]*det3_245_035 - pM[GA15]*det3_245_034;
759  const Double_t det4_1245_1234 = pM[GA11]*det3_245_234 - pM[GA12]*det3_245_134
760  + pM[GA13]*det3_245_124 - pM[GA14]*det3_245_123;
761  const Double_t det4_1245_1235 = pM[GA11]*det3_245_235 - pM[GA12]*det3_245_135
762  + pM[GA13]*det3_245_125 - pM[GA15]*det3_245_123;
763  const Double_t det4_1245_1245 = pM[GA11]*det3_245_245 - pM[GA12]*det3_245_145
764  + pM[GA14]*det3_245_125 - pM[GA15]*det3_245_124;
765  const Double_t det4_1245_1345 = pM[GA11]*det3_245_345 - pM[GA13]*det3_245_145
766  + pM[GA14]*det3_245_135 - pM[GA15]*det3_245_134;
767  const Double_t det4_1245_2345 = pM[GA12]*det3_245_345 - pM[GA13]*det3_245_245
768  + pM[GA14]*det3_245_235 - pM[GA15]*det3_245_234;
769  const Double_t det4_1345_0123 = pM[GA10]*det3_345_123 - pM[GA11]*det3_345_023
770  + pM[GA12]*det3_345_013 - pM[GA13]*det3_345_012;
771  const Double_t det4_1345_0124 = pM[GA10]*det3_345_124 - pM[GA11]*det3_345_024
772  + pM[GA12]*det3_345_014 - pM[GA14]*det3_345_012;
773  const Double_t det4_1345_0125 = pM[GA10]*det3_345_125 - pM[GA11]*det3_345_025
774  + pM[GA12]*det3_345_015 - pM[GA15]*det3_345_012;
775  const Double_t det4_1345_0134 = pM[GA10]*det3_345_134 - pM[GA11]*det3_345_034
776  + pM[GA13]*det3_345_014 - pM[GA14]*det3_345_013;
777  const Double_t det4_1345_0135 = pM[GA10]*det3_345_135 - pM[GA11]*det3_345_035
778  + pM[GA13]*det3_345_015 - pM[GA15]*det3_345_013;
779  const Double_t det4_1345_0145 = pM[GA10]*det3_345_145 - pM[GA11]*det3_345_045
780  + pM[GA14]*det3_345_015 - pM[GA15]*det3_345_014;
781  const Double_t det4_1345_0234 = pM[GA10]*det3_345_234 - pM[GA12]*det3_345_034
782  + pM[GA13]*det3_345_024 - pM[GA14]*det3_345_023;
783  const Double_t det4_1345_0235 = pM[GA10]*det3_345_235 - pM[GA12]*det3_345_035
784  + pM[GA13]*det3_345_025 - pM[GA15]*det3_345_023;
785  const Double_t det4_1345_0245 = pM[GA10]*det3_345_245 - pM[GA12]*det3_345_045
786  + pM[GA14]*det3_345_025 - pM[GA15]*det3_345_024;
787  const Double_t det4_1345_0345 = pM[GA10]*det3_345_345 - pM[GA13]*det3_345_045
788  + pM[GA14]*det3_345_035 - pM[GA15]*det3_345_034;
789  const Double_t det4_1345_1234 = pM[GA11]*det3_345_234 - pM[GA12]*det3_345_134
790  + pM[GA13]*det3_345_124 - pM[GA14]*det3_345_123;
791  const Double_t det4_1345_1235 = pM[GA11]*det3_345_235 - pM[GA12]*det3_345_135
792  + pM[GA13]*det3_345_125 - pM[GA15]*det3_345_123;
793  const Double_t det4_1345_1245 = pM[GA11]*det3_345_245 - pM[GA12]*det3_345_145
794  + pM[GA14]*det3_345_125 - pM[GA15]*det3_345_124;
795  const Double_t det4_1345_1345 = pM[GA11]*det3_345_345 - pM[GA13]*det3_345_145
796  + pM[GA14]*det3_345_135 - pM[GA15]*det3_345_134;
797  const Double_t det4_1345_2345 = pM[GA12]*det3_345_345 - pM[GA13]*det3_345_245
798  + pM[GA14]*det3_345_235 - pM[GA15]*det3_345_234;
799  const Double_t det4_2345_0123 = pM[GA20]*det3_345_123 - pM[GA21]*det3_345_023
800  + pM[GA22]*det3_345_013 - pM[GA23]*det3_345_012;
801  const Double_t det4_2345_0124 = pM[GA20]*det3_345_124 - pM[GA21]*det3_345_024
802  + pM[GA22]*det3_345_014 - pM[GA24]*det3_345_012;
803  const Double_t det4_2345_0125 = pM[GA20]*det3_345_125 - pM[GA21]*det3_345_025
804  + pM[GA22]*det3_345_015 - pM[GA25]*det3_345_012;
805  const Double_t det4_2345_0134 = pM[GA20]*det3_345_134 - pM[GA21]*det3_345_034
806  + pM[GA23]*det3_345_014 - pM[GA24]*det3_345_013;
807  const Double_t det4_2345_0135 = pM[GA20]*det3_345_135 - pM[GA21]*det3_345_035
808  + pM[GA23]*det3_345_015 - pM[GA25]*det3_345_013;
809  const Double_t det4_2345_0145 = pM[GA20]*det3_345_145 - pM[GA21]*det3_345_045
810  + pM[GA24]*det3_345_015 - pM[GA25]*det3_345_014;
811  const Double_t det4_2345_0234 = pM[GA20]*det3_345_234 - pM[GA22]*det3_345_034
812  + pM[GA23]*det3_345_024 - pM[GA24]*det3_345_023;
813  const Double_t det4_2345_0235 = pM[GA20]*det3_345_235 - pM[GA22]*det3_345_035
814  + pM[GA23]*det3_345_025 - pM[GA25]*det3_345_023;
815  const Double_t det4_2345_0245 = pM[GA20]*det3_345_245 - pM[GA22]*det3_345_045
816  + pM[GA24]*det3_345_025 - pM[GA25]*det3_345_024;
817  const Double_t det4_2345_0345 = pM[GA20]*det3_345_345 - pM[GA23]*det3_345_045
818  + pM[GA24]*det3_345_035 - pM[GA25]*det3_345_034;
819  const Double_t det4_2345_1234 = pM[GA21]*det3_345_234 - pM[GA22]*det3_345_134
820  + pM[GA23]*det3_345_124 - pM[GA24]*det3_345_123;
821  const Double_t det4_2345_1235 = pM[GA21]*det3_345_235 - pM[GA22]*det3_345_135
822  + pM[GA23]*det3_345_125 - pM[GA25]*det3_345_123;
823  const Double_t det4_2345_1245 = pM[GA21]*det3_345_245 - pM[GA22]*det3_345_145
824  + pM[GA24]*det3_345_125 - pM[GA25]*det3_345_124;
825  const Double_t det4_2345_1345 = pM[GA21]*det3_345_345 - pM[GA23]*det3_345_145
826  + pM[GA24]*det3_345_135 - pM[GA25]*det3_345_134;
827  const Double_t det4_2345_2345 = pM[GA22]*det3_345_345 - pM[GA23]*det3_345_245
828  + pM[GA24]*det3_345_235 - pM[GA25]*det3_345_234;
829
830  // Find all NECESSGARY 5x5 dets: (36 of them)
831
832  const Double_t det5_01234_01234 = pM[GA00]*det4_1234_1234 - pM[GA01]*det4_1234_0234
833  + pM[GA02]*det4_1234_0134 - pM[GA03]*det4_1234_0124 + pM[GA04]*det4_1234_0123;
834  const Double_t det5_01234_01235 = pM[GA00]*det4_1234_1235 - pM[GA01]*det4_1234_0235
835  + pM[GA02]*det4_1234_0135 - pM[GA03]*det4_1234_0125 + pM[GA05]*det4_1234_0123;
836  const Double_t det5_01234_01245 = pM[GA00]*det4_1234_1245 - pM[GA01]*det4_1234_0245
837  + pM[GA02]*det4_1234_0145 - pM[GA04]*det4_1234_0125 + pM[GA05]*det4_1234_0124;
838  const Double_t det5_01234_01345 = pM[GA00]*det4_1234_1345 - pM[GA01]*det4_1234_0345
839  + pM[GA03]*det4_1234_0145 - pM[GA04]*det4_1234_0135 + pM[GA05]*det4_1234_0134;
840  const Double_t det5_01234_02345 = pM[GA00]*det4_1234_2345 - pM[GA02]*det4_1234_0345
841  + pM[GA03]*det4_1234_0245 - pM[GA04]*det4_1234_0235 + pM[GA05]*det4_1234_0234;
842  const Double_t det5_01234_12345 = pM[GA01]*det4_1234_2345 - pM[GA02]*det4_1234_1345
843  + pM[GA03]*det4_1234_1245 - pM[GA04]*det4_1234_1235 + pM[GA05]*det4_1234_1234;
844  const Double_t det5_01235_01234 = pM[GA00]*det4_1235_1234 - pM[GA01]*det4_1235_0234
845  + pM[GA02]*det4_1235_0134 - pM[GA03]*det4_1235_0124 + pM[GA04]*det4_1235_0123;
846  const Double_t det5_01235_01235 = pM[GA00]*det4_1235_1235 - pM[GA01]*det4_1235_0235
847  + pM[GA02]*det4_1235_0135 - pM[GA03]*det4_1235_0125 + pM[GA05]*det4_1235_0123;
848  const Double_t det5_01235_01245 = pM[GA00]*det4_1235_1245 - pM[GA01]*det4_1235_0245
849  + pM[GA02]*det4_1235_0145 - pM[GA04]*det4_1235_0125 + pM[GA05]*det4_1235_0124;
850  const Double_t det5_01235_01345 = pM[GA00]*det4_1235_1345 - pM[GA01]*det4_1235_0345
851  + pM[GA03]*det4_1235_0145 - pM[GA04]*det4_1235_0135 + pM[GA05]*det4_1235_0134;
852  const Double_t det5_01235_02345 = pM[GA00]*det4_1235_2345 - pM[GA02]*det4_1235_0345
853  + pM[GA03]*det4_1235_0245 - pM[GA04]*det4_1235_0235 + pM[GA05]*det4_1235_0234;
854  const Double_t det5_01235_12345 = pM[GA01]*det4_1235_2345 - pM[GA02]*det4_1235_1345
855  + pM[GA03]*det4_1235_1245 - pM[GA04]*det4_1235_1235 + pM[GA05]*det4_1235_1234;
856  const Double_t det5_01245_01234 = pM[GA00]*det4_1245_1234 - pM[GA01]*det4_1245_0234
857  + pM[GA02]*det4_1245_0134 - pM[GA03]*det4_1245_0124 + pM[GA04]*det4_1245_0123;
858  const Double_t det5_01245_01235 = pM[GA00]*det4_1245_1235 - pM[GA01]*det4_1245_0235
859  + pM[GA02]*det4_1245_0135 - pM[GA03]*det4_1245_0125 + pM[GA05]*det4_1245_0123;
860  const Double_t det5_01245_01245 = pM[GA00]*det4_1245_1245 - pM[GA01]*det4_1245_0245
861  + pM[GA02]*det4_1245_0145 - pM[GA04]*det4_1245_0125 + pM[GA05]*det4_1245_0124;
862  const Double_t det5_01245_01345 = pM[GA00]*det4_1245_1345 - pM[GA01]*det4_1245_0345
863  + pM[GA03]*det4_1245_0145 - pM[GA04]*det4_1245_0135 + pM[GA05]*det4_1245_0134;
864  const Double_t det5_01245_02345 = pM[GA00]*det4_1245_2345 - pM[GA02]*det4_1245_0345
865  + pM[GA03]*det4_1245_0245 - pM[GA04]*det4_1245_0235 + pM[GA05]*det4_1245_0234;
866  const Double_t det5_01245_12345 = pM[GA01]*det4_1245_2345 - pM[GA02]*det4_1245_1345
867  + pM[GA03]*det4_1245_1245 - pM[GA04]*det4_1245_1235 + pM[GA05]*det4_1245_1234;
868  const Double_t det5_01345_01234 = pM[GA00]*det4_1345_1234 - pM[GA01]*det4_1345_0234
869  + pM[GA02]*det4_1345_0134 - pM[GA03]*det4_1345_0124 + pM[GA04]*det4_1345_0123;
870  const Double_t det5_01345_01235 = pM[GA00]*det4_1345_1235 - pM[GA01]*det4_1345_0235
871  + pM[GA02]*det4_1345_0135 - pM[GA03]*det4_1345_0125 + pM[GA05]*det4_1345_0123;
872  const Double_t det5_01345_01245 = pM[GA00]*det4_1345_1245 - pM[GA01]*det4_1345_0245
873  + pM[GA02]*det4_1345_0145 - pM[GA04]*det4_1345_0125 + pM[GA05]*det4_1345_0124;
874  const Double_t det5_01345_01345 = pM[GA00]*det4_1345_1345 - pM[GA01]*det4_1345_0345
875  + pM[GA03]*det4_1345_0145 - pM[GA04]*det4_1345_0135 + pM[GA05]*det4_1345_0134;
876  const Double_t det5_01345_02345 = pM[GA00]*det4_1345_2345 - pM[GA02]*det4_1345_0345
877  + pM[GA03]*det4_1345_0245 - pM[GA04]*det4_1345_0235 + pM[GA05]*det4_1345_0234;
878  const Double_t det5_01345_12345 = pM[GA01]*det4_1345_2345 - pM[GA02]*det4_1345_1345
879  + pM[GA03]*det4_1345_1245 - pM[GA04]*det4_1345_1235 + pM[GA05]*det4_1345_1234;
880  const Double_t det5_02345_01234 = pM[GA00]*det4_2345_1234 - pM[GA01]*det4_2345_0234
881  + pM[GA02]*det4_2345_0134 - pM[GA03]*det4_2345_0124 + pM[GA04]*det4_2345_0123;
882  const Double_t det5_02345_01235 = pM[GA00]*det4_2345_1235 - pM[GA01]*det4_2345_0235
883  + pM[GA02]*det4_2345_0135 - pM[GA03]*det4_2345_0125 + pM[GA05]*det4_2345_0123;
884  const Double_t det5_02345_01245 = pM[GA00]*det4_2345_1245 - pM[GA01]*det4_2345_0245
885  + pM[GA02]*det4_2345_0145 - pM[GA04]*det4_2345_0125 + pM[GA05]*det4_2345_0124;
886  const Double_t det5_02345_01345 = pM[GA00]*det4_2345_1345 - pM[GA01]*det4_2345_0345
887  + pM[GA03]*det4_2345_0145 - pM[GA04]*det4_2345_0135 + pM[GA05]*det4_2345_0134;
888  const Double_t det5_02345_02345 = pM[GA00]*det4_2345_2345 - pM[GA02]*det4_2345_0345
889  + pM[GA03]*det4_2345_0245 - pM[GA04]*det4_2345_0235 + pM[GA05]*det4_2345_0234;
890  const Double_t det5_02345_12345 = pM[GA01]*det4_2345_2345 - pM[GA02]*det4_2345_1345
891  + pM[GA03]*det4_2345_1245 - pM[GA04]*det4_2345_1235 + pM[GA05]*det4_2345_1234;
892  const Double_t det5_12345_01234 = pM[GA10]*det4_2345_1234 - pM[GA11]*det4_2345_0234
893  + pM[GA12]*det4_2345_0134 - pM[GA13]*det4_2345_0124 + pM[GA14]*det4_2345_0123;
894  const Double_t det5_12345_01235 = pM[GA10]*det4_2345_1235 - pM[GA11]*det4_2345_0235
895  + pM[GA12]*det4_2345_0135 - pM[GA13]*det4_2345_0125 + pM[GA15]*det4_2345_0123;
896  const Double_t det5_12345_01245 = pM[GA10]*det4_2345_1245 - pM[GA11]*det4_2345_0245
897  + pM[GA12]*det4_2345_0145 - pM[GA14]*det4_2345_0125 + pM[GA15]*det4_2345_0124;
898  const Double_t det5_12345_01345 = pM[GA10]*det4_2345_1345 - pM[GA11]*det4_2345_0345
899  + pM[GA13]*det4_2345_0145 - pM[GA14]*det4_2345_0135 + pM[GA15]*det4_2345_0134;
900  const Double_t det5_12345_02345 = pM[GA10]*det4_2345_2345 - pM[GA12]*det4_2345_0345
901  + pM[GA13]*det4_2345_0245 - pM[GA14]*det4_2345_0235 + pM[GA15]*det4_2345_0234;
902  const Double_t det5_12345_12345 = pM[GA11]*det4_2345_2345 - pM[GA12]*det4_2345_1345
903  + pM[GA13]*det4_2345_1245 - pM[GA14]*det4_2345_1235 + pM[GA15]*det4_2345_1234;
904
905  // Find the determinant
906
907  const Double_t det = pM[GA00]*det5_12345_12345 - pM[GA01]*det5_12345_02345 + pM[GA02]*det5_12345_01345
908  - pM[GA03]*det5_12345_01245 + pM[GA04]*det5_12345_01235 - pM[GA05]*det5_12345_01234;
909  if (determ)
910  *determ = det;
911
912  if ( det == 0 ) {
913  Error("Inv6x6","matrix is singular");
914  return kFALSE;
915  }
916
917  const Double_t oneOverDet = 1.0/det;
918  const Double_t mn1OverDet = - oneOverDet;
919
920  pM[GA00] = det5_12345_12345*oneOverDet;
921  pM[GA01] = det5_02345_12345*mn1OverDet;
922  pM[GA02] = det5_01345_12345*oneOverDet;
923  pM[GA03] = det5_01245_12345*mn1OverDet;
924  pM[GA04] = det5_01235_12345*oneOverDet;
925  pM[GA05] = det5_01234_12345*mn1OverDet;
926
927  pM[GA10] = det5_12345_02345*mn1OverDet;
928  pM[GA11] = det5_02345_02345*oneOverDet;
929  pM[GA12] = det5_01345_02345*mn1OverDet;
930  pM[GA13] = det5_01245_02345*oneOverDet;
931  pM[GA14] = det5_01235_02345*mn1OverDet;
932  pM[GA15] = det5_01234_02345*oneOverDet;
933
934  pM[GA20] = det5_12345_01345*oneOverDet;
935  pM[GA21] = det5_02345_01345*mn1OverDet;
936  pM[GA22] = det5_01345_01345*oneOverDet;
937  pM[GA23] = det5_01245_01345*mn1OverDet;
938  pM[GA24] = det5_01235_01345*oneOverDet;
939  pM[GA25] = det5_01234_01345*mn1OverDet;
940
941  pM[GA30] = det5_12345_01245*mn1OverDet;
942  pM[GA31] = det5_02345_01245*oneOverDet;
943  pM[GA32] = det5_01345_01245*mn1OverDet;
944  pM[GA33] = det5_01245_01245*oneOverDet;
945  pM[GA34] = det5_01235_01245*mn1OverDet;
946  pM[GA35] = det5_01234_01245*oneOverDet;
947
948  pM[GA40] = det5_12345_01235*oneOverDet;
949  pM[GA41] = det5_02345_01235*mn1OverDet;
950  pM[GA42] = det5_01345_01235*oneOverDet;
951  pM[GA43] = det5_01245_01235*mn1OverDet;
952  pM[GA44] = det5_01235_01235*oneOverDet;
953  pM[GA45] = det5_01234_01235*mn1OverDet;
954
955  pM[GA50] = det5_12345_01234*mn1OverDet;
956  pM[GA51] = det5_02345_01234*oneOverDet;
957  pM[GA52] = det5_01345_01234*mn1OverDet;
958  pM[GA53] = det5_01245_01234*oneOverDet;
959  pM[GA54] = det5_01235_01234*mn1OverDet;
960  pM[GA55] = det5_01234_01234*oneOverDet;
961
962  return kTRUE;
963 }
964
965 #ifndef ROOT_TMatrixFfwd
966 #include "TMatrixFfwd.h"
967 #endif
968
969 template Bool_t TMatrixTCramerInv::Inv2x2<Float_t>(TMatrixF&,Double_t*);
970 template Bool_t TMatrixTCramerInv::Inv3x3<Float_t>(TMatrixF&,Double_t*);
971 template Bool_t TMatrixTCramerInv::Inv4x4<Float_t>(TMatrixF&,Double_t*);
972 template Bool_t TMatrixTCramerInv::Inv5x5<Float_t>(TMatrixF&,Double_t*);
973 template Bool_t TMatrixTCramerInv::Inv6x6<Float_t>(TMatrixF&,Double_t*);
974
975 #ifndef ROOT_TMatrixDfwd
976 #include "TMatrixDfwd.h"
977 #endif
978
979 template Bool_t TMatrixTCramerInv::Inv2x2<Double_t>(TMatrixD&,Double_t*);
980 template Bool_t TMatrixTCramerInv::Inv3x3<Double_t>(TMatrixD&,Double_t*);
981 template Bool_t TMatrixTCramerInv::Inv4x4<Double_t>(TMatrixD&,Double_t*);
982 template Bool_t TMatrixTCramerInv::Inv5x5<Double_t>(TMatrixD&,Double_t*);
983 template Bool_t TMatrixTCramerInv::Inv6x6<Double_t>(TMatrixD&,Double_t*);
#define GM00
#define GA13
#define GA52
#define GM30
#define GA25
#define GM20
#define GM12
#define GA34
Bool_t Inv5x5(TMatrixT< Element > &m, Double_t *determ)
#define GA55
Int_t GetRowLwb() const
Definition: TMatrixTBase.h:132
#define GM43
#define GA14
#define GA11
#define GF03
#define GM41
#define GM03
virtual const Element * GetMatrixArray() const
Definition: TMatrixT.h:223
Int_t GetNcols() const
Definition: TMatrixTBase.h:137
#define GF21
#define GA00
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
#define GM34
#define GA42
#define GM14
TLatex * t1
Definition: textangle.C:20
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
#define GM02
TMatrixT.
Definition: TMatrixDfwd.h:24
Bool_t Inv3x3(TMatrixT< Element > &m, Double_t *determ)
#define GA50
#define GF12
#define GF11
Int_t GetColLwb() const
Definition: TMatrixTBase.h:135
#define GM31
#define GA15
#define GA22
#define GA02
#define GA40
#define GA44
#define GM40
void Error(const char *location, const char *msgfmt,...)
#define GA51
#define GA20
#define GM04
#define GM24
#define GM13
#define GA45
#define GF20
#define GM42
#define GA05
#define GM44
TMarker * m
Definition: textangle.C:8
#define NamespaceImp(name)
Definition: Rtypes.h:294
#define GA32
#define GA04
#define GA21
#define GF10
Int_t GetNrows() const
Definition: TMatrixTBase.h:134
Bool_t Inv2x2(TMatrixT< Element > &m, Double_t *determ)
#define GA43
#define GM11
#define GA12
#define GA03
double Double_t
Definition: RtypesCore.h:55
#define GM21
#define GF22
#define GA24
#define GA41
#define GM01
#define GA30
#define GM33
#define GA23
#define GF32
#define GM22
#define GA01
#define GA33
#define GM10
#define GF30
#define GA53
#define GF01
#define GF13
Bool_t Inv6x6(TMatrixT< Element > &m, Double_t *determ)
#define GA10
#define GM32
#define GA31
#define GA54
Bool_t Inv4x4(TMatrixT< Element > &m, Double_t *determ)
#define GM23
#define GF00
const Bool_t kTRUE
Definition: Rtypes.h:91
#define GF23
#define GA35
#define GF31
#define GF33
#define GF02