6 void Newguy(
const char *t1,
const char *t2) {
7 cout <<
" ---------------------------------------------------------------" << endl <<
8 " Routing " << t2 <<
" testing " << t1 << endl;
13 TRMatrix ac(3,2,
" 0. 1. 2. 3. 4. 5.");
15 TRMatrix bc(2,4,
" 0. 20. 30. 40. 50. 60. 70. 80.");
18 TRMatrix c1c(3,4,
"50. 60. 70. 80. 150. 220. 270. 320. 250. 380. 470. 560.");
20 TRMatrix c2c(3,3,
"3. 4. 5. 9. 14. 19. 15. 24. 33.");
21 TRMatrix d__(3,4,
"2. 4. 6. 8. 102. 104. 106. 108. 202. 204. 206. 208.");
24 TRMatrix bct(bc,TRArray::kTransposed);
25 TRMatrix act(ac,TRArray::kTransposed);
28 Newguy(
"MXMPY-1-2-3.",
"TMXM ");
30 temp =
new TRMatrix(ac,TRArray::kAxB,bc);
31 if (temp->Verify(c1c)) {
32 cout <<
"ac:" << ac << endl;
33 cout <<
"bc:" << bc << endl;
34 cout <<
"Temp kAxB: ac x bc" << *temp << endl;
35 cout <<
"c1c " << c1c << endl;
37 else cout <<
"ac,kAxB,bc Passed" << endl;
39 temp =
new TRMatrix(ac,TRArray::kAxBT,bct);
40 if (temp->Verify(c1c)) {
41 cout <<
"act:" << act << endl;
42 cout <<
"bct:" << bct << endl;
43 cout <<
"Temp kAxBT: ac x bctT " << *temp << endl;
44 cout <<
"c1c " << c1c << endl;
46 else cout <<
"ac,kAxBT,bct Passed" << endl;
48 temp =
new TRMatrix(act,TRArray::kATxB,bc);
49 if (temp->Verify(c1c)) {
50 cout <<
"act:" << act << endl;
51 cout <<
"bc:" << bc << endl;
52 cout <<
"Temp kATxB: actT x bc" << *temp << endl;
53 cout <<
"c1c " << c1c << endl;
55 else cout <<
"act,kATxB,bc Passed" << endl;
58 temp =
new TRMatrix(act,TRArray::kATxBT,bct);
59 if (temp->Verify(c1c)) {
60 cout <<
"act:" << act << endl;
61 cout <<
"bct:" << bct << endl;
62 cout <<
"Temp kATxBT: actT x bctT" << *temp << endl;
63 cout <<
"c1c " << c1c << endl;
65 else cout <<
"act,kATxBT,bct Passed" << endl;
68 temp =
new TRMatrix(ac,TRArray::kAxB,acA);
69 if (temp->Verify(c2c)) {
70 cout <<
"ac:" << ac << endl;
71 cout <<
"acA:" << acA << endl;
72 cout <<
"Temp kAxB: ac x acA" << *temp << endl;
73 cout <<
"c2c " << c2c << endl;
75 else cout <<
"ac,kAxB,acA Passed" << endl;
78 Newguy(
"MXMAD-1-2-3.",
"TMXM ");
83 TRMatrix aplus1(ac,TRArray::kAxB,acA);
88 temp->Add(ac,TRArray::kAxB,bc);
89 if (temp->Verify(aplus)) {
90 cout <<
"ac:" << ac << endl;
91 cout <<
"acA:" << acA << endl;
92 cout <<
"Temp Add kAxB: ac x acA" << *temp << endl;
93 cout <<
"aplus " << aplus << endl;
95 else cout <<
"Add ac,kAxB,acA Passed" << endl;
99 temp->Add(ac,TRArray::kAxBT,bct);
100 if (temp->Verify(aplus)) {
101 cout <<
"ac:" << ac << endl;
102 cout <<
"bct:" << bct << endl;
103 cout <<
"Temp Add kAxBT: ac x bctT" << *temp << endl;
104 cout <<
"aplus " << aplus << endl;
106 else cout <<
"Add ac,kAxBT,bct Passed" << endl;
110 temp->Add(act,TRArray::kATxB,bc);
111 if (temp->Verify(aplus)) {
112 cout <<
"act:" << act << endl;
113 cout <<
"bc:" << bc << endl;
114 cout <<
"Temp Add kATxB: actT x bc" << *temp << endl;
115 cout <<
"aplus " << aplus << endl;
117 else cout <<
"Add act,kATxB,bc Passed" << endl;
122 temp->Add(act,TRArray::kATxBT,bct);
123 if (temp->Verify(aplus)) {
124 cout <<
"act:" << act << endl;
125 cout <<
"bct:" << bct << endl;
126 cout <<
"Temp Add kATxBT: actT x bctT" << *temp << endl;
127 cout <<
"aplus " << aplus << endl;
129 else cout <<
"Add act,kATxBT,bct Passed" << endl;
133 temp->Add(ac,TRArray::kAxB,acA);
134 if (temp->Verify(aplus1)) {
135 cout <<
"ac:" << ac << endl;
136 cout <<
"acA:" << acA << endl;
137 cout <<
"Temp Add kAxB: ac x acA" << *temp << endl;
138 cout <<
"aplus " << aplus << endl;
140 else cout <<
"Add act,kATxBT,bct Passed" << endl;
143 Newguy(
"MXMUB-1-2-3.",
"TMXM ");
147 temp->Substruct(ac,TRArray::kAxB,bc);
148 if (temp->Verify(amin)) {
149 cout <<
"ac:" << ac << endl;
150 cout <<
"bc:" << ac << endl;
151 cout <<
"Temp kAxB: ac x bc" << *temp << endl;
152 cout <<
"amin " << amin << endl;
154 else cout <<
"Substruct(ac,kAxB,bc) Passed" << endl;
158 temp->Substruct(ac,TRArray::kAxBT,bct);
159 if (temp->Verify(amin)) {
160 cout <<
"ac:" << ac << endl;
161 cout <<
"bct:" << act << endl;
162 cout <<
"Temp kAxBT: ac x bctT" << *temp << endl;
163 cout <<
"amin " << amin << endl;
165 else cout <<
"Substruct(ac,kAxBT,bct) Passed" << endl;
169 temp->Substruct(act,TRArray::kATxB,bc);
170 if (temp->Verify(amin)) {
171 cout <<
"act:" << act << endl;
172 cout <<
"bc:" << bc << endl;
173 cout <<
"Temp kATxB: actT x bc" << *temp << endl;
174 cout <<
"amin " << amin << endl;
176 else cout <<
"Substruct(act,kATxB,bc) Passed" << endl;
180 temp->Substruct(act,TRArray::kATxBT,bct);
181 if (temp->Verify(amin)) {
182 cout <<
"act:" << act << endl;
183 cout <<
"bct:" << bct << endl;
184 cout <<
"Temp kATxBT: actT x bctT" << *temp << endl;
185 cout <<
"amin " << amin << endl;
187 else cout <<
"Substruct(act,kATxBT,bct) Passed" << endl;
192 temp->Substruct(ac,TRArray::kAxB,acA);
193 if (temp->Verify(amin2)) {
194 cout <<
"ac:" << ac << endl;
195 cout <<
"acA:" << acA << endl;
196 cout <<
"Temp kAxB: ac xx acA" << *temp << endl;
197 cout <<
"amin2 " << amin2 << endl;
199 else cout <<
"Substruct(ac,kAxB,acA) Passed" << endl;
209 TRSymMatrix ac(4,
"1. 0. 0. 2. 0. 13. 4. 0. 23. 77. ");
210 TRSymMatrix rc(4,
" 1.45679 0. 0. -.191358 0. .1882716 -.0185185 0. -.0462963 .02777778 ");
212 Newguy(
"TRINV -TRSINV.",
"TTRINV ");
213 Double_t zerlev = 1e-4;
215 if (B->Verify(rc,zerlev)) {
216 cout <<
"ac:" << ac << endl;
217 cout <<
"rc:" << rc << endl;
218 cout <<
"B ac,kInverted" << *B << endl;
220 else cout <<
"ac,kInverted Passed" << endl;
231 TRSymMatrix dc(4,
" 1. 2. 3. 0. 0. 0. 4. 5. 0. 6. ");
233 TRSymMatrix ac(4,
"1. 0. 0. 2. 0. 13. 4. 0. 23. 77.");
234 TRSymMatrix sc(3,
"1384. 1712. 2201. 858. 1075. 538.");
235 TRSymMatrix atsac(3,
" 239. 331. 447. 248. 345. 257. ");
236 TRSymMatrix qsqc(4,
" 1265. 1594. 2009. 0. 0. 0. 1940. 2446. 0. 2980. ");
237 TRMatrix sac(4,3,
" 18. 23. 19. 27. 37. 28. 0. 0. 0. 43. 64. 44. ");
238 TRMatrix asc(3,4,
" 30. 44. 0. 69. 34. 49. 0. 74. 17. 26. 0. 42.");
241 Double_t zerlev = 1e-6;
243 Newguy(
"TRAAT-TRATA.",
"TTRLA ");
244 TRMatrix ec(4,3,
"4. 7. 3. 3. 6. 4. 0. 5. 5. 2. 1. 2.");
246 TRSymMatrix wc(4,
"74. 66. 61. 50. 50. 50. 21. 20. 15. 9.");
247 if (A->Verify(wc,zerlev)) {
248 cout <<
"ec:" << ec << endl;
249 cout <<
"wc:" << wc << endl;
250 cout <<
"A ec,kAxAT" << *A << endl;
252 else cout <<
"ec,kAxAT passed" << endl;
257 TRSymMatrix xc(4,
"77. 62. 69. 17. 23. 10. 52. 45. 11. 38.");
258 if (A->Verify(xc,zerlev)) {
259 cout <<
"ecA:" << ecA << endl;
260 cout <<
"xc:" << xc << endl;
261 cout <<
"A ecA,kATxA" << *A << endl;
263 else cout <<
"ecA,kATxA passed" << endl;
266 Newguy(
"TRASAT-TRATSA-TRQSQ.",
"TTRLA ");
268 if (A2->Verify(sc,zerlev)) {
269 cout <<
"ecA:" << ecA << endl;
270 cout <<
"ac:" << ac << endl;
271 cout <<
"A ecA,kAxSxAT,ac" << *A2 << endl;
273 else cout <<
"ecA,kAxSxATx,ac Passed" << endl;
277 if (A3->Verify(atsac,zerlev)) {
278 cout <<
"ec:" << ec << endl;
279 cout <<
"dc:" << dc << endl;
280 cout <<
"A ec,kATxSxA,dc" << *A3 << endl;
282 else cout <<
"ec,kATxSxA,dc Passed" << endl;
286 if (A4->Verify(qsqc,zerlev)) {
287 cout <<
"dc:" << dc << endl;
288 cout <<
"ac:" << ac << endl;
289 cout <<
"A dc,kRxSxR,ac" << *A4 << endl;
291 else cout <<
"dc,kRxSxR,ac Passed" << endl;
294 Newguy(
"TRSA-TRAS-TRSAT-TRATS.",
"TTRLA ");
296 if (A5->Verify(sac,zerlev)) {
297 cout <<
"dc:" << dc << endl;
298 cout <<
"ec:" << ec << endl;
299 cout <<
"A dc,kSxA, ec" << *A5 << endl;
301 else cout <<
"dc,kSxA, ec Passed" << endl;
306 if (A6->Verify(asc,zerlev)) {
307 cout <<
"ecA:" << ecA << endl;
308 cout <<
"asc:" << asc << endl;
309 cout <<
"" << *A6 << endl;
311 else cout <<
"acA,kAxS,dc Passed" << endl;
316 TRMatrix satc(4,3,
"30. 34. 17. 44. 49. 26. 0. 0. 0. 69. 74. 42.");
317 if (A7->Verify(satc,zerlev)) {
318 cout <<
"dc:" << dc << endl;
319 cout <<
"ecA:" << ecA << endl;
320 cout <<
"A dc,kSxAT,ecA" << *A7 << endl;
322 else cout <<
"dc,kSxAT,ecA Passed" << endl;
325 TRMatrix atsc(3,4,
" 18. 27. 0. 43. 23. 37. 0. 64. 19. 28. 0. 44.");
326 if (A8->Verify(atsc,zerlev)) {
327 cout <<
"ec:" << ec << endl;
328 cout <<
"dc:" << dc << endl;
329 cout <<
"A ec,kATxS,dc" << *A8 << endl;
331 else cout <<
"ec,kATxS,dc Passed" << endl;
334 Newguy(
"TRPCK-TRUPCK.",
"TTRLA ");
335 TRMatrix upckc(4,4,
" 1.,2.,4.,7.,2.,3.,5.,8.,4.,5.,6.,9.,7.,8.,9.,10.");
336 TRSymMatrix pckc(4,
"1.,2.,3.,4.,5.,6.,7.,8.,9.,10.");
338 if (A9->Verify(pckc,zerlev)) {
339 cout <<
"upckc:" << upckc << endl;
340 cout <<
"pckc:" << pckc << endl;
341 cout <<
"A upckc" << *A9 << endl;
343 else cout <<
"packing of upckc Passed" << endl;
347 if (A10->Verify(upckc,zerlev)) {
348 cout <<
"pckc:" << pckc << endl;
349 cout <<
"upckc:" << upckc << endl;
350 cout <<
"A pckc" << *A10 << endl;
352 else cout <<
"unpacking of pckc Passed" << endl;
356 if (A11->Verify(pckc,zerlev)) {
357 cout <<
"A10:" << *A10 << endl;
358 cout <<
"pckc:" << pckc << endl;
359 cout <<
"A11:" << *A11 << endl;
361 else cout <<
"packing of upckc Passed" << endl;
363 if (A12->Verify(upckc,zerlev)) {
364 cout <<
"A11:" << *A11 << endl;
365 cout <<
"upckc:" << upckc << endl;
366 cout <<
"A12" << *A12 << endl;
368 else cout <<
"unpacking of A12 Passed" << endl;