41#if !defined(R__SOLARIS) && !defined(R__ACC) && !defined(R__FBSD)
47template<
class Element>
50 if (
m.GetNrows() != 2 ||
m.GetNcols() != 2 ||
m.GetRowLwb() !=
m.GetColLwb()) {
51 Error(
"Inv2x2",
"matrix should be square 2x2");
55 Element *pM =
m.GetMatrixArray();
57 const Double_t det = pM[0] * pM[3] - pM[2] * pM[1];
64 Error(
"Inv2x2",
"matrix is singular");
79template<
class Element>
82 if (
m.GetNrows() != 3 ||
m.GetNcols() != 3 ||
m.GetRowLwb() !=
m.GetColLwb()) {
83 Error(
"Inv3x3",
"matrix should be square 3x3");
87 Element *pM =
m.GetMatrixArray();
89 const Double_t c00 = pM[4] * pM[8] - pM[5] * pM[7];
90 const Double_t c01 = pM[5] * pM[6] - pM[3] * pM[8];
91 const Double_t c02 = pM[3] * pM[7] - pM[4] * pM[6];
92 const Double_t c10 = pM[7] * pM[2] - pM[8] * pM[1];
93 const Double_t c11 = pM[8] * pM[0] - pM[6] * pM[2];
94 const Double_t c12 = pM[6] * pM[1] - pM[7] * pM[0];
95 const Double_t c20 = pM[1] * pM[5] - pM[2] * pM[4];
96 const Double_t c21 = pM[2] * pM[3] - pM[0] * pM[5];
97 const Double_t c22 = pM[0] * pM[4] - pM[1] * pM[3];
107 det = c12*c01-c11*c02;
110 det = c11*c22-c12*c21;
112 }
else if (t2 >=
t1) {
114 det = c12*c01-c11*c02;
117 det = c02*c21-c01*c22;
120 if ( det == 0 || tmp == 0) {
121 Error(
"Inv3x3",
"matrix is singular");
166template<
class Element>
169 if (
m.GetNrows() != 4 ||
m.GetNcols() != 4 ||
m.GetRowLwb() !=
m.GetColLwb()) {
170 Error(
"Inv4x4",
"matrix should be square 4x4");
174 Element *pM =
m.GetMatrixArray();
200 + pM[
GF02]*det2_12_01;
202 + pM[
GF03]*det2_12_01;
204 + pM[
GF03]*det2_12_02;
206 + pM[
GF03]*det2_12_12;
208 + pM[
GF02]*det2_13_01;
210 + pM[
GF03]*det2_13_01;
212 + pM[
GF03]*det2_13_02;
214 + pM[
GF03]*det2_13_12;
216 + pM[
GF02]*det2_23_01;
218 + pM[
GF03]*det2_23_01;
220 + pM[
GF03]*det2_23_02;
222 + pM[
GF03]*det2_23_12;
224 + pM[
GF12]*det2_23_01;
226 + pM[
GF13]*det2_23_01;
228 + pM[
GF13]*det2_23_02;
230 + pM[
GF13]*det2_23_12;
235 + pM[
GF02]*det3_123_013 - pM[
GF03]*det3_123_012;
240 Error(
"Inv4x4",
"matrix is singular");
244 const Double_t oneOverDet = 1.0/det;
245 const Double_t mn1OverDet = - oneOverDet;
247 pM[
GF00] = det3_123_123 * oneOverDet;
248 pM[
GF01] = det3_023_123 * mn1OverDet;
249 pM[
GF02] = det3_013_123 * oneOverDet;
250 pM[
GF03] = det3_012_123 * mn1OverDet;
252 pM[
GF10] = det3_123_023 * mn1OverDet;
253 pM[
GF11] = det3_023_023 * oneOverDet;
254 pM[
GF12] = det3_013_023 * mn1OverDet;
255 pM[
GF13] = det3_012_023 * oneOverDet;
257 pM[
GF20] = det3_123_013 * oneOverDet;
258 pM[
GF21] = det3_023_013 * mn1OverDet;
259 pM[
GF22] = det3_013_013 * oneOverDet;
260 pM[
GF23] = det3_012_013 * mn1OverDet;
262 pM[
GF30] = det3_123_012 * mn1OverDet;
263 pM[
GF31] = det3_023_012 * oneOverDet;
264 pM[
GF32] = det3_013_012 * mn1OverDet;
265 pM[
GF33] = det3_012_012 * oneOverDet;
304template<
class Element>
307 if (
m.GetNrows() != 5 ||
m.GetNcols() != 5 ||
m.GetRowLwb() !=
m.GetColLwb()) {
308 Error(
"Inv5x5",
"matrix should be square 5x5");
312 Element *pM =
m.GetMatrixArray();
392 const Double_t det4_0123_0123 = pM[
GM00]*det3_123_123 - pM[
GM01]*det3_123_023
393 + pM[
GM02]*det3_123_013 - pM[
GM03]*det3_123_012;
394 const Double_t det4_0123_0124 = pM[
GM00]*det3_123_124 - pM[
GM01]*det3_123_024
395 + pM[
GM02]*det3_123_014 - pM[
GM04]*det3_123_012;
396 const Double_t det4_0123_0134 = pM[
GM00]*det3_123_134 - pM[
GM01]*det3_123_034
397 + pM[
GM03]*det3_123_014 - pM[
GM04]*det3_123_013;
398 const Double_t det4_0123_0234 = pM[
GM00]*det3_123_234 - pM[
GM02]*det3_123_034
399 + pM[
GM03]*det3_123_024 - pM[
GM04]*det3_123_023;
400 const Double_t det4_0123_1234 = pM[
GM01]*det3_123_234 - pM[
GM02]*det3_123_134
401 + pM[
GM03]*det3_123_124 - pM[
GM04]*det3_123_123;
402 const Double_t det4_0124_0123 = pM[
GM00]*det3_124_123 - pM[
GM01]*det3_124_023
403 + pM[
GM02]*det3_124_013 - pM[
GM03]*det3_124_012;
404 const Double_t det4_0124_0124 = pM[
GM00]*det3_124_124 - pM[
GM01]*det3_124_024
405 + pM[
GM02]*det3_124_014 - pM[
GM04]*det3_124_012;
406 const Double_t det4_0124_0134 = pM[
GM00]*det3_124_134 - pM[
GM01]*det3_124_034
407 + pM[
GM03]*det3_124_014 - pM[
GM04]*det3_124_013;
408 const Double_t det4_0124_0234 = pM[
GM00]*det3_124_234 - pM[
GM02]*det3_124_034
409 + pM[
GM03]*det3_124_024 - pM[
GM04]*det3_124_023;
410 const Double_t det4_0124_1234 = pM[
GM01]*det3_124_234 - pM[
GM02]*det3_124_134
411 + pM[
GM03]*det3_124_124 - pM[
GM04]*det3_124_123;
412 const Double_t det4_0134_0123 = pM[
GM00]*det3_134_123 - pM[
GM01]*det3_134_023
413 + pM[
GM02]*det3_134_013 - pM[
GM03]*det3_134_012;
414 const Double_t det4_0134_0124 = pM[
GM00]*det3_134_124 - pM[
GM01]*det3_134_024
415 + pM[
GM02]*det3_134_014 - pM[
GM04]*det3_134_012;
416 const Double_t det4_0134_0134 = pM[
GM00]*det3_134_134 - pM[
GM01]*det3_134_034
417 + pM[
GM03]*det3_134_014 - pM[
GM04]*det3_134_013;
418 const Double_t det4_0134_0234 = pM[
GM00]*det3_134_234 - pM[
GM02]*det3_134_034
419 + pM[
GM03]*det3_134_024 - pM[
GM04]*det3_134_023;
420 const Double_t det4_0134_1234 = pM[
GM01]*det3_134_234 - pM[
GM02]*det3_134_134
421 + pM[
GM03]*det3_134_124 - pM[
GM04]*det3_134_123;
422 const Double_t det4_0234_0123 = pM[
GM00]*det3_234_123 - pM[
GM01]*det3_234_023
423 + pM[
GM02]*det3_234_013 - pM[
GM03]*det3_234_012;
424 const Double_t det4_0234_0124 = pM[
GM00]*det3_234_124 - pM[
GM01]*det3_234_024
425 + pM[
GM02]*det3_234_014 - pM[
GM04]*det3_234_012;
426 const Double_t det4_0234_0134 = pM[
GM00]*det3_234_134 - pM[
GM01]*det3_234_034
427 + pM[
GM03]*det3_234_014 - pM[
GM04]*det3_234_013;
428 const Double_t det4_0234_0234 = pM[
GM00]*det3_234_234 - pM[
GM02]*det3_234_034
429 + pM[
GM03]*det3_234_024 - pM[
GM04]*det3_234_023;
430 const Double_t det4_0234_1234 = pM[
GM01]*det3_234_234 - pM[
GM02]*det3_234_134
431 + pM[
GM03]*det3_234_124 - pM[
GM04]*det3_234_123;
432 const Double_t det4_1234_0123 = pM[
GM10]*det3_234_123 - pM[
GM11]*det3_234_023
433 + pM[
GM12]*det3_234_013 - pM[
GM13]*det3_234_012;
434 const Double_t det4_1234_0124 = pM[
GM10]*det3_234_124 - pM[
GM11]*det3_234_024
435 + pM[
GM12]*det3_234_014 - pM[
GM14]*det3_234_012;
436 const Double_t det4_1234_0134 = pM[
GM10]*det3_234_134 - pM[
GM11]*det3_234_034
437 + pM[
GM13]*det3_234_014 - pM[
GM14]*det3_234_013;
438 const Double_t det4_1234_0234 = pM[
GM10]*det3_234_234 - pM[
GM12]*det3_234_034
439 + pM[
GM13]*det3_234_024 - pM[
GM14]*det3_234_023;
440 const Double_t det4_1234_1234 = pM[
GM11]*det3_234_234 - pM[
GM12]*det3_234_134
441 + pM[
GM13]*det3_234_124 - pM[
GM14]*det3_234_123;
445 const Double_t det = pM[
GM00]*det4_1234_1234 - pM[
GM01]*det4_1234_0234 + pM[
GM02]*det4_1234_0134
446 - pM[
GM03]*det4_1234_0124 + pM[
GM04]*det4_1234_0123;
451 Error(
"Inv5x5",
"matrix is singular");
455 const Double_t oneOverDet = 1.0/det;
456 const Double_t mn1OverDet = - oneOverDet;
458 pM[
GM00] = det4_1234_1234 * oneOverDet;
459 pM[
GM01] = det4_0234_1234 * mn1OverDet;
460 pM[
GM02] = det4_0134_1234 * oneOverDet;
461 pM[
GM03] = det4_0124_1234 * mn1OverDet;
462 pM[
GM04] = det4_0123_1234 * oneOverDet;
464 pM[
GM10] = det4_1234_0234 * mn1OverDet;
465 pM[
GM11] = det4_0234_0234 * oneOverDet;
466 pM[
GM12] = det4_0134_0234 * mn1OverDet;
467 pM[
GM13] = det4_0124_0234 * oneOverDet;
468 pM[
GM14] = det4_0123_0234 * mn1OverDet;
470 pM[
GM20] = det4_1234_0134 * oneOverDet;
471 pM[
GM21] = det4_0234_0134 * mn1OverDet;
472 pM[
GM22] = det4_0134_0134 * oneOverDet;
473 pM[
GM23] = det4_0124_0134 * mn1OverDet;
474 pM[
GM24] = det4_0123_0134 * oneOverDet;
476 pM[
GM30] = det4_1234_0124 * mn1OverDet;
477 pM[
GM31] = det4_0234_0124 * oneOverDet;
478 pM[
GM32] = det4_0134_0124 * mn1OverDet;
479 pM[
GM33] = det4_0124_0124 * oneOverDet;
480 pM[
GM34] = det4_0123_0124 * mn1OverDet;
482 pM[
GM40] = det4_1234_0123 * oneOverDet;
483 pM[
GM41] = det4_0234_0123 * mn1OverDet;
484 pM[
GM42] = det4_0134_0123 * oneOverDet;
485 pM[
GM43] = det4_0124_0123 * mn1OverDet;
486 pM[
GM44] = det4_0123_0123 * oneOverDet;
537template<
class Element>
540 if (
m.GetNrows() != 6 ||
m.GetNcols() != 6 ||
m.GetRowLwb() !=
m.GetColLwb()) {
541 Error(
"Inv6x6",
"matrix should be square 6x6");
545 Element *pM =
m.GetMatrixArray();
680 const Double_t det4_1234_0123 = pM[
GA10]*det3_234_123 - pM[
GA11]*det3_234_023
681 + pM[
GA12]*det3_234_013 - pM[
GA13]*det3_234_012;
682 const Double_t det4_1234_0124 = pM[
GA10]*det3_234_124 - pM[
GA11]*det3_234_024
683 + pM[
GA12]*det3_234_014 - pM[
GA14]*det3_234_012;
684 const Double_t det4_1234_0125 = pM[
GA10]*det3_234_125 - pM[
GA11]*det3_234_025
685 + pM[
GA12]*det3_234_015 - pM[
GA15]*det3_234_012;
686 const Double_t det4_1234_0134 = pM[
GA10]*det3_234_134 - pM[
GA11]*det3_234_034
687 + pM[
GA13]*det3_234_014 - pM[
GA14]*det3_234_013;
688 const Double_t det4_1234_0135 = pM[
GA10]*det3_234_135 - pM[
GA11]*det3_234_035
689 + pM[
GA13]*det3_234_015 - pM[
GA15]*det3_234_013;
690 const Double_t det4_1234_0145 = pM[
GA10]*det3_234_145 - pM[
GA11]*det3_234_045
691 + pM[
GA14]*det3_234_015 - pM[
GA15]*det3_234_014;
692 const Double_t det4_1234_0234 = pM[
GA10]*det3_234_234 - pM[
GA12]*det3_234_034
693 + pM[
GA13]*det3_234_024 - pM[
GA14]*det3_234_023;
694 const Double_t det4_1234_0235 = pM[
GA10]*det3_234_235 - pM[
GA12]*det3_234_035
695 + pM[
GA13]*det3_234_025 - pM[
GA15]*det3_234_023;
696 const Double_t det4_1234_0245 = pM[
GA10]*det3_234_245 - pM[
GA12]*det3_234_045
697 + pM[
GA14]*det3_234_025 - pM[
GA15]*det3_234_024;
698 const Double_t det4_1234_0345 = pM[
GA10]*det3_234_345 - pM[
GA13]*det3_234_045
699 + pM[
GA14]*det3_234_035 - pM[
GA15]*det3_234_034;
700 const Double_t det4_1234_1234 = pM[
GA11]*det3_234_234 - pM[
GA12]*det3_234_134
701 + pM[
GA13]*det3_234_124 - pM[
GA14]*det3_234_123;
702 const Double_t det4_1234_1235 = pM[
GA11]*det3_234_235 - pM[
GA12]*det3_234_135
703 + pM[
GA13]*det3_234_125 - pM[
GA15]*det3_234_123;
704 const Double_t det4_1234_1245 = pM[
GA11]*det3_234_245 - pM[
GA12]*det3_234_145
705 + pM[
GA14]*det3_234_125 - pM[
GA15]*det3_234_124;
706 const Double_t det4_1234_1345 = pM[
GA11]*det3_234_345 - pM[
GA13]*det3_234_145
707 + pM[
GA14]*det3_234_135 - pM[
GA15]*det3_234_134;
708 const Double_t det4_1234_2345 = pM[
GA12]*det3_234_345 - pM[
GA13]*det3_234_245
709 + pM[
GA14]*det3_234_235 - pM[
GA15]*det3_234_234;
710 const Double_t det4_1235_0123 = pM[
GA10]*det3_235_123 - pM[
GA11]*det3_235_023
711 + pM[
GA12]*det3_235_013 - pM[
GA13]*det3_235_012;
712 const Double_t det4_1235_0124 = pM[
GA10]*det3_235_124 - pM[
GA11]*det3_235_024
713 + pM[
GA12]*det3_235_014 - pM[
GA14]*det3_235_012;
714 const Double_t det4_1235_0125 = pM[
GA10]*det3_235_125 - pM[
GA11]*det3_235_025
715 + pM[
GA12]*det3_235_015 - pM[
GA15]*det3_235_012;
716 const Double_t det4_1235_0134 = pM[
GA10]*det3_235_134 - pM[
GA11]*det3_235_034
717 + pM[
GA13]*det3_235_014 - pM[
GA14]*det3_235_013;
718 const Double_t det4_1235_0135 = pM[
GA10]*det3_235_135 - pM[
GA11]*det3_235_035
719 + pM[
GA13]*det3_235_015 - pM[
GA15]*det3_235_013;
720 const Double_t det4_1235_0145 = pM[
GA10]*det3_235_145 - pM[
GA11]*det3_235_045
721 + pM[
GA14]*det3_235_015 - pM[
GA15]*det3_235_014;
722 const Double_t det4_1235_0234 = pM[
GA10]*det3_235_234 - pM[
GA12]*det3_235_034
723 + pM[
GA13]*det3_235_024 - pM[
GA14]*det3_235_023;
724 const Double_t det4_1235_0235 = pM[
GA10]*det3_235_235 - pM[
GA12]*det3_235_035
725 + pM[
GA13]*det3_235_025 - pM[
GA15]*det3_235_023;
726 const Double_t det4_1235_0245 = pM[
GA10]*det3_235_245 - pM[
GA12]*det3_235_045
727 + pM[
GA14]*det3_235_025 - pM[
GA15]*det3_235_024;
728 const Double_t det4_1235_0345 = pM[
GA10]*det3_235_345 - pM[
GA13]*det3_235_045
729 + pM[
GA14]*det3_235_035 - pM[
GA15]*det3_235_034;
730 const Double_t det4_1235_1234 = pM[
GA11]*det3_235_234 - pM[
GA12]*det3_235_134
731 + pM[
GA13]*det3_235_124 - pM[
GA14]*det3_235_123;
732 const Double_t det4_1235_1235 = pM[
GA11]*det3_235_235 - pM[
GA12]*det3_235_135
733 + pM[
GA13]*det3_235_125 - pM[
GA15]*det3_235_123;
734 const Double_t det4_1235_1245 = pM[
GA11]*det3_235_245 - pM[
GA12]*det3_235_145
735 + pM[
GA14]*det3_235_125 - pM[
GA15]*det3_235_124;
736 const Double_t det4_1235_1345 = pM[
GA11]*det3_235_345 - pM[
GA13]*det3_235_145
737 + pM[
GA14]*det3_235_135 - pM[
GA15]*det3_235_134;
738 const Double_t det4_1235_2345 = pM[
GA12]*det3_235_345 - pM[
GA13]*det3_235_245
739 + pM[
GA14]*det3_235_235 - pM[
GA15]*det3_235_234;
740 const Double_t det4_1245_0123 = pM[
GA10]*det3_245_123 - pM[
GA11]*det3_245_023
741 + pM[
GA12]*det3_245_013 - pM[
GA13]*det3_245_012;
742 const Double_t det4_1245_0124 = pM[
GA10]*det3_245_124 - pM[
GA11]*det3_245_024
743 + pM[
GA12]*det3_245_014 - pM[
GA14]*det3_245_012;
744 const Double_t det4_1245_0125 = pM[
GA10]*det3_245_125 - pM[
GA11]*det3_245_025
745 + pM[
GA12]*det3_245_015 - pM[
GA15]*det3_245_012;
746 const Double_t det4_1245_0134 = pM[
GA10]*det3_245_134 - pM[
GA11]*det3_245_034
747 + pM[
GA13]*det3_245_014 - pM[
GA14]*det3_245_013;
748 const Double_t det4_1245_0135 = pM[
GA10]*det3_245_135 - pM[
GA11]*det3_245_035
749 + pM[
GA13]*det3_245_015 - pM[
GA15]*det3_245_013;
750 const Double_t det4_1245_0145 = pM[
GA10]*det3_245_145 - pM[
GA11]*det3_245_045
751 + pM[
GA14]*det3_245_015 - pM[
GA15]*det3_245_014;
752 const Double_t det4_1245_0234 = pM[
GA10]*det3_245_234 - pM[
GA12]*det3_245_034
753 + pM[
GA13]*det3_245_024 - pM[
GA14]*det3_245_023;
754 const Double_t det4_1245_0235 = pM[
GA10]*det3_245_235 - pM[
GA12]*det3_245_035
755 + pM[
GA13]*det3_245_025 - pM[
GA15]*det3_245_023;
756 const Double_t det4_1245_0245 = pM[
GA10]*det3_245_245 - pM[
GA12]*det3_245_045
757 + pM[
GA14]*det3_245_025 - pM[
GA15]*det3_245_024;
758 const Double_t det4_1245_0345 = pM[
GA10]*det3_245_345 - pM[
GA13]*det3_245_045
759 + pM[
GA14]*det3_245_035 - pM[
GA15]*det3_245_034;
760 const Double_t det4_1245_1234 = pM[
GA11]*det3_245_234 - pM[
GA12]*det3_245_134
761 + pM[
GA13]*det3_245_124 - pM[
GA14]*det3_245_123;
762 const Double_t det4_1245_1235 = pM[
GA11]*det3_245_235 - pM[
GA12]*det3_245_135
763 + pM[
GA13]*det3_245_125 - pM[
GA15]*det3_245_123;
764 const Double_t det4_1245_1245 = pM[
GA11]*det3_245_245 - pM[
GA12]*det3_245_145
765 + pM[
GA14]*det3_245_125 - pM[
GA15]*det3_245_124;
766 const Double_t det4_1245_1345 = pM[
GA11]*det3_245_345 - pM[
GA13]*det3_245_145
767 + pM[
GA14]*det3_245_135 - pM[
GA15]*det3_245_134;
768 const Double_t det4_1245_2345 = pM[
GA12]*det3_245_345 - pM[
GA13]*det3_245_245
769 + pM[
GA14]*det3_245_235 - pM[
GA15]*det3_245_234;
770 const Double_t det4_1345_0123 = pM[
GA10]*det3_345_123 - pM[
GA11]*det3_345_023
771 + pM[
GA12]*det3_345_013 - pM[
GA13]*det3_345_012;
772 const Double_t det4_1345_0124 = pM[
GA10]*det3_345_124 - pM[
GA11]*det3_345_024
773 + pM[
GA12]*det3_345_014 - pM[
GA14]*det3_345_012;
774 const Double_t det4_1345_0125 = pM[
GA10]*det3_345_125 - pM[
GA11]*det3_345_025
775 + pM[
GA12]*det3_345_015 - pM[
GA15]*det3_345_012;
776 const Double_t det4_1345_0134 = pM[
GA10]*det3_345_134 - pM[
GA11]*det3_345_034
777 + pM[
GA13]*det3_345_014 - pM[
GA14]*det3_345_013;
778 const Double_t det4_1345_0135 = pM[
GA10]*det3_345_135 - pM[
GA11]*det3_345_035
779 + pM[
GA13]*det3_345_015 - pM[
GA15]*det3_345_013;
780 const Double_t det4_1345_0145 = pM[
GA10]*det3_345_145 - pM[
GA11]*det3_345_045
781 + pM[
GA14]*det3_345_015 - pM[
GA15]*det3_345_014;
782 const Double_t det4_1345_0234 = pM[
GA10]*det3_345_234 - pM[
GA12]*det3_345_034
783 + pM[
GA13]*det3_345_024 - pM[
GA14]*det3_345_023;
784 const Double_t det4_1345_0235 = pM[
GA10]*det3_345_235 - pM[
GA12]*det3_345_035
785 + pM[
GA13]*det3_345_025 - pM[
GA15]*det3_345_023;
786 const Double_t det4_1345_0245 = pM[
GA10]*det3_345_245 - pM[
GA12]*det3_345_045
787 + pM[
GA14]*det3_345_025 - pM[
GA15]*det3_345_024;
788 const Double_t det4_1345_0345 = pM[
GA10]*det3_345_345 - pM[
GA13]*det3_345_045
789 + pM[
GA14]*det3_345_035 - pM[
GA15]*det3_345_034;
790 const Double_t det4_1345_1234 = pM[
GA11]*det3_345_234 - pM[
GA12]*det3_345_134
791 + pM[
GA13]*det3_345_124 - pM[
GA14]*det3_345_123;
792 const Double_t det4_1345_1235 = pM[
GA11]*det3_345_235 - pM[
GA12]*det3_345_135
793 + pM[
GA13]*det3_345_125 - pM[
GA15]*det3_345_123;
794 const Double_t det4_1345_1245 = pM[
GA11]*det3_345_245 - pM[
GA12]*det3_345_145
795 + pM[
GA14]*det3_345_125 - pM[
GA15]*det3_345_124;
796 const Double_t det4_1345_1345 = pM[
GA11]*det3_345_345 - pM[
GA13]*det3_345_145
797 + pM[
GA14]*det3_345_135 - pM[
GA15]*det3_345_134;
798 const Double_t det4_1345_2345 = pM[
GA12]*det3_345_345 - pM[
GA13]*det3_345_245
799 + pM[
GA14]*det3_345_235 - pM[
GA15]*det3_345_234;
800 const Double_t det4_2345_0123 = pM[
GA20]*det3_345_123 - pM[
GA21]*det3_345_023
801 + pM[
GA22]*det3_345_013 - pM[
GA23]*det3_345_012;
802 const Double_t det4_2345_0124 = pM[
GA20]*det3_345_124 - pM[
GA21]*det3_345_024
803 + pM[
GA22]*det3_345_014 - pM[
GA24]*det3_345_012;
804 const Double_t det4_2345_0125 = pM[
GA20]*det3_345_125 - pM[
GA21]*det3_345_025
805 + pM[
GA22]*det3_345_015 - pM[
GA25]*det3_345_012;
806 const Double_t det4_2345_0134 = pM[
GA20]*det3_345_134 - pM[
GA21]*det3_345_034
807 + pM[
GA23]*det3_345_014 - pM[
GA24]*det3_345_013;
808 const Double_t det4_2345_0135 = pM[
GA20]*det3_345_135 - pM[
GA21]*det3_345_035
809 + pM[
GA23]*det3_345_015 - pM[
GA25]*det3_345_013;
810 const Double_t det4_2345_0145 = pM[
GA20]*det3_345_145 - pM[
GA21]*det3_345_045
811 + pM[
GA24]*det3_345_015 - pM[
GA25]*det3_345_014;
812 const Double_t det4_2345_0234 = pM[
GA20]*det3_345_234 - pM[
GA22]*det3_345_034
813 + pM[
GA23]*det3_345_024 - pM[
GA24]*det3_345_023;
814 const Double_t det4_2345_0235 = pM[
GA20]*det3_345_235 - pM[
GA22]*det3_345_035
815 + pM[
GA23]*det3_345_025 - pM[
GA25]*det3_345_023;
816 const Double_t det4_2345_0245 = pM[
GA20]*det3_345_245 - pM[
GA22]*det3_345_045
817 + pM[
GA24]*det3_345_025 - pM[
GA25]*det3_345_024;
818 const Double_t det4_2345_0345 = pM[
GA20]*det3_345_345 - pM[
GA23]*det3_345_045
819 + pM[
GA24]*det3_345_035 - pM[
GA25]*det3_345_034;
820 const Double_t det4_2345_1234 = pM[
GA21]*det3_345_234 - pM[
GA22]*det3_345_134
821 + pM[
GA23]*det3_345_124 - pM[
GA24]*det3_345_123;
822 const Double_t det4_2345_1235 = pM[
GA21]*det3_345_235 - pM[
GA22]*det3_345_135
823 + pM[
GA23]*det3_345_125 - pM[
GA25]*det3_345_123;
824 const Double_t det4_2345_1245 = pM[
GA21]*det3_345_245 - pM[
GA22]*det3_345_145
825 + pM[
GA24]*det3_345_125 - pM[
GA25]*det3_345_124;
826 const Double_t det4_2345_1345 = pM[
GA21]*det3_345_345 - pM[
GA23]*det3_345_145
827 + pM[
GA24]*det3_345_135 - pM[
GA25]*det3_345_134;
828 const Double_t det4_2345_2345 = pM[
GA22]*det3_345_345 - pM[
GA23]*det3_345_245
829 + pM[
GA24]*det3_345_235 - pM[
GA25]*det3_345_234;
833 const Double_t det5_01234_01234 = pM[
GA00]*det4_1234_1234 - pM[
GA01]*det4_1234_0234
834 + pM[
GA02]*det4_1234_0134 - pM[
GA03]*det4_1234_0124 + pM[
GA04]*det4_1234_0123;
835 const Double_t det5_01234_01235 = pM[
GA00]*det4_1234_1235 - pM[
GA01]*det4_1234_0235
836 + pM[
GA02]*det4_1234_0135 - pM[
GA03]*det4_1234_0125 + pM[
GA05]*det4_1234_0123;
837 const Double_t det5_01234_01245 = pM[
GA00]*det4_1234_1245 - pM[
GA01]*det4_1234_0245
838 + pM[
GA02]*det4_1234_0145 - pM[
GA04]*det4_1234_0125 + pM[
GA05]*det4_1234_0124;
839 const Double_t det5_01234_01345 = pM[
GA00]*det4_1234_1345 - pM[
GA01]*det4_1234_0345
840 + pM[
GA03]*det4_1234_0145 - pM[
GA04]*det4_1234_0135 + pM[
GA05]*det4_1234_0134;
841 const Double_t det5_01234_02345 = pM[
GA00]*det4_1234_2345 - pM[
GA02]*det4_1234_0345
842 + pM[
GA03]*det4_1234_0245 - pM[
GA04]*det4_1234_0235 + pM[
GA05]*det4_1234_0234;
843 const Double_t det5_01234_12345 = pM[
GA01]*det4_1234_2345 - pM[
GA02]*det4_1234_1345
844 + pM[
GA03]*det4_1234_1245 - pM[
GA04]*det4_1234_1235 + pM[
GA05]*det4_1234_1234;
845 const Double_t det5_01235_01234 = pM[
GA00]*det4_1235_1234 - pM[
GA01]*det4_1235_0234
846 + pM[
GA02]*det4_1235_0134 - pM[
GA03]*det4_1235_0124 + pM[
GA04]*det4_1235_0123;
847 const Double_t det5_01235_01235 = pM[
GA00]*det4_1235_1235 - pM[
GA01]*det4_1235_0235
848 + pM[
GA02]*det4_1235_0135 - pM[
GA03]*det4_1235_0125 + pM[
GA05]*det4_1235_0123;
849 const Double_t det5_01235_01245 = pM[
GA00]*det4_1235_1245 - pM[
GA01]*det4_1235_0245
850 + pM[
GA02]*det4_1235_0145 - pM[
GA04]*det4_1235_0125 + pM[
GA05]*det4_1235_0124;
851 const Double_t det5_01235_01345 = pM[
GA00]*det4_1235_1345 - pM[
GA01]*det4_1235_0345
852 + pM[
GA03]*det4_1235_0145 - pM[
GA04]*det4_1235_0135 + pM[
GA05]*det4_1235_0134;
853 const Double_t det5_01235_02345 = pM[
GA00]*det4_1235_2345 - pM[
GA02]*det4_1235_0345
854 + pM[
GA03]*det4_1235_0245 - pM[
GA04]*det4_1235_0235 + pM[
GA05]*det4_1235_0234;
855 const Double_t det5_01235_12345 = pM[
GA01]*det4_1235_2345 - pM[
GA02]*det4_1235_1345
856 + pM[
GA03]*det4_1235_1245 - pM[
GA04]*det4_1235_1235 + pM[
GA05]*det4_1235_1234;
857 const Double_t det5_01245_01234 = pM[
GA00]*det4_1245_1234 - pM[
GA01]*det4_1245_0234
858 + pM[
GA02]*det4_1245_0134 - pM[
GA03]*det4_1245_0124 + pM[
GA04]*det4_1245_0123;
859 const Double_t det5_01245_01235 = pM[
GA00]*det4_1245_1235 - pM[
GA01]*det4_1245_0235
860 + pM[
GA02]*det4_1245_0135 - pM[
GA03]*det4_1245_0125 + pM[
GA05]*det4_1245_0123;
861 const Double_t det5_01245_01245 = pM[
GA00]*det4_1245_1245 - pM[
GA01]*det4_1245_0245
862 + pM[
GA02]*det4_1245_0145 - pM[
GA04]*det4_1245_0125 + pM[
GA05]*det4_1245_0124;
863 const Double_t det5_01245_01345 = pM[
GA00]*det4_1245_1345 - pM[
GA01]*det4_1245_0345
864 + pM[
GA03]*det4_1245_0145 - pM[
GA04]*det4_1245_0135 + pM[
GA05]*det4_1245_0134;
865 const Double_t det5_01245_02345 = pM[
GA00]*det4_1245_2345 - pM[
GA02]*det4_1245_0345
866 + pM[
GA03]*det4_1245_0245 - pM[
GA04]*det4_1245_0235 + pM[
GA05]*det4_1245_0234;
867 const Double_t det5_01245_12345 = pM[
GA01]*det4_1245_2345 - pM[
GA02]*det4_1245_1345
868 + pM[
GA03]*det4_1245_1245 - pM[
GA04]*det4_1245_1235 + pM[
GA05]*det4_1245_1234;
869 const Double_t det5_01345_01234 = pM[
GA00]*det4_1345_1234 - pM[
GA01]*det4_1345_0234
870 + pM[
GA02]*det4_1345_0134 - pM[
GA03]*det4_1345_0124 + pM[
GA04]*det4_1345_0123;
871 const Double_t det5_01345_01235 = pM[
GA00]*det4_1345_1235 - pM[
GA01]*det4_1345_0235
872 + pM[
GA02]*det4_1345_0135 - pM[
GA03]*det4_1345_0125 + pM[
GA05]*det4_1345_0123;
873 const Double_t det5_01345_01245 = pM[
GA00]*det4_1345_1245 - pM[
GA01]*det4_1345_0245
874 + pM[
GA02]*det4_1345_0145 - pM[
GA04]*det4_1345_0125 + pM[
GA05]*det4_1345_0124;
875 const Double_t det5_01345_01345 = pM[
GA00]*det4_1345_1345 - pM[
GA01]*det4_1345_0345
876 + pM[
GA03]*det4_1345_0145 - pM[
GA04]*det4_1345_0135 + pM[
GA05]*det4_1345_0134;
877 const Double_t det5_01345_02345 = pM[
GA00]*det4_1345_2345 - pM[
GA02]*det4_1345_0345
878 + pM[
GA03]*det4_1345_0245 - pM[
GA04]*det4_1345_0235 + pM[
GA05]*det4_1345_0234;
879 const Double_t det5_01345_12345 = pM[
GA01]*det4_1345_2345 - pM[
GA02]*det4_1345_1345
880 + pM[
GA03]*det4_1345_1245 - pM[
GA04]*det4_1345_1235 + pM[
GA05]*det4_1345_1234;
881 const Double_t det5_02345_01234 = pM[
GA00]*det4_2345_1234 - pM[
GA01]*det4_2345_0234
882 + pM[
GA02]*det4_2345_0134 - pM[
GA03]*det4_2345_0124 + pM[
GA04]*det4_2345_0123;
883 const Double_t det5_02345_01235 = pM[
GA00]*det4_2345_1235 - pM[
GA01]*det4_2345_0235
884 + pM[
GA02]*det4_2345_0135 - pM[
GA03]*det4_2345_0125 + pM[
GA05]*det4_2345_0123;
885 const Double_t det5_02345_01245 = pM[
GA00]*det4_2345_1245 - pM[
GA01]*det4_2345_0245
886 + pM[
GA02]*det4_2345_0145 - pM[
GA04]*det4_2345_0125 + pM[
GA05]*det4_2345_0124;
887 const Double_t det5_02345_01345 = pM[
GA00]*det4_2345_1345 - pM[
GA01]*det4_2345_0345
888 + pM[
GA03]*det4_2345_0145 - pM[
GA04]*det4_2345_0135 + pM[
GA05]*det4_2345_0134;
889 const Double_t det5_02345_02345 = pM[
GA00]*det4_2345_2345 - pM[
GA02]*det4_2345_0345
890 + pM[
GA03]*det4_2345_0245 - pM[
GA04]*det4_2345_0235 + pM[
GA05]*det4_2345_0234;
891 const Double_t det5_02345_12345 = pM[
GA01]*det4_2345_2345 - pM[
GA02]*det4_2345_1345
892 + pM[
GA03]*det4_2345_1245 - pM[
GA04]*det4_2345_1235 + pM[
GA05]*det4_2345_1234;
893 const Double_t det5_12345_01234 = pM[
GA10]*det4_2345_1234 - pM[
GA11]*det4_2345_0234
894 + pM[
GA12]*det4_2345_0134 - pM[
GA13]*det4_2345_0124 + pM[
GA14]*det4_2345_0123;
895 const Double_t det5_12345_01235 = pM[
GA10]*det4_2345_1235 - pM[
GA11]*det4_2345_0235
896 + pM[
GA12]*det4_2345_0135 - pM[
GA13]*det4_2345_0125 + pM[
GA15]*det4_2345_0123;
897 const Double_t det5_12345_01245 = pM[
GA10]*det4_2345_1245 - pM[
GA11]*det4_2345_0245
898 + pM[
GA12]*det4_2345_0145 - pM[
GA14]*det4_2345_0125 + pM[
GA15]*det4_2345_0124;
899 const Double_t det5_12345_01345 = pM[
GA10]*det4_2345_1345 - pM[
GA11]*det4_2345_0345
900 + pM[
GA13]*det4_2345_0145 - pM[
GA14]*det4_2345_0135 + pM[
GA15]*det4_2345_0134;
901 const Double_t det5_12345_02345 = pM[
GA10]*det4_2345_2345 - pM[
GA12]*det4_2345_0345
902 + pM[
GA13]*det4_2345_0245 - pM[
GA14]*det4_2345_0235 + pM[
GA15]*det4_2345_0234;
903 const Double_t det5_12345_12345 = pM[
GA11]*det4_2345_2345 - pM[
GA12]*det4_2345_1345
904 + pM[
GA13]*det4_2345_1245 - pM[
GA14]*det4_2345_1235 + pM[
GA15]*det4_2345_1234;
908 const Double_t det = pM[
GA00]*det5_12345_12345 - pM[
GA01]*det5_12345_02345 + pM[
GA02]*det5_12345_01345
909 - pM[
GA03]*det5_12345_01245 + pM[
GA04]*det5_12345_01235 - pM[
GA05]*det5_12345_01234;
914 Error(
"Inv6x6",
"matrix is singular");
918 const Double_t oneOverDet = 1.0/det;
919 const Double_t mn1OverDet = - oneOverDet;
921 pM[
GA00] = det5_12345_12345*oneOverDet;
922 pM[
GA01] = det5_02345_12345*mn1OverDet;
923 pM[
GA02] = det5_01345_12345*oneOverDet;
924 pM[
GA03] = det5_01245_12345*mn1OverDet;
925 pM[
GA04] = det5_01235_12345*oneOverDet;
926 pM[
GA05] = det5_01234_12345*mn1OverDet;
928 pM[
GA10] = det5_12345_02345*mn1OverDet;
929 pM[
GA11] = det5_02345_02345*oneOverDet;
930 pM[
GA12] = det5_01345_02345*mn1OverDet;
931 pM[
GA13] = det5_01245_02345*oneOverDet;
932 pM[
GA14] = det5_01235_02345*mn1OverDet;
933 pM[
GA15] = det5_01234_02345*oneOverDet;
935 pM[
GA20] = det5_12345_01345*oneOverDet;
936 pM[
GA21] = det5_02345_01345*mn1OverDet;
937 pM[
GA22] = det5_01345_01345*oneOverDet;
938 pM[
GA23] = det5_01245_01345*mn1OverDet;
939 pM[
GA24] = det5_01235_01345*oneOverDet;
940 pM[
GA25] = det5_01234_01345*mn1OverDet;
942 pM[
GA30] = det5_12345_01245*mn1OverDet;
943 pM[
GA31] = det5_02345_01245*oneOverDet;
944 pM[
GA32] = det5_01345_01245*mn1OverDet;
945 pM[
GA33] = det5_01245_01245*oneOverDet;
946 pM[
GA34] = det5_01235_01245*mn1OverDet;
947 pM[
GA35] = det5_01234_01245*oneOverDet;
949 pM[
GA40] = det5_12345_01235*oneOverDet;
950 pM[
GA41] = det5_02345_01235*mn1OverDet;
951 pM[
GA42] = det5_01345_01235*oneOverDet;
952 pM[
GA43] = det5_01245_01235*mn1OverDet;
953 pM[
GA44] = det5_01235_01235*oneOverDet;
954 pM[
GA45] = det5_01234_01235*mn1OverDet;
956 pM[
GA50] = det5_12345_01234*mn1OverDet;
957 pM[
GA51] = det5_02345_01234*oneOverDet;
958 pM[
GA52] = det5_01345_01234*mn1OverDet;
959 pM[
GA53] = det5_01245_01234*oneOverDet;
960 pM[
GA54] = det5_01235_01234*mn1OverDet;
961 pM[
GA55] = det5_01234_01234*oneOverDet;
#define NamespaceImp(name)
void Error(const char *location, const char *msgfmt,...)
static constexpr double s
Bool_t Inv6x6(TMatrixT< Element > &m, Double_t *determ)
Bool_t Inv3x3(TMatrixT< Element > &m, Double_t *determ)
Bool_t Inv4x4(TMatrixT< Element > &m, Double_t *determ)
Bool_t Inv2x2(TMatrixT< Element > &m, Double_t *determ)
Bool_t Inv5x5(TMatrixT< Element > &m, Double_t *determ)