734 G4double c11, c12, c13, c22, c23, c33;
735 c11 = (*(m.begin() + 2)) * (*(m.begin() + 5)) -
736 (*(m.begin() + 4)) * (*(m.begin() + 4));
737 c12 = (*(m.begin() + 4)) * (*(m.begin() + 3)) -
738 (*(m.begin() + 1)) * (*(m.begin() + 5));
739 c13 = (*(m.begin() + 1)) * (*(m.begin() + 4)) -
740 (*(m.begin() + 2)) * (*(m.begin() + 3));
741 c22 = (*(m.begin() + 5)) * (*m.begin()) -
742 (*(m.begin() + 3)) * (*(m.begin() + 3));
743 c23 = (*(m.begin() + 3)) * (*(m.begin() + 1)) -
744 (*(m.begin() + 4)) * (*m.begin());
745 c33 = (*m.begin()) * (*(m.begin() + 2)) -
746 (*(m.begin() + 1)) * (*(m.begin() + 1));
747 t1 = std::fabs(*m.begin());
748 t2 = std::fabs(*(m.begin() + 1));
749 t3 = std::fabs(*(m.begin() + 3));
754 temp = *(m.begin() + 3);
755 det = c23 * c12 - c22 * c13;
760 det = c22 * c33 - c23 * c23;
765 temp = *(m.begin() + 3);
766 det = c23 * c12 - c22 * c13;
770 temp = *(m.begin() + 1);
771 det = c13 * c23 - c12 * c33;
793 det = (*m.begin()) * (*(m.begin() + 2)) -
794 (*(m.begin() + 1)) * (*(m.begin() + 1));
801 *(m.begin() + 1) *= -ss;
802 temp = ss * (*(m.begin() + 2));
803 *(m.begin() + 2) = ss * (*m.begin());
809 if((*m.begin()) == 0)
814 *m.begin() = 1.0 / (*m.begin());
893 static const G4int max_array = 25;
896 xvec =
new std::vector<G4double>(max_array);
899 pivv =
new std::vector<G4int>(max_array);
900 typedef std::vector<G4int>::iterator pivIter;
901 if(xvec->size() <
static_cast<unsigned int>(nrow))
903 if(pivv->size() <
static_cast<unsigned int>(nrow))
911 pivIter piv = pivv->begin();
924 for(i = 0; i < nrow; i++)
935 for(j = 1; j < nrow; j += ss)
937 mjj = m.begin() + j * (j - 1) / 2 + j - 1;
940 ip = m.begin() + (j + 1) * j / 2 + j - 1;
941 for(i = j + 1; i <= nrow; ip += i++)
943 if(std::fabs(*ip) > lambda)
945 lambda = std::fabs(*ip);
961 if(std::fabs(*mjj) >= lambda * alpha)
969 ip = m.begin() + pivrow * (pivrow - 1) / 2 + j - 1;
970 for(k = j; k < pivrow; k++)
972 if(std::fabs(*ip) > sigma)
973 sigma = std::fabs(*ip);
976 if(sigma * std::fabs(*mjj) >= alpha * lambda * lambda)
981 else if(std::fabs(*(m.begin() + pivrow * (pivrow - 1) / 2 + pivrow -
982 1)) >= alpha * sigma)
999 temp2 = *mjj = 1. / *mjj;
1002 for(i = j + 1; i <= nrow; i++)
1004 temp1 = *(m.begin() + i * (i - 1) / 2 + j - 1) * temp2;
1005 ip = m.begin() + i * (i - 1) / 2 + j;
1006 for(k = j + 1; k <= i; k++)
1008 *ip -= temp1 * *(m.begin() + k * (k - 1) / 2 + j - 1);
1017 ip = m.begin() + (j + 1) * j / 2 + j - 1;
1018 for(i = j + 1; i <= nrow; ip += i++)
1025 piv[j - 1] = pivrow;
1029 ip = m.begin() + pivrow * (pivrow - 1) / 2 + j;
1030 for(i = j + 1; i < pivrow; i++, ip++)
1032 temp1 = *(m.begin() + i * (i - 1) / 2 + j - 1);
1033 *(m.begin() + i * (i - 1) / 2 + j - 1) = *ip;
1037 *mjj = *(m.begin() + pivrow * (pivrow - 1) / 2 + pivrow - 1);
1038 *(m.begin() + pivrow * (pivrow - 1) / 2 + pivrow - 1) = temp1;
1039 ip = m.begin() + (pivrow + 1) * pivrow / 2 + j - 1;
1040 iq = ip + pivrow - j;
1041 for(i = pivrow + 1; i <= nrow; ip += i, iq += i++)
1053 temp2 = *mjj = 1. / *mjj;
1056 for(i = j + 1; i <= nrow; i++)
1058 temp1 = *(m.begin() + i * (i - 1) / 2 + j - 1) * temp2;
1059 ip = m.begin() + i * (i - 1) / 2 + j;
1060 for(k = j + 1; k <= i; k++)
1062 *ip -= temp1 * *(m.begin() + k * (k - 1) / 2 + j - 1);
1071 ip = m.begin() + (j + 1) * j / 2 + j - 1;
1072 for(i = j + 1; i <= nrow; ip += i++)
1079 piv[j - 1] = -pivrow;
1086 ip = m.begin() + pivrow * (pivrow - 1) / 2 + j + 1;
1087 for(i = j + 2; i < pivrow; i++, ip++)
1089 temp1 = *(m.begin() + i * (i - 1) / 2 + j);
1090 *(m.begin() + i * (i - 1) / 2 + j) = *ip;
1093 temp1 = *(mjj + j + 1);
1095 *(m.begin() + pivrow * (pivrow - 1) / 2 + pivrow - 1);
1096 *(m.begin() + pivrow * (pivrow - 1) / 2 + pivrow - 1) = temp1;
1098 *(mjj + j) = *(m.begin() + pivrow * (pivrow - 1) / 2 + j - 1);
1099 *(m.begin() + pivrow * (pivrow - 1) / 2 + j - 1) = temp1;
1100 ip = m.begin() + (pivrow + 1) * pivrow / 2 + j;
1101 iq = ip + pivrow - (j + 1);
1102 for(i = pivrow + 1; i <= nrow; ip += i, iq += i++)
1110 temp2 = *mjj * *(mjj + j + 1) - *(mjj + j) * *(mjj + j);
1115 "Error in pivot choice!");
1123 *mjj = *(mjj + j + 1) * temp2;
1124 *(mjj + j + 1) = temp1 * temp2;
1125 *(mjj + j) = -*(mjj + j) * temp2;
1130 for(i = j + 2; i <= nrow; i++)
1132 ip = m.begin() + i * (i - 1) / 2 + j - 1;
1133 temp1 = *ip * *mjj + *(ip + 1) * *(mjj + j);
1134 if(std::fabs(temp1) <=
epsilon)
1138 temp2 = *ip * *(mjj + j) + *(ip + 1) * *(mjj + j + 1);
1139 if(std::fabs(temp2) <=
epsilon)
1143 for(k = j + 2; k <= i; k++)
1145 ip = m.begin() + i * (i - 1) / 2 + k - 1;
1146 iq = m.begin() + k * (k - 1) / 2 + j - 1;
1147 *ip -= temp1 * *iq + temp2 * *(iq + 1);
1155 for(i = j + 2; i <= nrow; i++)
1157 ip = m.begin() + i * (i - 1) / 2 + j - 1;
1158 temp1 = *ip * *mjj + *(ip + 1) * *(mjj + j);
1159 if(std::fabs(temp1) <=
epsilon)
1163 *(ip + 1) = *ip * *(mjj + j) + *(ip + 1) * *(mjj + j + 1);
1164 if(std::fabs(*(ip + 1)) <=
epsilon)
1177 mjj = m.begin() + j * (j - 1) / 2 + j - 1;
1191 for(j = nrow; j >= 1; j -= ss)
1193 mjj = m.begin() + j * (j - 1) / 2 + j - 1;
1199 ip = m.begin() + (j + 1) * j / 2 + j - 1;
1200 for(i = 0; i < nrow - j; ip += 1 + j + i++)
1204 for(i = j + 1; i <= nrow; i++)
1207 ip = m.begin() + i * (i - 1) / 2 + j;
1208 for(k = 0; k <= i - j - 1; k++)
1210 temp2 += *ip++ * x[k];
1212 for(ip += i - 1; k < nrow - j; ip += 1 + j + k++)
1214 temp2 += *ip * x[k];
1216 *(m.begin() + i * (i - 1) / 2 + j - 1) = -temp2;
1219 ip = m.begin() + (j + 1) * j / 2 + j - 1;
1220 for(k = 0; k < nrow - j; ip += 1 + j + k++)
1222 temp2 += x[k] * *ip;
1231 std::ostringstream message;
1232 message <<
"Error in pivot: " << piv[j - 1];
1233 G4Exception(
"G4ErrorSymMatrix::invertBunchKaufman()",
1239 ip = m.begin() + (j + 1) * j / 2 + j - 1;
1240 for(i = 0; i < nrow - j; ip += 1 + j + i++)
1244 for(i = j + 1; i <= nrow; i++)
1247 ip = m.begin() + i * (i - 1) / 2 + j;
1248 for(k = 0; k <= i - j - 1; k++)
1250 temp2 += *ip++ * x[k];
1252 for(ip += i - 1; k < nrow - j; ip += 1 + j + k++)
1254 temp2 += *ip * x[k];
1256 *(m.begin() + i * (i - 1) / 2 + j - 1) = -temp2;
1259 ip = m.begin() + (j + 1) * j / 2 + j - 1;
1260 for(k = 0; k < nrow - j; ip += 1 + j + k++)
1262 temp2 += x[k] * *ip;
1266 ip = m.begin() + (j + 1) * j / 2 + j - 2;
1267 for(i = j + 1; i <= nrow; ip += i++)
1269 temp2 += *ip * *(ip + 1);
1271 *(mjj - 1) -= temp2;
1272 ip = m.begin() + (j + 1) * j / 2 + j - 2;
1273 for(i = 0; i < nrow - j; ip += 1 + j + i++)
1277 for(i = j + 1; i <= nrow; i++)
1280 ip = m.begin() + i * (i - 1) / 2 + j;
1281 for(k = 0; k <= i - j - 1; k++)
1283 temp2 += *ip++ * x[k];
1285 for(ip += i - 1; k < nrow - j; ip += 1 + j + k++)
1287 temp2 += *ip * x[k];
1289 *(m.begin() + i * (i - 1) / 2 + j - 2) = -temp2;
1292 ip = m.begin() + (j + 1) * j / 2 + j - 2;
1293 for(k = 0; k < nrow - j; ip += 1 + j + k++)
1295 temp2 += x[k] * *ip;
1297 *(mjj - j) -= temp2;
1304 pivrow = (piv[j - 1] == 0) ? -piv[j - 2] : piv[j - 1];
1305 ip = m.begin() + pivrow * (pivrow - 1) / 2 + j;
1306 for(i = j + 1; i < pivrow; i++, ip++)
1308 temp1 = *(m.begin() + i * (i - 1) / 2 + j - 1);
1309 *(m.begin() + i * (i - 1) / 2 + j - 1) = *ip;
1313 *mjj = *(m.begin() + pivrow * (pivrow - 1) / 2 + pivrow - 1);
1314 *(m.begin() + pivrow * (pivrow - 1) / 2 + pivrow - 1) = temp1;
1318 *(mjj - 1) = *(m.begin() + pivrow * (pivrow - 1) / 2 + j - 2);
1319 *(m.begin() + pivrow * (pivrow - 1) / 2 + j - 2) = temp1;
1322 ip = m.begin() + (pivrow + 1) * pivrow / 2 + j - 1;
1323 iq = ip + pivrow - j;
1324 for(i = pivrow + 1; i <= nrow; ip += i, iq += i++)
1669 m[
A20] * Det2_34_12 - m[
A21] * Det2_34_02 + m[
A22] * Det2_34_01;
1671 m[
A20] * Det2_34_13 - m[
A21] * Det2_34_03 + m[
A23] * Det2_34_01;
1673 m[
A20] * Det2_34_14 - m[
A21] * Det2_34_04 + m[
A24] * Det2_34_01;
1675 m[
A20] * Det2_34_23 - m[
A22] * Det2_34_03 + m[
A23] * Det2_34_02;
1677 m[
A20] * Det2_34_24 - m[
A22] * Det2_34_04 + m[
A24] * Det2_34_02;
1679 m[
A20] * Det2_34_34 - m[
A23] * Det2_34_04 + m[
A24] * Det2_34_03;
1681 m[
A21] * Det2_34_23 - m[
A22] * Det2_34_13 + m[
A23] * Det2_34_12;
1683 m[
A21] * Det2_34_24 - m[
A22] * Det2_34_14 + m[
A24] * Det2_34_12;
1685 m[
A21] * Det2_34_34 - m[
A23] * Det2_34_14 + m[
A24] * Det2_34_13;
1687 m[
A22] * Det2_34_34 - m[
A23] * Det2_34_24 + m[
A24] * Det2_34_23;
1689 m[
A20] * Det2_35_12 - m[
A21] * Det2_35_02 + m[
A22] * Det2_35_01;
1691 m[
A20] * Det2_35_13 - m[
A21] * Det2_35_03 + m[
A23] * Det2_35_01;
1693 m[
A20] * Det2_35_14 - m[
A21] * Det2_35_04 + m[
A24] * Det2_35_01;
1695 m[
A20] * Det2_35_15 - m[
A21] * Det2_35_05 + m[
A25] * Det2_35_01;
1697 m[
A20] * Det2_35_23 - m[
A22] * Det2_35_03 + m[
A23] * Det2_35_02;
1699 m[
A20] * Det2_35_24 - m[
A22] * Det2_35_04 + m[
A24] * Det2_35_02;
1701 m[
A20] * Det2_35_25 - m[
A22] * Det2_35_05 + m[
A25] * Det2_35_02;
1703 m[
A20] * Det2_35_34 - m[
A23] * Det2_35_04 + m[
A24] * Det2_35_03;
1705 m[
A20] * Det2_35_35 - m[
A23] * Det2_35_05 + m[
A25] * Det2_35_03;
1707 m[
A21] * Det2_35_23 - m[
A22] * Det2_35_13 + m[
A23] * Det2_35_12;
1709 m[
A21] * Det2_35_24 - m[
A22] * Det2_35_14 + m[
A24] * Det2_35_12;
1711 m[
A21] * Det2_35_25 - m[
A22] * Det2_35_15 + m[
A25] * Det2_35_12;
1713 m[
A21] * Det2_35_34 - m[
A23] * Det2_35_14 + m[
A24] * Det2_35_13;
1715 m[
A21] * Det2_35_35 - m[
A23] * Det2_35_15 + m[
A25] * Det2_35_13;
1717 m[
A22] * Det2_35_34 - m[
A23] * Det2_35_24 + m[
A24] * Det2_35_23;
1719 m[
A22] * Det2_35_35 - m[
A23] * Det2_35_25 + m[
A25] * Det2_35_23;
1721 m[
A20] * Det2_45_12 - m[
A21] * Det2_45_02 + m[
A22] * Det2_45_01;
1723 m[
A20] * Det2_45_13 - m[
A21] * Det2_45_03 + m[
A23] * Det2_45_01;
1725 m[
A20] * Det2_45_14 - m[
A21] * Det2_45_04 + m[
A24] * Det2_45_01;
1727 m[
A20] * Det2_45_15 - m[
A21] * Det2_45_05 + m[
A25] * Det2_45_01;
1729 m[
A20] * Det2_45_23 - m[
A22] * Det2_45_03 + m[
A23] * Det2_45_02;
1731 m[
A20] * Det2_45_24 - m[
A22] * Det2_45_04 + m[
A24] * Det2_45_02;
1733 m[
A20] * Det2_45_25 - m[
A22] * Det2_45_05 + m[
A25] * Det2_45_02;
1735 m[
A20] * Det2_45_34 - m[
A23] * Det2_45_04 + m[
A24] * Det2_45_03;
1737 m[
A20] * Det2_45_35 - m[
A23] * Det2_45_05 + m[
A25] * Det2_45_03;
1739 m[
A20] * Det2_45_45 - m[
A24] * Det2_45_05 + m[
A25] * Det2_45_04;
1741 m[
A21] * Det2_45_23 - m[
A22] * Det2_45_13 + m[
A23] * Det2_45_12;
1743 m[
A21] * Det2_45_24 - m[
A22] * Det2_45_14 + m[
A24] * Det2_45_12;
1745 m[
A21] * Det2_45_25 - m[
A22] * Det2_45_15 + m[
A25] * Det2_45_12;
1747 m[
A21] * Det2_45_34 - m[
A23] * Det2_45_14 + m[
A24] * Det2_45_13;
1749 m[
A21] * Det2_45_35 - m[
A23] * Det2_45_15 + m[
A25] * Det2_45_13;
1751 m[
A21] * Det2_45_45 - m[
A24] * Det2_45_15 + m[
A25] * Det2_45_14;
1753 m[
A22] * Det2_45_34 - m[
A23] * Det2_45_24 + m[
A24] * Det2_45_23;
1755 m[
A22] * Det2_45_35 - m[
A23] * Det2_45_25 + m[
A25] * Det2_45_23;
1757 m[
A22] * Det2_45_45 - m[
A24] * Det2_45_25 + m[
A25] * Det2_45_24;
1759 m[
A30] * Det2_45_12 - m[
A31] * Det2_45_02 + m[
A32] * Det2_45_01;
1761 m[
A30] * Det2_45_13 - m[
A31] * Det2_45_03 + m[
A33] * Det2_45_01;
1763 m[
A30] * Det2_45_14 - m[
A31] * Det2_45_04 + m[
A34] * Det2_45_01;
1765 m[
A30] * Det2_45_15 - m[
A31] * Det2_45_05 + m[
A35] * Det2_45_01;
1767 m[
A30] * Det2_45_23 - m[
A32] * Det2_45_03 + m[
A33] * Det2_45_02;
1769 m[
A30] * Det2_45_24 - m[
A32] * Det2_45_04 + m[
A34] * Det2_45_02;
1771 m[
A30] * Det2_45_25 - m[
A32] * Det2_45_05 + m[
A35] * Det2_45_02;
1773 m[
A30] * Det2_45_34 - m[
A33] * Det2_45_04 + m[
A34] * Det2_45_03;
1775 m[
A30] * Det2_45_35 - m[
A33] * Det2_45_05 + m[
A35] * Det2_45_03;
1777 m[
A30] * Det2_45_45 - m[
A34] * Det2_45_05 + m[
A35] * Det2_45_04;
1779 m[
A31] * Det2_45_23 - m[
A32] * Det2_45_13 + m[
A33] * Det2_45_12;
1781 m[
A31] * Det2_45_24 - m[
A32] * Det2_45_14 + m[
A34] * Det2_45_12;
1783 m[
A31] * Det2_45_25 - m[
A32] * Det2_45_15 + m[
A35] * Det2_45_12;
1785 m[
A31] * Det2_45_34 - m[
A33] * Det2_45_14 + m[
A34] * Det2_45_13;
1787 m[
A31] * Det2_45_35 - m[
A33] * Det2_45_15 + m[
A35] * Det2_45_13;
1789 m[
A31] * Det2_45_45 - m[
A34] * Det2_45_15 + m[
A35] * Det2_45_14;
1791 m[
A32] * Det2_45_34 - m[
A33] * Det2_45_24 + m[
A34] * Det2_45_23;
1793 m[
A32] * Det2_45_35 - m[
A33] * Det2_45_25 + m[
A35] * Det2_45_23;
1795 m[
A32] * Det2_45_45 - m[
A34] * Det2_45_25 + m[
A35] * Det2_45_24;
1797 m[
A33] * Det2_45_45 - m[
A34] * Det2_45_35 + m[
A35] * Det2_45_34;
1801 G4double Det4_1234_0123 = m[
A10] * Det3_234_123 - m[
A11] * Det3_234_023 +
1802 m[
A12] * Det3_234_013 - m[
A13] * Det3_234_012;
1803 G4double Det4_1234_0124 = m[
A10] * Det3_234_124 - m[
A11] * Det3_234_024 +
1804 m[
A12] * Det3_234_014 - m[
A14] * Det3_234_012;
1805 G4double Det4_1234_0134 = m[
A10] * Det3_234_134 - m[
A11] * Det3_234_034 +
1806 m[
A13] * Det3_234_014 - m[
A14] * Det3_234_013;
1807 G4double Det4_1234_0234 = m[
A10] * Det3_234_234 - m[
A12] * Det3_234_034 +
1808 m[
A13] * Det3_234_024 - m[
A14] * Det3_234_023;
1809 G4double Det4_1234_1234 = m[
A11] * Det3_234_234 - m[
A12] * Det3_234_134 +
1810 m[
A13] * Det3_234_124 - m[
A14] * Det3_234_123;
1811 G4double Det4_1235_0123 = m[
A10] * Det3_235_123 - m[
A11] * Det3_235_023 +
1812 m[
A12] * Det3_235_013 - m[
A13] * Det3_235_012;
1813 G4double Det4_1235_0124 = m[
A10] * Det3_235_124 - m[
A11] * Det3_235_024 +
1814 m[
A12] * Det3_235_014 - m[
A14] * Det3_235_012;
1815 G4double Det4_1235_0125 = m[
A10] * Det3_235_125 - m[
A11] * Det3_235_025 +
1816 m[
A12] * Det3_235_015 - m[
A15] * Det3_235_012;
1817 G4double Det4_1235_0134 = m[
A10] * Det3_235_134 - m[
A11] * Det3_235_034 +
1818 m[
A13] * Det3_235_014 - m[
A14] * Det3_235_013;
1819 G4double Det4_1235_0135 = m[
A10] * Det3_235_135 - m[
A11] * Det3_235_035 +
1820 m[
A13] * Det3_235_015 - m[
A15] * Det3_235_013;
1821 G4double Det4_1235_0234 = m[
A10] * Det3_235_234 - m[
A12] * Det3_235_034 +
1822 m[
A13] * Det3_235_024 - m[
A14] * Det3_235_023;
1823 G4double Det4_1235_0235 = m[
A10] * Det3_235_235 - m[
A12] * Det3_235_035 +
1824 m[
A13] * Det3_235_025 - m[
A15] * Det3_235_023;
1825 G4double Det4_1235_1234 = m[
A11] * Det3_235_234 - m[
A12] * Det3_235_134 +
1826 m[
A13] * Det3_235_124 - m[
A14] * Det3_235_123;
1827 G4double Det4_1235_1235 = m[
A11] * Det3_235_235 - m[
A12] * Det3_235_135 +
1828 m[
A13] * Det3_235_125 - m[
A15] * Det3_235_123;
1829 G4double Det4_1245_0123 = m[
A10] * Det3_245_123 - m[
A11] * Det3_245_023 +
1830 m[
A12] * Det3_245_013 - m[
A13] * Det3_245_012;
1831 G4double Det4_1245_0124 = m[
A10] * Det3_245_124 - m[
A11] * Det3_245_024 +
1832 m[
A12] * Det3_245_014 - m[
A14] * Det3_245_012;
1833 G4double Det4_1245_0125 = m[
A10] * Det3_245_125 - m[
A11] * Det3_245_025 +
1834 m[
A12] * Det3_245_015 - m[
A15] * Det3_245_012;
1835 G4double Det4_1245_0134 = m[
A10] * Det3_245_134 - m[
A11] * Det3_245_034 +
1836 m[
A13] * Det3_245_014 - m[
A14] * Det3_245_013;
1837 G4double Det4_1245_0135 = m[
A10] * Det3_245_135 - m[
A11] * Det3_245_035 +
1838 m[
A13] * Det3_245_015 - m[
A15] * Det3_245_013;
1839 G4double Det4_1245_0145 = m[
A10] * Det3_245_145 - m[
A11] * Det3_245_045 +
1840 m[
A14] * Det3_245_015 - m[
A15] * Det3_245_014;
1841 G4double Det4_1245_0234 = m[
A10] * Det3_245_234 - m[
A12] * Det3_245_034 +
1842 m[
A13] * Det3_245_024 - m[
A14] * Det3_245_023;
1843 G4double Det4_1245_0235 = m[
A10] * Det3_245_235 - m[
A12] * Det3_245_035 +
1844 m[
A13] * Det3_245_025 - m[
A15] * Det3_245_023;
1845 G4double Det4_1245_0245 = m[
A10] * Det3_245_245 - m[
A12] * Det3_245_045 +
1846 m[
A14] * Det3_245_025 - m[
A15] * Det3_245_024;
1847 G4double Det4_1245_1234 = m[
A11] * Det3_245_234 - m[
A12] * Det3_245_134 +
1848 m[
A13] * Det3_245_124 - m[
A14] * Det3_245_123;
1849 G4double Det4_1245_1235 = m[
A11] * Det3_245_235 - m[
A12] * Det3_245_135 +
1850 m[
A13] * Det3_245_125 - m[
A15] * Det3_245_123;
1851 G4double Det4_1245_1245 = m[
A11] * Det3_245_245 - m[
A12] * Det3_245_145 +
1852 m[
A14] * Det3_245_125 - m[
A15] * Det3_245_124;
1853 G4double Det4_1345_0123 = m[
A10] * Det3_345_123 - m[
A11] * Det3_345_023 +
1854 m[
A12] * Det3_345_013 - m[
A13] * Det3_345_012;
1855 G4double Det4_1345_0124 = m[
A10] * Det3_345_124 - m[
A11] * Det3_345_024 +
1856 m[
A12] * Det3_345_014 - m[
A14] * Det3_345_012;
1857 G4double Det4_1345_0125 = m[
A10] * Det3_345_125 - m[
A11] * Det3_345_025 +
1858 m[
A12] * Det3_345_015 - m[
A15] * Det3_345_012;
1859 G4double Det4_1345_0134 = m[
A10] * Det3_345_134 - m[
A11] * Det3_345_034 +
1860 m[
A13] * Det3_345_014 - m[
A14] * Det3_345_013;
1861 G4double Det4_1345_0135 = m[
A10] * Det3_345_135 - m[
A11] * Det3_345_035 +
1862 m[
A13] * Det3_345_015 - m[
A15] * Det3_345_013;
1863 G4double Det4_1345_0145 = m[
A10] * Det3_345_145 - m[
A11] * Det3_345_045 +
1864 m[
A14] * Det3_345_015 - m[
A15] * Det3_345_014;
1865 G4double Det4_1345_0234 = m[
A10] * Det3_345_234 - m[
A12] * Det3_345_034 +
1866 m[
A13] * Det3_345_024 - m[
A14] * Det3_345_023;
1867 G4double Det4_1345_0235 = m[
A10] * Det3_345_235 - m[
A12] * Det3_345_035 +
1868 m[
A13] * Det3_345_025 - m[
A15] * Det3_345_023;
1869 G4double Det4_1345_0245 = m[
A10] * Det3_345_245 - m[
A12] * Det3_345_045 +
1870 m[
A14] * Det3_345_025 - m[
A15] * Det3_345_024;
1871 G4double Det4_1345_0345 = m[
A10] * Det3_345_345 - m[
A13] * Det3_345_045 +
1872 m[
A14] * Det3_345_035 - m[
A15] * Det3_345_034;
1873 G4double Det4_1345_1234 = m[
A11] * Det3_345_234 - m[
A12] * Det3_345_134 +
1874 m[
A13] * Det3_345_124 - m[
A14] * Det3_345_123;
1875 G4double Det4_1345_1235 = m[
A11] * Det3_345_235 - m[
A12] * Det3_345_135 +
1876 m[
A13] * Det3_345_125 - m[
A15] * Det3_345_123;
1877 G4double Det4_1345_1245 = m[
A11] * Det3_345_245 - m[
A12] * Det3_345_145 +
1878 m[
A14] * Det3_345_125 - m[
A15] * Det3_345_124;
1879 G4double Det4_1345_1345 = m[
A11] * Det3_345_345 - m[
A13] * Det3_345_145 +
1880 m[
A14] * Det3_345_135 - m[
A15] * Det3_345_134;
1881 G4double Det4_2345_0123 = m[
A20] * Det3_345_123 - m[
A21] * Det3_345_023 +
1882 m[
A22] * Det3_345_013 - m[
A23] * Det3_345_012;
1883 G4double Det4_2345_0124 = m[
A20] * Det3_345_124 - m[
A21] * Det3_345_024 +
1884 m[
A22] * Det3_345_014 - m[
A24] * Det3_345_012;
1885 G4double Det4_2345_0125 = m[
A20] * Det3_345_125 - m[
A21] * Det3_345_025 +
1886 m[
A22] * Det3_345_015 - m[
A25] * Det3_345_012;
1887 G4double Det4_2345_0134 = m[
A20] * Det3_345_134 - m[
A21] * Det3_345_034 +
1888 m[
A23] * Det3_345_014 - m[
A24] * Det3_345_013;
1889 G4double Det4_2345_0135 = m[
A20] * Det3_345_135 - m[
A21] * Det3_345_035 +
1890 m[
A23] * Det3_345_015 - m[
A25] * Det3_345_013;
1891 G4double Det4_2345_0145 = m[
A20] * Det3_345_145 - m[
A21] * Det3_345_045 +
1892 m[
A24] * Det3_345_015 - m[
A25] * Det3_345_014;
1893 G4double Det4_2345_0234 = m[
A20] * Det3_345_234 - m[
A22] * Det3_345_034 +
1894 m[
A23] * Det3_345_024 - m[
A24] * Det3_345_023;
1895 G4double Det4_2345_0235 = m[
A20] * Det3_345_235 - m[
A22] * Det3_345_035 +
1896 m[
A23] * Det3_345_025 - m[
A25] * Det3_345_023;
1897 G4double Det4_2345_0245 = m[
A20] * Det3_345_245 - m[
A22] * Det3_345_045 +
1898 m[
A24] * Det3_345_025 - m[
A25] * Det3_345_024;
1899 G4double Det4_2345_0345 = m[
A20] * Det3_345_345 - m[
A23] * Det3_345_045 +
1900 m[
A24] * Det3_345_035 - m[
A25] * Det3_345_034;
1901 G4double Det4_2345_1234 = m[
A21] * Det3_345_234 - m[
A22] * Det3_345_134 +
1902 m[
A23] * Det3_345_124 - m[
A24] * Det3_345_123;
1903 G4double Det4_2345_1235 = m[
A21] * Det3_345_235 - m[
A22] * Det3_345_135 +
1904 m[
A23] * Det3_345_125 - m[
A25] * Det3_345_123;
1905 G4double Det4_2345_1245 = m[
A21] * Det3_345_245 - m[
A22] * Det3_345_145 +
1906 m[
A24] * Det3_345_125 - m[
A25] * Det3_345_124;
1907 G4double Det4_2345_1345 = m[
A21] * Det3_345_345 - m[
A23] * Det3_345_145 +
1908 m[
A24] * Det3_345_135 - m[
A25] * Det3_345_134;
1909 G4double Det4_2345_2345 = m[
A22] * Det3_345_345 - m[
A23] * Det3_345_245 +
1910 m[
A24] * Det3_345_235 - m[
A25] * Det3_345_234;
1915 m[
A00] * Det4_1234_1234 - m[
A01] * Det4_1234_0234 +
1916 m[
A02] * Det4_1234_0134 - m[
A03] * Det4_1234_0124 + m[
A04] * Det4_1234_0123;
1918 m[
A00] * Det4_1235_1234 - m[
A01] * Det4_1235_0234 +
1919 m[
A02] * Det4_1235_0134 - m[
A03] * Det4_1235_0124 + m[
A04] * Det4_1235_0123;
1921 m[
A00] * Det4_1235_1235 - m[
A01] * Det4_1235_0235 +
1922 m[
A02] * Det4_1235_0135 - m[
A03] * Det4_1235_0125 + m[
A05] * Det4_1235_0123;
1924 m[
A00] * Det4_1245_1234 - m[
A01] * Det4_1245_0234 +
1925 m[
A02] * Det4_1245_0134 - m[
A03] * Det4_1245_0124 + m[
A04] * Det4_1245_0123;
1927 m[
A00] * Det4_1245_1235 - m[
A01] * Det4_1245_0235 +
1928 m[
A02] * Det4_1245_0135 - m[
A03] * Det4_1245_0125 + m[
A05] * Det4_1245_0123;
1930 m[
A00] * Det4_1245_1245 - m[
A01] * Det4_1245_0245 +
1931 m[
A02] * Det4_1245_0145 - m[
A04] * Det4_1245_0125 + m[
A05] * Det4_1245_0124;
1933 m[
A00] * Det4_1345_1234 - m[
A01] * Det4_1345_0234 +
1934 m[
A02] * Det4_1345_0134 - m[
A03] * Det4_1345_0124 + m[
A04] * Det4_1345_0123;
1936 m[
A00] * Det4_1345_1235 - m[
A01] * Det4_1345_0235 +
1937 m[
A02] * Det4_1345_0135 - m[
A03] * Det4_1345_0125 + m[
A05] * Det4_1345_0123;
1939 m[
A00] * Det4_1345_1245 - m[
A01] * Det4_1345_0245 +
1940 m[
A02] * Det4_1345_0145 - m[
A04] * Det4_1345_0125 + m[
A05] * Det4_1345_0124;
1942 m[
A00] * Det4_1345_1345 - m[
A01] * Det4_1345_0345 +
1943 m[
A03] * Det4_1345_0145 - m[
A04] * Det4_1345_0135 + m[
A05] * Det4_1345_0134;
1945 m[
A00] * Det4_2345_1234 - m[
A01] * Det4_2345_0234 +
1946 m[
A02] * Det4_2345_0134 - m[
A03] * Det4_2345_0124 + m[
A04] * Det4_2345_0123;
1948 m[
A00] * Det4_2345_1235 - m[
A01] * Det4_2345_0235 +
1949 m[
A02] * Det4_2345_0135 - m[
A03] * Det4_2345_0125 + m[
A05] * Det4_2345_0123;
1951 m[
A00] * Det4_2345_1245 - m[
A01] * Det4_2345_0245 +
1952 m[
A02] * Det4_2345_0145 - m[
A04] * Det4_2345_0125 + m[
A05] * Det4_2345_0124;
1954 m[
A00] * Det4_2345_1345 - m[
A01] * Det4_2345_0345 +
1955 m[
A03] * Det4_2345_0145 - m[
A04] * Det4_2345_0135 + m[
A05] * Det4_2345_0134;
1957 m[
A00] * Det4_2345_2345 - m[
A02] * Det4_2345_0345 +
1958 m[
A03] * Det4_2345_0245 - m[
A04] * Det4_2345_0235 + m[
A05] * Det4_2345_0234;
1960 m[
A10] * Det4_2345_1234 - m[
A11] * Det4_2345_0234 +
1961 m[
A12] * Det4_2345_0134 - m[
A13] * Det4_2345_0124 + m[
A14] * Det4_2345_0123;
1963 m[
A10] * Det4_2345_1235 - m[
A11] * Det4_2345_0235 +
1964 m[
A12] * Det4_2345_0135 - m[
A13] * Det4_2345_0125 + m[
A15] * Det4_2345_0123;
1966 m[
A10] * Det4_2345_1245 - m[
A11] * Det4_2345_0245 +
1967 m[
A12] * Det4_2345_0145 - m[
A14] * Det4_2345_0125 + m[
A15] * Det4_2345_0124;
1969 m[
A10] * Det4_2345_1345 - m[
A11] * Det4_2345_0345 +
1970 m[
A13] * Det4_2345_0145 - m[
A14] * Det4_2345_0135 + m[
A15] * Det4_2345_0134;
1972 m[
A10] * Det4_2345_2345 - m[
A12] * Det4_2345_0345 +
1973 m[
A13] * Det4_2345_0245 - m[
A14] * Det4_2345_0235 + m[
A15] * Det4_2345_0234;
1975 m[
A11] * Det4_2345_2345 - m[
A12] * Det4_2345_1345 +
1976 m[
A13] * Det4_2345_1245 - m[
A14] * Det4_2345_1235 + m[
A15] * Det4_2345_1234;
1980 G4double det = m[
A00] * Det5_12345_12345 - m[
A01] * Det5_12345_02345 +
1981 m[
A02] * Det5_12345_01345 - m[
A03] * Det5_12345_01245 +
1982 m[
A04] * Det5_12345_01235 - m[
A05] * Det5_12345_01234;
1993 m[
A00] = Det5_12345_12345 * oneOverDet;
1994 m[
A01] = Det5_12345_02345 * mn1OverDet;
1995 m[
A02] = Det5_12345_01345 * oneOverDet;
1996 m[
A03] = Det5_12345_01245 * mn1OverDet;
1997 m[
A04] = Det5_12345_01235 * oneOverDet;
1998 m[
A05] = Det5_12345_01234 * mn1OverDet;
2000 m[
A11] = Det5_02345_02345 * oneOverDet;
2001 m[
A12] = Det5_02345_01345 * mn1OverDet;
2002 m[
A13] = Det5_02345_01245 * oneOverDet;
2003 m[
A14] = Det5_02345_01235 * mn1OverDet;
2004 m[
A15] = Det5_02345_01234 * oneOverDet;
2006 m[
A22] = Det5_01345_01345 * oneOverDet;
2007 m[
A23] = Det5_01345_01245 * mn1OverDet;
2008 m[
A24] = Det5_01345_01235 * oneOverDet;
2009 m[
A25] = Det5_01345_01234 * mn1OverDet;
2011 m[
A33] = Det5_01245_01245 * oneOverDet;
2012 m[
A34] = Det5_01245_01235 * mn1OverDet;
2013 m[
A35] = Det5_01245_01234 * oneOverDet;
2015 m[
A44] = Det5_01235_01235 * oneOverDet;
2016 m[
A45] = Det5_01235_01234 * mn1OverDet;
2018 m[
A55] = Det5_01234_01234 * oneOverDet;
2060 h00 = 1.0 / std::sqrt(h00);
2069 h11 = m[
A11] - (g10 * g10);
2074 h11 = 1.0 / std::sqrt(h11);
2079 g21 = (m[
A21] - (g10 * g20)) * h11;
2080 g31 = (m[
A31] - (g10 * g30)) * h11;
2081 g41 = (m[
A41] - (g10 * g40)) * h11;
2085 h22 = m[
A22] - (g20 * g20) - (g21 * g21);
2090 h22 = 1.0 / std::sqrt(h22);
2095 g32 = (m[
A32] - (g20 * g30) - (g21 * g31)) * h22;
2096 g42 = (m[
A42] - (g20 * g40) - (g21 * g41)) * h22;
2100 h33 = m[
A33] - (g30 * g30) - (g31 * g31) - (g32 * g32);
2105 h33 = 1.0 / std::sqrt(h33);
2109 g43 = (m[
A43] - (g30 * g40) - (g31 * g41) - (g32 * g42)) * h33;
2113 h44 = m[
A44] - (g40 * g40) - (g41 * g41) - (g42 * g42) - (g43 * g43);
2118 h44 = 1.0 / std::sqrt(h44);
2125 h43 = -h33 * g43 * h44;
2126 h32 = -h22 * g32 * h33;
2127 h42 = -h22 * (g32 * h43 + g42 * h44);
2128 h21 = -h11 * g21 * h22;
2129 h31 = -h11 * (g21 * h32 + g31 * h33);
2130 h41 = -h11 * (g21 * h42 + g31 * h43 + g41 * h44);
2131 h10 = -h00 * g10 * h11;
2132 h20 = -h00 * (g10 * h21 + g20 * h22);
2133 h30 = -h00 * (g10 * h31 + g20 * h32 + g30 * h33);
2134 h40 = -h00 * (g10 * h41 + g20 * h42 + g30 * h43 + g40 * h44);
2139 m[
A00] = h00 * h00 + h10 * h10 + h20 * h20 + h30 * h30 + h40 * h40;
2140 m[
A01] = h10 * h11 + h20 * h21 + h30 * h31 + h40 * h41;
2141 m[
A11] = h11 * h11 + h21 * h21 + h31 * h31 + h41 * h41;
2142 m[
A02] = h20 * h22 + h30 * h32 + h40 * h42;
2143 m[
A12] = h21 * h22 + h31 * h32 + h41 * h42;
2144 m[
A22] = h22 * h22 + h32 * h32 + h42 * h42;
2145 m[
A03] = h30 * h33 + h40 * h43;
2146 m[
A13] = h31 * h33 + h41 * h43;
2147 m[
A23] = h32 * h33 + h42 * h43;
2148 m[
A33] = h33 * h33 + h43 * h43;
2177 G4double h00, h11, h22, h33, h44, h55;
2198 h00 = 1.0 / std::sqrt(h00);
2208 h11 = m[
A11] - (g10 * g10);
2213 h11 = 1.0 / std::sqrt(h11);
2218 g21 = (m[
A21] - (g10 * g20)) * h11;
2219 g31 = (m[
A31] - (g10 * g30)) * h11;
2220 g41 = (m[
A41] - (g10 * g40)) * h11;
2221 g51 = (m[
A51] - (g10 * g50)) * h11;
2225 h22 = m[
A22] - (g20 * g20) - (g21 * g21);
2230 h22 = 1.0 / std::sqrt(h22);
2235 g32 = (m[
A32] - (g20 * g30) - (g21 * g31)) * h22;
2236 g42 = (m[
A42] - (g20 * g40) - (g21 * g41)) * h22;
2237 g52 = (m[
A52] - (g20 * g50) - (g21 * g51)) * h22;
2241 h33 = m[
A33] - (g30 * g30) - (g31 * g31) - (g32 * g32);
2246 h33 = 1.0 / std::sqrt(h33);
2251 g43 = (m[
A43] - (g30 * g40) - (g31 * g41) - (g32 * g42)) * h33;
2252 g53 = (m[
A53] - (g30 * g50) - (g31 * g51) - (g32 * g52)) * h33;
2256 h44 = m[
A44] - (g40 * g40) - (g41 * g41) - (g42 * g42) - (g43 * g43);
2261 h44 = 1.0 / std::sqrt(h44);
2265 g54 = (m[
A54] - (g40 * g50) - (g41 * g51) - (g42 * g52) - (g43 * g53)) * h44;
2269 h55 = m[
A55] - (g50 * g50) - (g51 * g51) - (g52 * g52) - (g53 * g53) -
2275 h55 = 1.0 / std::sqrt(h55);
2282 h54 = -h44 * g54 * h55;
2283 h43 = -h33 * g43 * h44;
2284 h53 = -h33 * (g43 * h54 + g53 * h55);
2285 h32 = -h22 * g32 * h33;
2286 h42 = -h22 * (g32 * h43 + g42 * h44);
2287 h52 = -h22 * (g32 * h53 + g42 * h54 + g52 * h55);
2288 h21 = -h11 * g21 * h22;
2289 h31 = -h11 * (g21 * h32 + g31 * h33);
2290 h41 = -h11 * (g21 * h42 + g31 * h43 + g41 * h44);
2291 h51 = -h11 * (g21 * h52 + g31 * h53 + g41 * h54 + g51 * h55);
2292 h10 = -h00 * g10 * h11;
2293 h20 = -h00 * (g10 * h21 + g20 * h22);
2294 h30 = -h00 * (g10 * h31 + g20 * h32 + g30 * h33);
2295 h40 = -h00 * (g10 * h41 + g20 * h42 + g30 * h43 + g40 * h44);
2296 h50 = -h00 * (g10 * h51 + g20 * h52 + g30 * h53 + g40 * h54 + g50 * h55);
2302 h00 * h00 + h10 * h10 + h20 * h20 + h30 * h30 + h40 * h40 + h50 * h50;
2303 m[
A01] = h10 * h11 + h20 * h21 + h30 * h31 + h40 * h41 + h50 * h51;
2304 m[
A11] = h11 * h11 + h21 * h21 + h31 * h31 + h41 * h41 + h51 * h51;
2305 m[
A02] = h20 * h22 + h30 * h32 + h40 * h42 + h50 * h52;
2306 m[
A12] = h21 * h22 + h31 * h32 + h41 * h42 + h51 * h52;
2307 m[
A22] = h22 * h22 + h32 * h32 + h42 * h42 + h52 * h52;
2308 m[
A03] = h30 * h33 + h40 * h43 + h50 * h53;
2309 m[
A13] = h31 * h33 + h41 * h43 + h51 * h53;
2310 m[
A23] = h32 * h33 + h42 * h43 + h52 * h53;
2311 m[
A33] = h33 * h33 + h43 * h43 + h53 * h53;
2312 m[
A04] = h40 * h44 + h50 * h54;
2313 m[
A14] = h41 * h44 + h51 * h54;
2314 m[
A24] = h42 * h44 + h52 * h54;
2315 m[
A34] = h43 * h44 + h53 * h54;
2316 m[
A44] = h44 * h44 + h54 * h54;