41#define SIMPLE_UOP(OPER) \
42 G4ErrorMatrixIter a=m.begin(); \
43 G4ErrorMatrixIter e=m.begin()+num_size(); \
44 for(;a<e; a++) (*a) OPER t;
46#define SIMPLE_BOP(OPER) \
47 G4ErrorMatrixIter a=m.begin(); \
48 G4ErrorMatrixConstIter b=mat2.m.begin(); \
49 G4ErrorMatrixConstIter e=m.begin()+num_size(); \
50 for(;a<e; a++, b++) (*a) OPER (*b);
52#define SIMPLE_TOP(OPER) \
53 G4ErrorMatrixConstIter a=mat1.m.begin(); \
54 G4ErrorMatrixConstIter b=mat2.m.begin(); \
55 G4ErrorMatrixIter t=mret.m.begin(); \
56 G4ErrorMatrixConstIter e=mat1.m.begin()+mat1.num_size(); \
57 for( ;a<e; a++, b++, t++) (*t) = (*a) OPER (*b);
59#define CHK_DIM_2(r1,r2,c1,c2,fun) \
60 if (r1!=r2 || c1!=c2) { \
61 G4ErrorMatrix::error("Range error in Matrix function " #fun "(1)."); \
64#define CHK_DIM_1(c1,r2,fun) \
66 G4ErrorMatrix::error("Range error in Matrix function " #fun "(2)."); \
72 : m(p*(p+1)/2), nrow(p)
74 size = nrow * (nrow+1) / 2;
79 : m(p*(p+1)/2), nrow(p)
81 size = nrow * (nrow+1) / 2;
92 for(
G4int i=1;i<=nrow;i++)
113 : m(mat1.size), nrow(mat1.nrow), size(mat1.size)
134 for(
G4int icol=1; icol<=irow; icol++)
138 b1 += irow+min_row-1;
153 for(
G4int icol=1; icol<=irow; icol++)
157 b1 += irow+min_row-1;
171 for(
G4int icol=1; icol<=irow; icol++)
203 for(;a<e; a++, b++) { (*b) = -(*a); }
294 for(mit1=mat1.m.begin();
299 for(
int step=1;step<=mat2.
num_row();++step)
306 temp+=*(sp++)*(*(mit2++));
309 for(
int stept=step+1;stept<=mat2.
num_row();stept++)
311 temp+=*sp*(*(mit2++));
312 if(stept<mat2.
num_row()) sp+=stept;
329 for(step=1,snp=mat1.m.begin();step<=mat1.
num_row();snp+=step++)
331 for(mit1=mat2.m.begin();mit1<mat2.m.begin()+mat2.
num_col();mit1++)
338 temp+=*mit2*(*(sp++));
342 for(stept=step+1;stept<=mat1.
num_row();stept++)
358 G4int step1,stept1,step2,stept2;
362 for(step1=1,snp1=mat1.m.begin();step1<=mat1.
num_row();snp1+=step1++)
364 for(step2=1,snp2=mat2.m.begin();step2<=mat2.
num_row();)
372 while(sp1<snp1+step1)
373 { temp+=(*(sp1++))*(*(sp2++)); }
375 for(stept1=step1+1;stept1!=step2+1;sp1+=stept1++)
376 { temp+=(*sp1)*(*(sp2++)); }
378 for(stept2=++step2;stept2<=mat2.
num_row();sp1+=stept1++,sp2+=stept2++)
379 { temp+=(*sp1)*(*sp2); }
384 { temp+=(*(sp1++))*(*(sp2++)); }
386 for(stept2=++step2;stept2!=step1+1;sp2+=stept2++)
387 { temp+=(*(sp1++))*(*sp2); }
389 for(stept1=step1+1;stept1<=mat1.
num_row();sp1+=stept1++,sp2+=stept2++)
390 { temp+=(*sp1)*(*sp2); }
414 for(
G4int k=1;k<=j;k++)
417 if(j!=k) *mkj += *sjk;
446 for(
G4int k=1;k<=j;k++)
449 if(j!=k) *mkj -= *sjk;
480 if(mat1.nrow*mat1.nrow != size)
482 size = mat1.nrow * mat1.nrow;
496 for(
G4int k=1;k<=j;k++)
499 if(j!=k) *mkj = *sjk;
511 if (&mat1 ==
this) {
return *
this; }
512 if(mat1.nrow != nrow)
532 if(os.flags() & std::ios::fixed)
534 width = os.precision()+3;
538 width = os.precision()+7;
545 os << q(irow,icol) <<
" ";
560 for(
G4int ic=1;ic<=ir;ic++)
562 *(b++) = (*f)(*(a++), ir, ic);
570 if(mat1.nrow != nrow)
573 size = nrow * (nrow+1) / 2;
578 for(
G4int r=1;r<=nrow;r++)
581 for(
G4int c=1;c<=r;c++)
603 for(
G4int c=1;c<=r;c++)
610 tmp+=(*(tempri++))*(*(m1ci++));
639 tmp+=(*(tempri++))*(*(m1ci++));
643 tmp+=(*(tempri++))*(*(m1ci));
664 for(
G4int c=1;c<=r;c++)
671 tmp+=(*(tempir))*(*(m1ic));
694 c11 = (*(m.begin()+2)) * (*(m.begin()+5))
695 - (*(m.begin()+4)) * (*(m.begin()+4));
696 c12 = (*(m.begin()+4)) * (*(m.begin()+3))
697 - (*(m.begin()+1)) * (*(m.begin()+5));
698 c13 = (*(m.begin()+1)) * (*(m.begin()+4))
699 - (*(m.begin()+2)) * (*(m.begin()+3));
700 c22 = (*(m.begin()+5)) * (*m.begin())
701 - (*(m.begin()+3)) * (*(m.begin()+3));
702 c23 = (*(m.begin()+3)) * (*(m.begin()+1))
703 - (*(m.begin()+4)) * (*m.begin());
704 c33 = (*m.begin()) * (*(m.begin()+2))
705 - (*(m.begin()+1)) * (*(m.begin()+1));
706 t1 = std::fabs(*m.begin());
707 t2 = std::fabs(*(m.begin()+1));
708 t3 = std::fabs(*(m.begin()+3));
713 temp = *(m.begin()+3);
714 det = c23*c12-c22*c13;
719 det = c22*c33-c23*c23;
724 temp = *(m.begin()+3);
725 det = c23*c12-c22*c13;
729 temp = *(m.begin()+1);
730 det = c13*c23-c12*c33;
752 det = (*m.begin())*(*(m.begin()+2)) - (*(m.begin()+1))*(*(m.begin()+1));
759 *(m.begin()+1) *= -ss;
760 temp = ss*(*(m.begin()+2));
761 *(m.begin()+2) = ss*(*m.begin());
772 *m.begin() = 1.0/(*m.begin());
801 static const G4int max_array = 20;
805 static std::vector<G4int> ir_vec (max_array+1);
806 if (ir_vec.size() <=
static_cast<unsigned int>(nrow))
808 ir_vec.resize(nrow+1);
810 G4int * ir = &ir_vec[0];
814 G4int i = mt.dfact_matrix(det, ir);
815 if(i==0) {
return det; }
822 for (
G4int i=0; i<nrow; i++)
823 { t += *(m.begin() + (i+3)*i/2); }
846 static const G4int max_array = 25;
847 static std::vector<G4double> xvec (max_array);
848 static std::vector<G4int> pivv (max_array);
849 typedef std::vector<G4int>::iterator pivIter;
850 if (xvec.size() <
static_cast<unsigned int>(nrow)) xvec.resize(nrow);
851 if (pivv.size() <
static_cast<unsigned int>(nrow)) pivv.resize(nrow);
858 pivIter piv = pivv.begin();
871 for (i = 0; i < nrow; i++)
882 for (j=1; j < nrow; j+=ss)
884 mjj = m.begin() + j*(j-1)/2 + j-1;
887 ip = m.begin() + (j+1)*j/2 + j-1;
888 for (i=j+1; i <= nrow ; ip += i++)
890 if (std::fabs(*ip) > lambda)
892 lambda = std::fabs(*ip);
908 if (std::fabs(*mjj) >= lambda*alpha)
916 ip = m.begin() + pivrow*(pivrow-1)/2+j-1;
917 for (k=j; k < pivrow; k++)
919 if (std::fabs(*ip) > sigma)
920 sigma = std::fabs(*ip);
923 if (sigma * std::fabs(*mjj) >= alpha * lambda * lambda)
928 else if (std::fabs(*(m.begin()+pivrow*(pivrow-1)/2+pivrow-1))
942 temp2 = *mjj = 1./ *mjj;
945 for (i=j+1; i <= nrow; i++)
947 temp1 = *(m.begin() + i*(i-1)/2 + j-1) * temp2;
948 ip = m.begin()+i*(i-1)/2+j;
949 for (k=j+1; k<=i; k++)
951 *ip -= temp1 * *(m.begin() + k*(k-1)/2 + j-1);
952 if (std::fabs(*ip) <= epsilon)
958 ip = m.begin() + (j+1)*j/2 + j-1;
959 for (i=j+1; i <= nrow; ip += i++)
970 ip = m.begin() + pivrow*(pivrow-1)/2 + j;
971 for (i=j+1; i < pivrow; i++, ip++)
973 temp1 = *(m.begin() + i*(i-1)/2 + j-1);
974 *(m.begin() + i*(i-1)/2 + j-1)= *ip;
978 *mjj = *(m.begin()+pivrow*(pivrow-1)/2+pivrow-1);
979 *(m.begin()+pivrow*(pivrow-1)/2+pivrow-1) = temp1;
980 ip = m.begin() + (pivrow+1)*pivrow/2 + j-1;
982 for (i = pivrow+1; i <= nrow; ip += i, iq += i++)
994 temp2 = *mjj = 1./ *mjj;
997 for (i = j+1; i <= nrow; i++)
999 temp1 = *(m.begin() + i*(i-1)/2 + j-1) * temp2;
1000 ip = m.begin()+i*(i-1)/2+j;
1001 for (k=j+1; k<=i; k++)
1003 *ip -= temp1 * *(m.begin() + k*(k-1)/2 + j-1);
1004 if (std::fabs(*ip) <= epsilon)
1010 ip = m.begin() + (j+1)*j/2 + j-1;
1011 for (i=j+1; i<=nrow; ip += i++)
1025 ip = m.begin() + pivrow*(pivrow-1)/2 + j+1;
1026 for (i=j+2; i < pivrow; i++, ip++)
1028 temp1 = *(m.begin() + i*(i-1)/2 + j);
1029 *(m.begin() + i*(i-1)/2 + j) = *ip;
1032 temp1 = *(mjj + j + 1);
1034 *(m.begin() + pivrow*(pivrow-1)/2 + pivrow-1);
1035 *(m.begin() + pivrow*(pivrow-1)/2 + pivrow-1) = temp1;
1037 *(mjj + j) = *(m.begin() + pivrow*(pivrow-1)/2 + j-1);
1038 *(m.begin() + pivrow*(pivrow-1)/2 + j-1) = temp1;
1039 ip = m.begin() + (pivrow+1)*pivrow/2 + j;
1040 iq = ip + pivrow-(j+1);
1041 for (i = pivrow+1; i <= nrow; ip += i, iq += i++)
1049 temp2 = *mjj * *(mjj + j + 1) - *(mjj + j) * *(mjj + j);
1053 <<
"G4ErrorSymMatrix::bunch_invert: error in pivot choice"
1062 *mjj = *(mjj + j + 1) * temp2;
1063 *(mjj + j + 1) = temp1 * temp2;
1064 *(mjj + j) = - *(mjj + j) * temp2;
1069 for (i=j+2; i <= nrow ; i++)
1071 ip = m.begin() + i*(i-1)/2 + j-1;
1072 temp1 = *ip * *mjj + *(ip + 1) * *(mjj + j);
1073 if (std::fabs(temp1 ) <= epsilon)
1075 temp2 = *ip * *(mjj + j) + *(ip + 1) * *(mjj + j + 1);
1076 if (std::fabs(temp2 ) <= epsilon)
1078 for (k = j+2; k <= i ; k++)
1080 ip = m.begin() + i*(i-1)/2 + k-1;
1081 iq = m.begin() + k*(k-1)/2 + j-1;
1082 *ip -= temp1 * *iq + temp2 * *(iq+1);
1083 if (std::fabs(*ip) <= epsilon)
1088 for (i=j+2; i <= nrow ; i++)
1090 ip = m.begin() + i*(i-1)/2 + j-1;
1091 temp1 = *ip * *mjj + *(ip+1) * *(mjj + j);
1092 if (std::fabs(temp1) <= epsilon)
1094 *(ip+1) = *ip * *(mjj + j) + *(ip+1) * *(mjj + j + 1);
1095 if (std::fabs(*(ip+1)) <= epsilon)
1106 mjj = m.begin() + j*(j-1)/2 + j-1;
1120 for (j = nrow ; j >= 1 ; j -= ss)
1122 mjj = m.begin() + j*(j-1)/2 + j-1;
1128 ip = m.begin() + (j+1)*j/2 + j-1;
1129 for (i=0; i < nrow-j; ip += 1+j+i++)
1133 for (i=j+1; i<=nrow ; i++)
1136 ip = m.begin() + i*(i-1)/2 + j;
1137 for (k=0; k <= i-j-1; k++)
1138 { temp2 += *ip++ * x[k]; }
1139 for (ip += i-1; k < nrow-j; ip += 1+j+k++)
1140 { temp2 += *ip * x[k]; }
1141 *(m.begin()+ i*(i-1)/2 + j-1) = -temp2;
1144 ip = m.begin() + (j+1)*j/2 + j-1;
1145 for (k=0; k < nrow-j; ip += 1+j+k++)
1146 { temp2 += x[k] * *ip; }
1157 ip = m.begin() + (j+1)*j/2 + j-1;
1158 for (i=0; i < nrow-j; ip += 1+j+i++)
1162 for (i=j+1; i<=nrow ; i++)
1165 ip = m.begin() + i*(i-1)/2 + j;
1166 for (k=0; k <= i-j-1; k++)
1167 { temp2 += *ip++ * x[k]; }
1168 for (ip += i-1; k < nrow-j; ip += 1+j+k++)
1169 { temp2 += *ip * x[k]; }
1170 *(m.begin()+ i*(i-1)/2 + j-1) = -temp2;
1173 ip = m.begin() + (j+1)*j/2 + j-1;
1174 for (k=0; k < nrow-j; ip += 1+j+k++)
1175 { temp2 += x[k] * *ip; }
1178 ip = m.begin() + (j+1)*j/2 + j-2;
1179 for (i=j+1; i <= nrow; ip += i++)
1180 { temp2 += *ip * *(ip+1); }
1182 ip = m.begin() + (j+1)*j/2 + j-2;
1183 for (i=0; i < nrow-j; ip += 1+j+i++)
1187 for (i=j+1; i <= nrow ; i++)
1190 ip = m.begin() + i*(i-1)/2 + j;
1191 for (k=0; k <= i-j-1; k++)
1192 { temp2 += *ip++ * x[k]; }
1193 for (ip += i-1; k < nrow-j; ip += 1+j+k++)
1194 { temp2 += *ip * x[k]; }
1195 *(m.begin()+ i*(i-1)/2 + j-2)= -temp2;
1198 ip = m.begin() + (j+1)*j/2 + j-2;
1199 for (k=0; k < nrow-j; ip += 1+j+k++)
1200 { temp2 += x[k] * *ip; }
1208 pivrow = (piv[j-1]==0)? -piv[j-2] : piv[j-1];
1209 ip = m.begin() + pivrow*(pivrow-1)/2 + j;
1210 for (i=j+1;i < pivrow; i++, ip++)
1212 temp1 = *(m.begin() + i*(i-1)/2 + j-1);
1213 *(m.begin() + i*(i-1)/2 + j-1) = *ip;
1217 *mjj = *(m.begin() + pivrow*(pivrow-1)/2 + pivrow-1);
1218 *(m.begin() + pivrow*(pivrow-1)/2 + pivrow-1) = temp1;
1222 *(mjj-1) = *( m.begin() + pivrow*(pivrow-1)/2 + j-2);
1223 *( m.begin() + pivrow*(pivrow-1)/2 + j-2) = temp1;
1226 ip = m.begin() + (pivrow+1)*pivrow/2 + j-1;
1228 for (i = pivrow+1; i <= nrow; ip += i, iq += i++)
1239G4double G4ErrorSymMatrix::posDefFraction5x5 = 1.0;
1240G4double G4ErrorSymMatrix::posDefFraction6x6 = 1.0;
1241G4double G4ErrorSymMatrix::adjustment5x5 = 0.0;
1242G4double G4ErrorSymMatrix::adjustment6x6 = 0.0;
1243const G4double G4ErrorSymMatrix::CHOLESKY_THRESHOLD_5x5 = .5;
1244const G4double G4ErrorSymMatrix::CHOLESKY_THRESHOLD_6x6 = .2;
1245const G4double G4ErrorSymMatrix::CHOLESKY_CREEP_5x5 = .005;
1246const G4double G4ErrorSymMatrix::CHOLESKY_CREEP_6x6 = .002;
1294void G4ErrorSymMatrix::invert5(
G4int & ifail)
1296 if (posDefFraction5x5 >= CHOLESKY_THRESHOLD_5x5)
1299 posDefFraction5x5 = .9*posDefFraction5x5 + .1*(1-ifail);
1307 if (posDefFraction5x5 + adjustment5x5 >= CHOLESKY_THRESHOLD_5x5)
1310 posDefFraction5x5 = .9*posDefFraction5x5 + .1*(1-ifail);
1320 adjustment5x5 += CHOLESKY_CREEP_5x5;
1326void G4ErrorSymMatrix::invert6(
G4int & ifail)
1328 if (posDefFraction6x6 >= CHOLESKY_THRESHOLD_6x6)
1331 posDefFraction6x6 = .9*posDefFraction6x6 + .1*(1-ifail);
1339 if (posDefFraction6x6 + adjustment6x6 >= CHOLESKY_THRESHOLD_6x6)
1342 posDefFraction6x6 = .9*posDefFraction6x6 + .1*(1-ifail);
1352 adjustment6x6 += CHOLESKY_CREEP_6x6;
1393 + m[
A12]*Det2_23_01;
1395 + m[
A13]*Det2_23_01;
1397 + m[
A13]*Det2_23_02;
1399 + m[
A13]*Det2_23_12;
1401 + m[
A12]*Det2_24_01;
1403 + m[
A13]*Det2_24_01;
1405 + m[
A14]*Det2_24_01;
1407 + m[
A13]*Det2_24_02;
1409 + m[
A14]*Det2_24_02;
1411 + m[
A13]*Det2_24_12;
1413 + m[
A14]*Det2_24_12;
1415 + m[
A12]*Det2_34_01;
1417 + m[
A13]*Det2_34_01;
1419 + m[
A14]*Det2_34_01;
1421 + m[
A13]*Det2_34_02;
1423 + m[
A14]*Det2_34_02;
1425 + m[
A14]*Det2_34_03;
1427 + m[
A13]*Det2_34_12;
1429 + m[
A14]*Det2_34_12;
1431 + m[
A14]*Det2_34_13;
1433 + m[
A22]*Det2_34_01;
1435 + m[
A23]*Det2_34_01;
1437 + m[
A24]*Det2_34_01;
1439 + m[
A23]*Det2_34_02;
1441 + m[
A24]*Det2_34_02;
1443 + m[
A24]*Det2_34_03;
1445 + m[
A23]*Det2_34_12;
1447 + m[
A24]*Det2_34_12;
1449 + m[
A24]*Det2_34_13;
1451 + m[
A24]*Det2_34_23;
1455 G4double Det4_0123_0123 = m[
A00]*Det3_123_123 - m[
A01]*Det3_123_023
1456 + m[
A02]*Det3_123_013 - m[
A03]*Det3_123_012;
1457 G4double Det4_0124_0123 = m[
A00]*Det3_124_123 - m[
A01]*Det3_124_023
1458 + m[
A02]*Det3_124_013 - m[
A03]*Det3_124_012;
1459 G4double Det4_0124_0124 = m[
A00]*Det3_124_124 - m[
A01]*Det3_124_024
1460 + m[
A02]*Det3_124_014 - m[
A04]*Det3_124_012;
1461 G4double Det4_0134_0123 = m[
A00]*Det3_134_123 - m[
A01]*Det3_134_023
1462 + m[
A02]*Det3_134_013 - m[
A03]*Det3_134_012;
1463 G4double Det4_0134_0124 = m[
A00]*Det3_134_124 - m[
A01]*Det3_134_024
1464 + m[
A02]*Det3_134_014 - m[
A04]*Det3_134_012;
1465 G4double Det4_0134_0134 = m[
A00]*Det3_134_134 - m[
A01]*Det3_134_034
1466 + m[
A03]*Det3_134_014 - m[
A04]*Det3_134_013;
1467 G4double Det4_0234_0123 = m[
A00]*Det3_234_123 - m[
A01]*Det3_234_023
1468 + m[
A02]*Det3_234_013 - m[
A03]*Det3_234_012;
1469 G4double Det4_0234_0124 = m[
A00]*Det3_234_124 - m[
A01]*Det3_234_024
1470 + m[
A02]*Det3_234_014 - m[
A04]*Det3_234_012;
1471 G4double Det4_0234_0134 = m[
A00]*Det3_234_134 - m[
A01]*Det3_234_034
1472 + m[
A03]*Det3_234_014 - m[
A04]*Det3_234_013;
1473 G4double Det4_0234_0234 = m[
A00]*Det3_234_234 - m[
A02]*Det3_234_034
1474 + m[
A03]*Det3_234_024 - m[
A04]*Det3_234_023;
1475 G4double Det4_1234_0123 = m[
A10]*Det3_234_123 - m[
A11]*Det3_234_023
1476 + m[
A12]*Det3_234_013 - m[
A13]*Det3_234_012;
1477 G4double Det4_1234_0124 = m[
A10]*Det3_234_124 - m[
A11]*Det3_234_024
1478 + m[
A12]*Det3_234_014 - m[
A14]*Det3_234_012;
1479 G4double Det4_1234_0134 = m[
A10]*Det3_234_134 - m[
A11]*Det3_234_034
1480 + m[
A13]*Det3_234_014 - m[
A14]*Det3_234_013;
1481 G4double Det4_1234_0234 = m[
A10]*Det3_234_234 - m[
A12]*Det3_234_034
1482 + m[
A13]*Det3_234_024 - m[
A14]*Det3_234_023;
1483 G4double Det4_1234_1234 = m[
A11]*Det3_234_234 - m[
A12]*Det3_234_134
1484 + m[
A13]*Det3_234_124 - m[
A14]*Det3_234_123;
1489 - m[
A01]*Det4_1234_0234
1490 + m[
A02]*Det4_1234_0134
1491 - m[
A03]*Det4_1234_0124
1492 + m[
A04]*Det4_1234_0123;
1501 G4double mn1OverDet = - oneOverDet;
1503 m[
A00] = Det4_1234_1234 * oneOverDet;
1504 m[
A01] = Det4_1234_0234 * mn1OverDet;
1505 m[
A02] = Det4_1234_0134 * oneOverDet;
1506 m[
A03] = Det4_1234_0124 * mn1OverDet;
1507 m[
A04] = Det4_1234_0123 * oneOverDet;
1509 m[
A11] = Det4_0234_0234 * oneOverDet;
1510 m[
A12] = Det4_0234_0134 * mn1OverDet;
1511 m[
A13] = Det4_0234_0124 * oneOverDet;
1512 m[
A14] = Det4_0234_0123 * mn1OverDet;
1514 m[
A22] = Det4_0134_0134 * oneOverDet;
1515 m[
A23] = Det4_0134_0124 * mn1OverDet;
1516 m[
A24] = Det4_0134_0123 * oneOverDet;
1518 m[
A33] = Det4_0124_0124 * oneOverDet;
1519 m[
A34] = Det4_0124_0123 * mn1OverDet;
1521 m[
A44] = Det4_0123_0123 * oneOverDet;
1575 + m[
A22]*Det2_34_01;
1577 + m[
A23]*Det2_34_01;
1579 + m[
A24]*Det2_34_01;
1581 + m[
A23]*Det2_34_02;
1583 + m[
A24]*Det2_34_02;
1585 + m[
A24]*Det2_34_03;
1587 + m[
A23]*Det2_34_12;
1589 + m[
A24]*Det2_34_12;
1591 + m[
A24]*Det2_34_13;
1593 + m[
A24]*Det2_34_23;
1595 + m[
A22]*Det2_35_01;
1597 + m[
A23]*Det2_35_01;
1599 + m[
A24]*Det2_35_01;
1601 + m[
A25]*Det2_35_01;
1603 + m[
A23]*Det2_35_02;
1605 + m[
A24]*Det2_35_02;
1607 + m[
A25]*Det2_35_02;
1609 + m[
A24]*Det2_35_03;
1611 + m[
A25]*Det2_35_03;
1613 + m[
A23]*Det2_35_12;
1615 + m[
A24]*Det2_35_12;
1617 + m[
A25]*Det2_35_12;
1619 + m[
A24]*Det2_35_13;
1621 + m[
A25]*Det2_35_13;
1623 + m[
A24]*Det2_35_23;
1625 + m[
A25]*Det2_35_23;
1627 + m[
A22]*Det2_45_01;
1629 + m[
A23]*Det2_45_01;
1631 + m[
A24]*Det2_45_01;
1633 + m[
A25]*Det2_45_01;
1635 + m[
A23]*Det2_45_02;
1637 + m[
A24]*Det2_45_02;
1639 + m[
A25]*Det2_45_02;
1641 + m[
A24]*Det2_45_03;
1643 + m[
A25]*Det2_45_03;
1645 + m[
A25]*Det2_45_04;
1647 + m[
A23]*Det2_45_12;
1649 + m[
A24]*Det2_45_12;
1651 + m[
A25]*Det2_45_12;
1653 + m[
A24]*Det2_45_13;
1655 + m[
A25]*Det2_45_13;
1657 + m[
A25]*Det2_45_14;
1659 + m[
A24]*Det2_45_23;
1661 + m[
A25]*Det2_45_23;
1663 + m[
A25]*Det2_45_24;
1665 + m[
A32]*Det2_45_01;
1667 + m[
A33]*Det2_45_01;
1669 + m[
A34]*Det2_45_01;
1671 + m[
A35]*Det2_45_01;
1673 + m[
A33]*Det2_45_02;
1675 + m[
A34]*Det2_45_02;
1677 + m[
A35]*Det2_45_02;
1679 + m[
A34]*Det2_45_03;
1681 + m[
A35]*Det2_45_03;
1683 + m[
A35]*Det2_45_04;
1685 + m[
A33]*Det2_45_12;
1687 + m[
A34]*Det2_45_12;
1689 + m[
A35]*Det2_45_12;
1691 + m[
A34]*Det2_45_13;
1693 + m[
A35]*Det2_45_13;
1695 + m[
A35]*Det2_45_14;
1697 + m[
A34]*Det2_45_23;
1699 + m[
A35]*Det2_45_23;
1701 + m[
A35]*Det2_45_24;
1703 + m[
A35]*Det2_45_34;
1707 G4double Det4_1234_0123 = m[
A10]*Det3_234_123 - m[
A11]*Det3_234_023
1708 + m[
A12]*Det3_234_013 - m[
A13]*Det3_234_012;
1709 G4double Det4_1234_0124 = m[
A10]*Det3_234_124 - m[
A11]*Det3_234_024
1710 + m[
A12]*Det3_234_014 - m[
A14]*Det3_234_012;
1711 G4double Det4_1234_0134 = m[
A10]*Det3_234_134 - m[
A11]*Det3_234_034
1712 + m[
A13]*Det3_234_014 - m[
A14]*Det3_234_013;
1713 G4double Det4_1234_0234 = m[
A10]*Det3_234_234 - m[
A12]*Det3_234_034
1714 + m[
A13]*Det3_234_024 - m[
A14]*Det3_234_023;
1715 G4double Det4_1234_1234 = m[
A11]*Det3_234_234 - m[
A12]*Det3_234_134
1716 + m[
A13]*Det3_234_124 - m[
A14]*Det3_234_123;
1717 G4double Det4_1235_0123 = m[
A10]*Det3_235_123 - m[
A11]*Det3_235_023
1718 + m[
A12]*Det3_235_013 - m[
A13]*Det3_235_012;
1719 G4double Det4_1235_0124 = m[
A10]*Det3_235_124 - m[
A11]*Det3_235_024
1720 + m[
A12]*Det3_235_014 - m[
A14]*Det3_235_012;
1721 G4double Det4_1235_0125 = m[
A10]*Det3_235_125 - m[
A11]*Det3_235_025
1722 + m[
A12]*Det3_235_015 - m[
A15]*Det3_235_012;
1723 G4double Det4_1235_0134 = m[
A10]*Det3_235_134 - m[
A11]*Det3_235_034
1724 + m[
A13]*Det3_235_014 - m[
A14]*Det3_235_013;
1725 G4double Det4_1235_0135 = m[
A10]*Det3_235_135 - m[
A11]*Det3_235_035
1726 + m[
A13]*Det3_235_015 - m[
A15]*Det3_235_013;
1727 G4double Det4_1235_0234 = m[
A10]*Det3_235_234 - m[
A12]*Det3_235_034
1728 + m[
A13]*Det3_235_024 - m[
A14]*Det3_235_023;
1729 G4double Det4_1235_0235 = m[
A10]*Det3_235_235 - m[
A12]*Det3_235_035
1730 + m[
A13]*Det3_235_025 - m[
A15]*Det3_235_023;
1731 G4double Det4_1235_1234 = m[
A11]*Det3_235_234 - m[
A12]*Det3_235_134
1732 + m[
A13]*Det3_235_124 - m[
A14]*Det3_235_123;
1733 G4double Det4_1235_1235 = m[
A11]*Det3_235_235 - m[
A12]*Det3_235_135
1734 + m[
A13]*Det3_235_125 - m[
A15]*Det3_235_123;
1735 G4double Det4_1245_0123 = m[
A10]*Det3_245_123 - m[
A11]*Det3_245_023
1736 + m[
A12]*Det3_245_013 - m[
A13]*Det3_245_012;
1737 G4double Det4_1245_0124 = m[
A10]*Det3_245_124 - m[
A11]*Det3_245_024
1738 + m[
A12]*Det3_245_014 - m[
A14]*Det3_245_012;
1739 G4double Det4_1245_0125 = m[
A10]*Det3_245_125 - m[
A11]*Det3_245_025
1740 + m[
A12]*Det3_245_015 - m[
A15]*Det3_245_012;
1741 G4double Det4_1245_0134 = m[
A10]*Det3_245_134 - m[
A11]*Det3_245_034
1742 + m[
A13]*Det3_245_014 - m[
A14]*Det3_245_013;
1743 G4double Det4_1245_0135 = m[
A10]*Det3_245_135 - m[
A11]*Det3_245_035
1744 + m[
A13]*Det3_245_015 - m[
A15]*Det3_245_013;
1745 G4double Det4_1245_0145 = m[
A10]*Det3_245_145 - m[
A11]*Det3_245_045
1746 + m[
A14]*Det3_245_015 - m[
A15]*Det3_245_014;
1747 G4double Det4_1245_0234 = m[
A10]*Det3_245_234 - m[
A12]*Det3_245_034
1748 + m[
A13]*Det3_245_024 - m[
A14]*Det3_245_023;
1749 G4double Det4_1245_0235 = m[
A10]*Det3_245_235 - m[
A12]*Det3_245_035
1750 + m[
A13]*Det3_245_025 - m[
A15]*Det3_245_023;
1751 G4double Det4_1245_0245 = m[
A10]*Det3_245_245 - m[
A12]*Det3_245_045
1752 + m[
A14]*Det3_245_025 - m[
A15]*Det3_245_024;
1753 G4double Det4_1245_1234 = m[
A11]*Det3_245_234 - m[
A12]*Det3_245_134
1754 + m[
A13]*Det3_245_124 - m[
A14]*Det3_245_123;
1755 G4double Det4_1245_1235 = m[
A11]*Det3_245_235 - m[
A12]*Det3_245_135
1756 + m[
A13]*Det3_245_125 - m[
A15]*Det3_245_123;
1757 G4double Det4_1245_1245 = m[
A11]*Det3_245_245 - m[
A12]*Det3_245_145
1758 + m[
A14]*Det3_245_125 - m[
A15]*Det3_245_124;
1759 G4double Det4_1345_0123 = m[
A10]*Det3_345_123 - m[
A11]*Det3_345_023
1760 + m[
A12]*Det3_345_013 - m[
A13]*Det3_345_012;
1761 G4double Det4_1345_0124 = m[
A10]*Det3_345_124 - m[
A11]*Det3_345_024
1762 + m[
A12]*Det3_345_014 - m[
A14]*Det3_345_012;
1763 G4double Det4_1345_0125 = m[
A10]*Det3_345_125 - m[
A11]*Det3_345_025
1764 + m[
A12]*Det3_345_015 - m[
A15]*Det3_345_012;
1765 G4double Det4_1345_0134 = m[
A10]*Det3_345_134 - m[
A11]*Det3_345_034
1766 + m[
A13]*Det3_345_014 - m[
A14]*Det3_345_013;
1767 G4double Det4_1345_0135 = m[
A10]*Det3_345_135 - m[
A11]*Det3_345_035
1768 + m[
A13]*Det3_345_015 - m[
A15]*Det3_345_013;
1769 G4double Det4_1345_0145 = m[
A10]*Det3_345_145 - m[
A11]*Det3_345_045
1770 + m[
A14]*Det3_345_015 - m[
A15]*Det3_345_014;
1771 G4double Det4_1345_0234 = m[
A10]*Det3_345_234 - m[
A12]*Det3_345_034
1772 + m[
A13]*Det3_345_024 - m[
A14]*Det3_345_023;
1773 G4double Det4_1345_0235 = m[
A10]*Det3_345_235 - m[
A12]*Det3_345_035
1774 + m[
A13]*Det3_345_025 - m[
A15]*Det3_345_023;
1775 G4double Det4_1345_0245 = m[
A10]*Det3_345_245 - m[
A12]*Det3_345_045
1776 + m[
A14]*Det3_345_025 - m[
A15]*Det3_345_024;
1777 G4double Det4_1345_0345 = m[
A10]*Det3_345_345 - m[
A13]*Det3_345_045
1778 + m[
A14]*Det3_345_035 - m[
A15]*Det3_345_034;
1779 G4double Det4_1345_1234 = m[
A11]*Det3_345_234 - m[
A12]*Det3_345_134
1780 + m[
A13]*Det3_345_124 - m[
A14]*Det3_345_123;
1781 G4double Det4_1345_1235 = m[
A11]*Det3_345_235 - m[
A12]*Det3_345_135
1782 + m[
A13]*Det3_345_125 - m[
A15]*Det3_345_123;
1783 G4double Det4_1345_1245 = m[
A11]*Det3_345_245 - m[
A12]*Det3_345_145
1784 + m[
A14]*Det3_345_125 - m[
A15]*Det3_345_124;
1785 G4double Det4_1345_1345 = m[
A11]*Det3_345_345 - m[
A13]*Det3_345_145
1786 + m[
A14]*Det3_345_135 - m[
A15]*Det3_345_134;
1787 G4double Det4_2345_0123 = m[
A20]*Det3_345_123 - m[
A21]*Det3_345_023
1788 + m[
A22]*Det3_345_013 - m[
A23]*Det3_345_012;
1789 G4double Det4_2345_0124 = m[
A20]*Det3_345_124 - m[
A21]*Det3_345_024
1790 + m[
A22]*Det3_345_014 - m[
A24]*Det3_345_012;
1791 G4double Det4_2345_0125 = m[
A20]*Det3_345_125 - m[
A21]*Det3_345_025
1792 + m[
A22]*Det3_345_015 - m[
A25]*Det3_345_012;
1793 G4double Det4_2345_0134 = m[
A20]*Det3_345_134 - m[
A21]*Det3_345_034
1794 + m[
A23]*Det3_345_014 - m[
A24]*Det3_345_013;
1795 G4double Det4_2345_0135 = m[
A20]*Det3_345_135 - m[
A21]*Det3_345_035
1796 + m[
A23]*Det3_345_015 - m[
A25]*Det3_345_013;
1797 G4double Det4_2345_0145 = m[
A20]*Det3_345_145 - m[
A21]*Det3_345_045
1798 + m[
A24]*Det3_345_015 - m[
A25]*Det3_345_014;
1799 G4double Det4_2345_0234 = m[
A20]*Det3_345_234 - m[
A22]*Det3_345_034
1800 + m[
A23]*Det3_345_024 - m[
A24]*Det3_345_023;
1801 G4double Det4_2345_0235 = m[
A20]*Det3_345_235 - m[
A22]*Det3_345_035
1802 + m[
A23]*Det3_345_025 - m[
A25]*Det3_345_023;
1803 G4double Det4_2345_0245 = m[
A20]*Det3_345_245 - m[
A22]*Det3_345_045
1804 + m[
A24]*Det3_345_025 - m[
A25]*Det3_345_024;
1805 G4double Det4_2345_0345 = m[
A20]*Det3_345_345 - m[
A23]*Det3_345_045
1806 + m[
A24]*Det3_345_035 - m[
A25]*Det3_345_034;
1807 G4double Det4_2345_1234 = m[
A21]*Det3_345_234 - m[
A22]*Det3_345_134
1808 + m[
A23]*Det3_345_124 - m[
A24]*Det3_345_123;
1809 G4double Det4_2345_1235 = m[
A21]*Det3_345_235 - m[
A22]*Det3_345_135
1810 + m[
A23]*Det3_345_125 - m[
A25]*Det3_345_123;
1811 G4double Det4_2345_1245 = m[
A21]*Det3_345_245 - m[
A22]*Det3_345_145
1812 + m[
A24]*Det3_345_125 - m[
A25]*Det3_345_124;
1813 G4double Det4_2345_1345 = m[
A21]*Det3_345_345 - m[
A23]*Det3_345_145
1814 + m[
A24]*Det3_345_135 - m[
A25]*Det3_345_134;
1815 G4double Det4_2345_2345 = m[
A22]*Det3_345_345 - m[
A23]*Det3_345_245
1816 + m[
A24]*Det3_345_235 - m[
A25]*Det3_345_234;
1820 G4double Det5_01234_01234 = m[
A00]*Det4_1234_1234 - m[
A01]*Det4_1234_0234
1821 + m[
A02]*Det4_1234_0134 - m[
A03]*Det4_1234_0124 + m[
A04]*Det4_1234_0123;
1822 G4double Det5_01235_01234 = m[
A00]*Det4_1235_1234 - m[
A01]*Det4_1235_0234
1823 + m[
A02]*Det4_1235_0134 - m[
A03]*Det4_1235_0124 + m[
A04]*Det4_1235_0123;
1824 G4double Det5_01235_01235 = m[
A00]*Det4_1235_1235 - m[
A01]*Det4_1235_0235
1825 + m[
A02]*Det4_1235_0135 - m[
A03]*Det4_1235_0125 + m[
A05]*Det4_1235_0123;
1826 G4double Det5_01245_01234 = m[
A00]*Det4_1245_1234 - m[
A01]*Det4_1245_0234
1827 + m[
A02]*Det4_1245_0134 - m[
A03]*Det4_1245_0124 + m[
A04]*Det4_1245_0123;
1828 G4double Det5_01245_01235 = m[
A00]*Det4_1245_1235 - m[
A01]*Det4_1245_0235
1829 + m[
A02]*Det4_1245_0135 - m[
A03]*Det4_1245_0125 + m[
A05]*Det4_1245_0123;
1830 G4double Det5_01245_01245 = m[
A00]*Det4_1245_1245 - m[
A01]*Det4_1245_0245
1831 + m[
A02]*Det4_1245_0145 - m[
A04]*Det4_1245_0125 + m[
A05]*Det4_1245_0124;
1832 G4double Det5_01345_01234 = m[
A00]*Det4_1345_1234 - m[
A01]*Det4_1345_0234
1833 + m[
A02]*Det4_1345_0134 - m[
A03]*Det4_1345_0124 + m[
A04]*Det4_1345_0123;
1834 G4double Det5_01345_01235 = m[
A00]*Det4_1345_1235 - m[
A01]*Det4_1345_0235
1835 + m[
A02]*Det4_1345_0135 - m[
A03]*Det4_1345_0125 + m[
A05]*Det4_1345_0123;
1836 G4double Det5_01345_01245 = m[
A00]*Det4_1345_1245 - m[
A01]*Det4_1345_0245
1837 + m[
A02]*Det4_1345_0145 - m[
A04]*Det4_1345_0125 + m[
A05]*Det4_1345_0124;
1838 G4double Det5_01345_01345 = m[
A00]*Det4_1345_1345 - m[
A01]*Det4_1345_0345
1839 + m[
A03]*Det4_1345_0145 - m[
A04]*Det4_1345_0135 + m[
A05]*Det4_1345_0134;
1840 G4double Det5_02345_01234 = m[
A00]*Det4_2345_1234 - m[
A01]*Det4_2345_0234
1841 + m[
A02]*Det4_2345_0134 - m[
A03]*Det4_2345_0124 + m[
A04]*Det4_2345_0123;
1842 G4double Det5_02345_01235 = m[
A00]*Det4_2345_1235 - m[
A01]*Det4_2345_0235
1843 + m[
A02]*Det4_2345_0135 - m[
A03]*Det4_2345_0125 + m[
A05]*Det4_2345_0123;
1844 G4double Det5_02345_01245 = m[
A00]*Det4_2345_1245 - m[
A01]*Det4_2345_0245
1845 + m[
A02]*Det4_2345_0145 - m[
A04]*Det4_2345_0125 + m[
A05]*Det4_2345_0124;
1846 G4double Det5_02345_01345 = m[
A00]*Det4_2345_1345 - m[
A01]*Det4_2345_0345
1847 + m[
A03]*Det4_2345_0145 - m[
A04]*Det4_2345_0135 + m[
A05]*Det4_2345_0134;
1848 G4double Det5_02345_02345 = m[
A00]*Det4_2345_2345 - m[
A02]*Det4_2345_0345
1849 + m[
A03]*Det4_2345_0245 - m[
A04]*Det4_2345_0235 + m[
A05]*Det4_2345_0234;
1850 G4double Det5_12345_01234 = m[
A10]*Det4_2345_1234 - m[
A11]*Det4_2345_0234
1851 + m[
A12]*Det4_2345_0134 - m[
A13]*Det4_2345_0124 + m[
A14]*Det4_2345_0123;
1852 G4double Det5_12345_01235 = m[
A10]*Det4_2345_1235 - m[
A11]*Det4_2345_0235
1853 + m[
A12]*Det4_2345_0135 - m[
A13]*Det4_2345_0125 + m[
A15]*Det4_2345_0123;
1854 G4double Det5_12345_01245 = m[
A10]*Det4_2345_1245 - m[
A11]*Det4_2345_0245
1855 + m[
A12]*Det4_2345_0145 - m[
A14]*Det4_2345_0125 + m[
A15]*Det4_2345_0124;
1856 G4double Det5_12345_01345 = m[
A10]*Det4_2345_1345 - m[
A11]*Det4_2345_0345
1857 + m[
A13]*Det4_2345_0145 - m[
A14]*Det4_2345_0135 + m[
A15]*Det4_2345_0134;
1858 G4double Det5_12345_02345 = m[
A10]*Det4_2345_2345 - m[
A12]*Det4_2345_0345
1859 + m[
A13]*Det4_2345_0245 - m[
A14]*Det4_2345_0235 + m[
A15]*Det4_2345_0234;
1860 G4double Det5_12345_12345 = m[
A11]*Det4_2345_2345 - m[
A12]*Det4_2345_1345
1861 + m[
A13]*Det4_2345_1245 - m[
A14]*Det4_2345_1235 + m[
A15]*Det4_2345_1234;
1866 - m[
A01]*Det5_12345_02345
1867 + m[
A02]*Det5_12345_01345
1868 - m[
A03]*Det5_12345_01245
1869 + m[
A04]*Det5_12345_01235
1870 - m[
A05]*Det5_12345_01234;
1879 G4double mn1OverDet = - oneOverDet;
1881 m[
A00] = Det5_12345_12345*oneOverDet;
1882 m[
A01] = Det5_12345_02345*mn1OverDet;
1883 m[
A02] = Det5_12345_01345*oneOverDet;
1884 m[
A03] = Det5_12345_01245*mn1OverDet;
1885 m[
A04] = Det5_12345_01235*oneOverDet;
1886 m[
A05] = Det5_12345_01234*mn1OverDet;
1888 m[
A11] = Det5_02345_02345*oneOverDet;
1889 m[
A12] = Det5_02345_01345*mn1OverDet;
1890 m[
A13] = Det5_02345_01245*oneOverDet;
1891 m[
A14] = Det5_02345_01235*mn1OverDet;
1892 m[
A15] = Det5_02345_01234*oneOverDet;
1894 m[
A22] = Det5_01345_01345*oneOverDet;
1895 m[
A23] = Det5_01345_01245*mn1OverDet;
1896 m[
A24] = Det5_01345_01235*oneOverDet;
1897 m[
A25] = Det5_01345_01234*mn1OverDet;
1899 m[
A33] = Det5_01245_01245*oneOverDet;
1900 m[
A34] = Det5_01245_01235*mn1OverDet;
1901 m[
A35] = Det5_01245_01234*oneOverDet;
1903 m[
A44] = Det5_01235_01235*oneOverDet;
1904 m[
A45] = Det5_01235_01234*mn1OverDet;
1906 m[
A55] = Det5_01234_01234*oneOverDet;
1945 if (h00 <= 0) {
return; }
1946 h00 = 1.0 / std::sqrt(h00);
1955 h11 = m[
A11] - (g10 * g10);
1956 if (h11 <= 0) {
return; }
1957 h11 = 1.0 / std::sqrt(h11);
1962 g21 = (m[
A21] - (g10 * g20)) * h11;
1963 g31 = (m[
A31] - (g10 * g30)) * h11;
1964 g41 = (m[
A41] - (g10 * g40)) * h11;
1968 h22 = m[
A22] - (g20 * g20) - (g21 * g21);
1969 if (h22 <= 0) {
return; }
1970 h22 = 1.0 / std::sqrt(h22);
1975 g32 = (m[
A32] - (g20 * g30) - (g21 * g31)) * h22;
1976 g42 = (m[
A42] - (g20 * g40) - (g21 * g41)) * h22;
1980 h33 = m[
A33] - (g30 * g30) - (g31 * g31) - (g32 * g32);
1981 if (h33 <= 0) {
return; }
1982 h33 = 1.0 / std::sqrt(h33);
1986 g43 = (m[
A43] - (g30 * g40) - (g31 * g41) - (g32 * g42)) * h33;
1990 h44 = m[
A44] - (g40 * g40) - (g41 * g41) - (g42 * g42) - (g43 * g43);
1991 if (h44 <= 0) {
return; }
1992 h44 = 1.0 / std::sqrt(h44);
1999 h43 = -h33 * g43 * h44;
2000 h32 = -h22 * g32 * h33;
2001 h42 = -h22 * (g32 * h43 + g42 * h44);
2002 h21 = -h11 * g21 * h22;
2003 h31 = -h11 * (g21 * h32 + g31 * h33);
2004 h41 = -h11 * (g21 * h42 + g31 * h43 + g41 * h44);
2005 h10 = -h00 * g10 * h11;
2006 h20 = -h00 * (g10 * h21 + g20 * h22);
2007 h30 = -h00 * (g10 * h31 + g20 * h32 + g30 * h33);
2008 h40 = -h00 * (g10 * h41 + g20 * h42 + g30 * h43 + g40 * h44);
2013 m[
A00] = h00 * h00 + h10 * h10 + h20 * h20 + h30 * h30 + h40 * h40;
2014 m[
A01] = h10 * h11 + h20 * h21 + h30 * h31 + h40 * h41;
2015 m[
A11] = h11 * h11 + h21 * h21 + h31 * h31 + h41 * h41;
2016 m[
A02] = h20 * h22 + h30 * h32 + h40 * h42;
2017 m[
A12] = h21 * h22 + h31 * h32 + h41 * h42;
2018 m[
A22] = h22 * h22 + h32 * h32 + h42 * h42;
2019 m[
A03] = h30 * h33 + h40 * h43;
2020 m[
A13] = h31 * h33 + h41 * h43;
2021 m[
A23] = h32 * h33 + h42 * h43;
2022 m[
A33] = h33 * h33 + h43 * h43;
2051 G4double h00, h11, h22, h33, h44, h55;
2068 if (h00 <= 0) {
return; }
2069 h00 = 1.0 / std::sqrt(h00);
2079 h11 = m[
A11] - (g10 * g10);
2080 if (h11 <= 0) {
return; }
2081 h11 = 1.0 / std::sqrt(h11);
2086 g21 = (m[
A21] - (g10 * g20)) * h11;
2087 g31 = (m[
A31] - (g10 * g30)) * h11;
2088 g41 = (m[
A41] - (g10 * g40)) * h11;
2089 g51 = (m[
A51] - (g10 * g50)) * h11;
2093 h22 = m[
A22] - (g20 * g20) - (g21 * g21);
2094 if (h22 <= 0) {
return; }
2095 h22 = 1.0 / std::sqrt(h22);
2100 g32 = (m[
A32] - (g20 * g30) - (g21 * g31)) * h22;
2101 g42 = (m[
A42] - (g20 * g40) - (g21 * g41)) * h22;
2102 g52 = (m[
A52] - (g20 * g50) - (g21 * g51)) * h22;
2106 h33 = m[
A33] - (g30 * g30) - (g31 * g31) - (g32 * g32);
2107 if (h33 <= 0) {
return; }
2108 h33 = 1.0 / std::sqrt(h33);
2113 g43 = (m[
A43] - (g30 * g40) - (g31 * g41) - (g32 * g42)) * h33;
2114 g53 = (m[
A53] - (g30 * g50) - (g31 * g51) - (g32 * g52)) * h33;
2118 h44 = m[
A44] - (g40 * g40) - (g41 * g41) - (g42 * g42) - (g43 * g43);
2119 if (h44 <= 0) {
return; }
2120 h44 = 1.0 / std::sqrt(h44);
2124 g54 = (m[
A54] - (g40 * g50) - (g41 * g51) - (g42 * g52) - (g43 * g53)) * h44;
2128 h55 = m[
A55] - (g50*g50) - (g51*g51) - (g52*g52) - (g53*g53) - (g54*g54);
2129 if (h55 <= 0) {
return; }
2130 h55 = 1.0 / std::sqrt(h55);
2137 h54 = -h44 * g54 * h55;
2138 h43 = -h33 * g43 * h44;
2139 h53 = -h33 * (g43 * h54 + g53 * h55);
2140 h32 = -h22 * g32 * h33;
2141 h42 = -h22 * (g32 * h43 + g42 * h44);
2142 h52 = -h22 * (g32 * h53 + g42 * h54 + g52 * h55);
2143 h21 = -h11 * g21 * h22;
2144 h31 = -h11 * (g21 * h32 + g31 * h33);
2145 h41 = -h11 * (g21 * h42 + g31 * h43 + g41 * h44);
2146 h51 = -h11 * (g21 * h52 + g31 * h53 + g41 * h54 + g51 * h55);
2147 h10 = -h00 * g10 * h11;
2148 h20 = -h00 * (g10 * h21 + g20 * h22);
2149 h30 = -h00 * (g10 * h31 + g20 * h32 + g30 * h33);
2150 h40 = -h00 * (g10 * h41 + g20 * h42 + g30 * h43 + g40 * h44);
2151 h50 = -h00 * (g10 * h51 + g20 * h52 + g30 * h53 + g40 * h54 + g50 * h55);
2156 m[
A00] = h00 * h00 + h10 * h10 + h20 * h20 + h30 * h30 + h40 * h40 + h50*h50;
2157 m[
A01] = h10 * h11 + h20 * h21 + h30 * h31 + h40 * h41 + h50 * h51;
2158 m[
A11] = h11 * h11 + h21 * h21 + h31 * h31 + h41 * h41 + h51 * h51;
2159 m[
A02] = h20 * h22 + h30 * h32 + h40 * h42 + h50 * h52;
2160 m[
A12] = h21 * h22 + h31 * h32 + h41 * h42 + h51 * h52;
2161 m[
A22] = h22 * h22 + h32 * h32 + h42 * h42 + h52 * h52;
2162 m[
A03] = h30 * h33 + h40 * h43 + h50 * h53;
2163 m[
A13] = h31 * h33 + h41 * h43 + h51 * h53;
2164 m[
A23] = h32 * h33 + h42 * h43 + h52 * h53;
2165 m[
A33] = h33 * h33 + h43 * h43 + h53 * h53;
2166 m[
A04] = h40 * h44 + h50 * h54;
2167 m[
A14] = h41 * h44 + h51 * h54;
2168 m[
A24] = h42 * h44 + h52 * h54;
2169 m[
A34] = h43 * h44 + h53 * h54;
2170 m[
A44] = h44 * h44 + h54 * h54;
2182void G4ErrorSymMatrix::invert4 (
G4int & ifail)
2206 + m[
A02]*Det2_12_01;
2208 + m[
A02]*Det2_13_01;
2210 + m[
A03]*Det2_13_01;
2212 + m[
A02]*Det2_23_01;
2214 + m[
A03]*Det2_23_01;
2216 + m[
A03]*Det2_23_02;
2218 + m[
A12]*Det2_23_01;
2220 + m[
A13]*Det2_23_01;
2222 + m[
A13]*Det2_23_02;
2224 + m[
A13]*Det2_23_12;
2229 - m[
A01]*Det3_123_023
2230 + m[
A02]*Det3_123_013
2231 - m[
A03]*Det3_123_012;
2240 G4double mn1OverDet = - oneOverDet;
2242 m[
A00] = Det3_123_123 * oneOverDet;
2243 m[
A01] = Det3_123_023 * mn1OverDet;
2244 m[
A02] = Det3_123_013 * oneOverDet;
2245 m[
A03] = Det3_123_012 * mn1OverDet;
2248 m[
A11] = Det3_023_023 * oneOverDet;
2249 m[
A12] = Det3_023_013 * mn1OverDet;
2250 m[
A13] = Det3_023_012 * oneOverDet;
2252 m[
A22] = Det3_013_013 * oneOverDet;
2253 m[
A23] = Det3_013_012 * mn1OverDet;
2255 m[
A33] = Det3_012_012 * oneOverDet;
#define CHK_DIM_2(r1, r2, c1, c2, fun)
std::vector< G4double >::iterator G4ErrorMatrixIter
std::vector< G4double >::const_iterator G4ErrorMatrixConstIter
G4ErrorSymMatrix dsum(const G4ErrorSymMatrix &mat1, const G4ErrorSymMatrix &mat2)
#define CHK_DIM_2(r1, r2, c1, c2, fun)
G4ErrorSymMatrix operator*(const G4ErrorSymMatrix &mat1, G4double t)
G4ErrorMatrix operator+(const G4ErrorMatrix &mat1, const G4ErrorSymMatrix &mat2)
G4ErrorMatrix operator-(const G4ErrorMatrix &mat1, const G4ErrorSymMatrix &mat2)
G4ErrorSymMatrix operator/(const G4ErrorSymMatrix &mat1, G4double t)
std::ostream & operator<<(std::ostream &os, const G4ErrorSymMatrix &q)
#define CHK_DIM_1(c1, r2, fun)
G4DLLIMPORT std::ostream G4cerr
G4ErrorMatrix & operator=(const G4ErrorMatrix &m2)
virtual G4int num_col() const
G4ErrorMatrix & operator-=(const G4ErrorMatrix &m2)
virtual G4int num_row() const
static void error(const char *s)
G4ErrorMatrix & operator+=(const G4ErrorMatrix &m2)
G4ErrorSymMatrix similarityT(const G4ErrorMatrix &m1) const
void invertCholesky6(G4int &ifail)
void invert(G4int &ifail)
void assign(const G4ErrorMatrix &m2)
void invertHaywood6(G4int &ifail)
void invertHaywood5(G4int &ifail)
G4ErrorSymMatrix sub(G4int min_row, G4int max_row) const
G4ErrorSymMatrix apply(G4double(*f)(G4double, G4int, G4int)) const
G4ErrorSymMatrix operator-() const
G4double determinant() const
G4ErrorSymMatrix & operator/=(G4double t)
G4ErrorSymMatrix & operator*=(G4double t)
void invertHaywood4(G4int &ifail)
G4ErrorSymMatrix & operator+=(const G4ErrorSymMatrix &m2)
virtual ~G4ErrorSymMatrix()
G4ErrorSymMatrix & operator-=(const G4ErrorSymMatrix &m2)
G4ErrorSymMatrix similarity(const G4ErrorMatrix &m1) const
void invertCholesky5(G4int &ifail)
G4ErrorSymMatrix & operator=(const G4ErrorSymMatrix &m2)
void invertBunchKaufman(G4int &ifail)