20 #ifndef ROOT_Math_CramerInversionSym_icc 21 #define ROOT_Math_CramerInversionSym_icc 45 const Scalar c00 = rhs[4] * rhs[8] - rhs[5] * rhs[5];
46 const Scalar c01 = rhs[5] * rhs[2] - rhs[1] * rhs[8];
47 const Scalar c02 = rhs[1] * rhs[5] - rhs[4] * rhs[2];
48 const Scalar c11 = rhs[8] * rhs[0] - rhs[2] * rhs[2];
49 const Scalar c12 = rhs[2] * rhs[1] - rhs[5] * rhs[0];
50 const Scalar c22 = rhs[0] * rhs[4] - rhs[1] * rhs[1];
52 const Scalar t0 = std::abs(rhs[0]);
53 const Scalar
t1 = std::abs(rhs[1]);
54 const Scalar t2 = std::abs(rhs[2]);
62 det = c12*c01-c11*c02;
65 det = c11*c22-c12*c12;
67 }
else if (t2 >= t1) {
69 det = c12*c01-c11*c02;
72 det = c02*c12-c01*c22;
75 if ( det == 0 || tmp == 0)
148 const Scalar mDet3_012_012 = rhs[
SF00]*mDet2_12_12 - rhs[
SF01]*mDet2_12_02
149 + rhs[
SF02]*mDet2_12_01;
150 const Scalar mDet3_013_012 = rhs[
SF00]*mDet2_13_12 - rhs[
SF01]*mDet2_13_02
151 + rhs[
SF02]*mDet2_13_01;
152 const Scalar mDet3_013_013 = rhs[
SF00]*mDet2_13_13 - rhs[
SF01]*mDet2_13_03
153 + rhs[
SF03]*mDet2_13_01;
154 const Scalar mDet3_023_012 = rhs[
SF00]*mDet2_23_12 - rhs[
SF01]*mDet2_23_02
155 + rhs[
SF02]*mDet2_23_01;
156 const Scalar mDet3_023_013 = rhs[
SF00]*mDet2_23_13 - rhs[
SF01]*mDet2_23_03
157 + rhs[
SF03]*mDet2_23_01;
158 const Scalar mDet3_023_023 = rhs[
SF00]*mDet2_23_23 - rhs[
SF02]*mDet2_23_03
159 + rhs[
SF03]*mDet2_23_02;
160 const Scalar mDet3_123_012 = rhs[
SF10]*mDet2_23_12 - rhs[
SF11]*mDet2_23_02
161 + rhs[
SF12]*mDet2_23_01;
162 const Scalar mDet3_123_013 = rhs[
SF10]*mDet2_23_13 - rhs[
SF11]*mDet2_23_03
163 + rhs[
SF13]*mDet2_23_01;
164 const Scalar mDet3_123_023 = rhs[
SF10]*mDet2_23_23 - rhs[
SF12]*mDet2_23_03
165 + rhs[
SF13]*mDet2_23_02;
166 const Scalar mDet3_123_123 = rhs[
SF11]*mDet2_23_23 - rhs[
SF12]*mDet2_23_13
167 + rhs[
SF13]*mDet2_23_12;
171 const Scalar det = rhs[
SF00]*mDet3_123_123 - rhs[
SF01]*mDet3_123_023
172 + rhs[
SF02]*mDet3_123_013 - rhs[
SF03]*mDet3_123_012;
180 const Scalar oneOverDet = 1.0f / det;
181 const Scalar mn1OverDet = - oneOverDet;
183 rhs[
SF00] = mDet3_123_123 * oneOverDet;
184 rhs[
SF01] = mDet3_123_023 * mn1OverDet;
185 rhs[
SF02] = mDet3_123_013 * oneOverDet;
186 rhs[
SF03] = mDet3_123_012 * mn1OverDet;
188 rhs[
SF11] = mDet3_023_023 * oneOverDet;
189 rhs[
SF12] = mDet3_023_013 * mn1OverDet;
190 rhs[
SF13] = mDet3_023_012 * oneOverDet;
192 rhs[
SF22] = mDet3_013_013 * oneOverDet;
193 rhs[
SF23] = mDet3_013_012 * mn1OverDet;
195 rhs[
SF33] = mDet3_012_012 * oneOverDet;
275 const Scalar mDet3_123_012 = rhs[
SM10]*mDet2_23_12 - rhs[
SM11]*mDet2_23_02 + rhs[
SM12]*mDet2_23_01;
276 const Scalar mDet3_123_013 = rhs[
SM10]*mDet2_23_13 - rhs[
SM11]*mDet2_23_03 + rhs[
SM13]*mDet2_23_01;
277 const Scalar mDet3_123_023 = rhs[
SM10]*mDet2_23_23 - rhs[
SM12]*mDet2_23_03 + rhs[
SM13]*mDet2_23_02;
278 const Scalar mDet3_123_123 = rhs[
SM11]*mDet2_23_23 - rhs[
SM12]*mDet2_23_13 + rhs[
SM13]*mDet2_23_12;
279 const Scalar mDet3_124_012 = rhs[
SM10]*mDet2_24_12 - rhs[
SM11]*mDet2_24_02 + rhs[
SM12]*mDet2_24_01;
280 const Scalar mDet3_124_013 = rhs[
SM10]*mDet2_24_13 - rhs[
SM11]*mDet2_24_03 + rhs[
SM13]*mDet2_24_01;
281 const Scalar mDet3_124_014 = rhs[
SM10]*mDet2_24_14 - rhs[
SM11]*mDet2_24_04 + rhs[
SM14]*mDet2_24_01;
282 const Scalar mDet3_124_023 = rhs[
SM10]*mDet2_24_23 - rhs[
SM12]*mDet2_24_03 + rhs[
SM13]*mDet2_24_02;
283 const Scalar mDet3_124_024 = rhs[
SM10]*mDet2_24_24 - rhs[
SM12]*mDet2_24_04 + rhs[
SM14]*mDet2_24_02;
284 const Scalar mDet3_124_123 = rhs[
SM11]*mDet2_24_23 - rhs[
SM12]*mDet2_24_13 + rhs[
SM13]*mDet2_24_12;
285 const Scalar mDet3_124_124 = rhs[
SM11]*mDet2_24_24 - rhs[
SM12]*mDet2_24_14 + rhs[
SM14]*mDet2_24_12;
286 const Scalar mDet3_134_012 = rhs[
SM10]*mDet2_34_12 - rhs[
SM11]*mDet2_34_02 + rhs[
SM12]*mDet2_34_01;
287 const Scalar mDet3_134_013 = rhs[
SM10]*mDet2_34_13 - rhs[
SM11]*mDet2_34_03 + rhs[
SM13]*mDet2_34_01;
288 const Scalar mDet3_134_014 = rhs[
SM10]*mDet2_34_14 - rhs[
SM11]*mDet2_34_04 + rhs[
SM14]*mDet2_34_01;
289 const Scalar mDet3_134_023 = rhs[
SM10]*mDet2_34_23 - rhs[
SM12]*mDet2_34_03 + rhs[
SM13]*mDet2_34_02;
290 const Scalar mDet3_134_024 = rhs[
SM10]*mDet2_34_24 - rhs[
SM12]*mDet2_34_04 + rhs[
SM14]*mDet2_34_02;
291 const Scalar mDet3_134_034 = rhs[
SM10]*mDet2_34_34 - rhs[
SM13]*mDet2_34_04 + rhs[
SM14]*mDet2_34_03;
292 const Scalar mDet3_134_123 = rhs[
SM11]*mDet2_34_23 - rhs[
SM12]*mDet2_34_13 + rhs[
SM13]*mDet2_34_12;
293 const Scalar mDet3_134_124 = rhs[
SM11]*mDet2_34_24 - rhs[
SM12]*mDet2_34_14 + rhs[
SM14]*mDet2_34_12;
294 const Scalar mDet3_134_134 = rhs[
SM11]*mDet2_34_34 - rhs[
SM13]*mDet2_34_14 + rhs[
SM14]*mDet2_34_13;
295 const Scalar mDet3_234_012 = rhs[
SM20]*mDet2_34_12 - rhs[
SM21]*mDet2_34_02 + rhs[
SM22]*mDet2_34_01;
296 const Scalar mDet3_234_013 = rhs[
SM20]*mDet2_34_13 - rhs[
SM21]*mDet2_34_03 + rhs[
SM23]*mDet2_34_01;
297 const Scalar mDet3_234_014 = rhs[
SM20]*mDet2_34_14 - rhs[
SM21]*mDet2_34_04 + rhs[
SM24]*mDet2_34_01;
298 const Scalar mDet3_234_023 = rhs[
SM20]*mDet2_34_23 - rhs[
SM22]*mDet2_34_03 + rhs[
SM23]*mDet2_34_02;
299 const Scalar mDet3_234_024 = rhs[
SM20]*mDet2_34_24 - rhs[
SM22]*mDet2_34_04 + rhs[
SM24]*mDet2_34_02;
300 const Scalar mDet3_234_034 = rhs[
SM20]*mDet2_34_34 - rhs[
SM23]*mDet2_34_04 + rhs[
SM24]*mDet2_34_03;
301 const Scalar mDet3_234_123 = rhs[
SM21]*mDet2_34_23 - rhs[
SM22]*mDet2_34_13 + rhs[
SM23]*mDet2_34_12;
302 const Scalar mDet3_234_124 = rhs[
SM21]*mDet2_34_24 - rhs[
SM22]*mDet2_34_14 + rhs[
SM24]*mDet2_34_12;
303 const Scalar mDet3_234_134 = rhs[
SM21]*mDet2_34_34 - rhs[
SM23]*mDet2_34_14 + rhs[
SM24]*mDet2_34_13;
304 const Scalar mDet3_234_234 = rhs[
SM22]*mDet2_34_34 - rhs[
SM23]*mDet2_34_24 + rhs[
SM24]*mDet2_34_23;
308 const Scalar mDet4_0123_0123 = rhs[
SM00]*mDet3_123_123 - rhs[
SM01]*mDet3_123_023
309 + rhs[
SM02]*mDet3_123_013 - rhs[
SM03]*mDet3_123_012;
310 const Scalar mDet4_0124_0123 = rhs[
SM00]*mDet3_124_123 - rhs[
SM01]*mDet3_124_023
311 + rhs[
SM02]*mDet3_124_013 - rhs[
SM03]*mDet3_124_012;
312 const Scalar mDet4_0124_0124 = rhs[
SM00]*mDet3_124_124 - rhs[
SM01]*mDet3_124_024
313 + rhs[
SM02]*mDet3_124_014 - rhs[
SM04]*mDet3_124_012;
314 const Scalar mDet4_0134_0123 = rhs[
SM00]*mDet3_134_123 - rhs[
SM01]*mDet3_134_023
315 + rhs[
SM02]*mDet3_134_013 - rhs[
SM03]*mDet3_134_012;
316 const Scalar mDet4_0134_0124 = rhs[
SM00]*mDet3_134_124 - rhs[
SM01]*mDet3_134_024
317 + rhs[
SM02]*mDet3_134_014 - rhs[
SM04]*mDet3_134_012;
318 const Scalar mDet4_0134_0134 = rhs[
SM00]*mDet3_134_134 - rhs[
SM01]*mDet3_134_034
319 + rhs[
SM03]*mDet3_134_014 - rhs[
SM04]*mDet3_134_013;
320 const Scalar mDet4_0234_0123 = rhs[
SM00]*mDet3_234_123 - rhs[
SM01]*mDet3_234_023
321 + rhs[
SM02]*mDet3_234_013 - rhs[
SM03]*mDet3_234_012;
322 const Scalar mDet4_0234_0124 = rhs[
SM00]*mDet3_234_124 - rhs[
SM01]*mDet3_234_024
323 + rhs[
SM02]*mDet3_234_014 - rhs[
SM04]*mDet3_234_012;
324 const Scalar mDet4_0234_0134 = rhs[
SM00]*mDet3_234_134 - rhs[
SM01]*mDet3_234_034
325 + rhs[
SM03]*mDet3_234_014 - rhs[
SM04]*mDet3_234_013;
326 const Scalar mDet4_0234_0234 = rhs[
SM00]*mDet3_234_234 - rhs[
SM02]*mDet3_234_034
327 + rhs[
SM03]*mDet3_234_024 - rhs[
SM04]*mDet3_234_023;
328 const Scalar mDet4_1234_0123 = rhs[
SM10]*mDet3_234_123 - rhs[
SM11]*mDet3_234_023
329 + rhs[
SM12]*mDet3_234_013 - rhs[
SM13]*mDet3_234_012;
330 const Scalar mDet4_1234_0124 = rhs[
SM10]*mDet3_234_124 - rhs[
SM11]*mDet3_234_024
331 + rhs[
SM12]*mDet3_234_014 - rhs[
SM14]*mDet3_234_012;
332 const Scalar mDet4_1234_0134 = rhs[
SM10]*mDet3_234_134 - rhs[
SM11]*mDet3_234_034
333 + rhs[
SM13]*mDet3_234_014 - rhs[
SM14]*mDet3_234_013;
334 const Scalar mDet4_1234_0234 = rhs[
SM10]*mDet3_234_234 - rhs[
SM12]*mDet3_234_034
335 + rhs[
SM13]*mDet3_234_024 - rhs[
SM14]*mDet3_234_023;
336 const Scalar mDet4_1234_1234 = rhs[
SM11]*mDet3_234_234 - rhs[
SM12]*mDet3_234_134
337 + rhs[
SM13]*mDet3_234_124 - rhs[
SM14]*mDet3_234_123;
341 const Scalar det = rhs[
SM00]*mDet4_1234_1234 - rhs[
SM01]*mDet4_1234_0234 + rhs[
SM02]*mDet4_1234_0134
342 - rhs[
SM03]*mDet4_1234_0124 + rhs[
SM04]*mDet4_1234_0123;
349 const Scalar oneOverDet = 1.0f / det;
350 const Scalar mn1OverDet = - oneOverDet;
352 rhs[
SM00] = mDet4_1234_1234 * oneOverDet;
353 rhs[
SM01] = mDet4_1234_0234 * mn1OverDet;
354 rhs[
SM02] = mDet4_1234_0134 * oneOverDet;
355 rhs[
SM03] = mDet4_1234_0124 * mn1OverDet;
356 rhs[
SM04] = mDet4_1234_0123 * oneOverDet;
358 rhs[
SM11] = mDet4_0234_0234 * oneOverDet;
359 rhs[
SM12] = mDet4_0234_0134 * mn1OverDet;
360 rhs[
SM13] = mDet4_0234_0124 * oneOverDet;
361 rhs[
SM14] = mDet4_0234_0123 * mn1OverDet;
363 rhs[
SM22] = mDet4_0134_0134 * oneOverDet;
364 rhs[
SM23] = mDet4_0134_0124 * mn1OverDet;
365 rhs[
SM24] = mDet4_0134_0123 * oneOverDet;
367 rhs[
SM33] = mDet4_0124_0124 * oneOverDet;
368 rhs[
SM34] = mDet4_0124_0123 * mn1OverDet;
370 rhs[
SM44] = mDet4_0123_0123 * oneOverDet;
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
MatRepSym Matrix storage representation for a symmetric matrix of dimension NxN This class is a templ...
static bool Dinv(MatrixRep &rhs)
Namespace for new Math classes and functions.