ROOT  6.06/09
Reference Guide
matrix_op_vec.h
Go to the documentation of this file.
1 #ifndef MATRIX_OP_H
2 #define MATRIX_OP_H
3 
4 #include "TestTimer.h"
5 
6 // define functions for matrix operations
7 
8 //#define DEBUG
9 //#ifndef NLOOP
10 //#define NLOOP 1000000
11 //#endif
12 #include <vector>
13 
14 using namespace ROOT::Math;
15 
16 std::vector<float> gV;
17 
18 void initValues() {
19  gV.reserve(10*NLOOP);
20  TRandom3 r;
21  std::cout << "init smearing vector ";
22  for (int l = 0; l < 10*NLOOP; l++)
23  {
24  gV.push_back( r.Rndm() );
25  }
26  std::cout << " with size " << gV.size() << std::endl;
27 
28 }
29 
30 // function for summing elements of matrix or vector
31 template<class V>
32 typename V::value_type SumOfElements(const V & v) {
33  typename V::value_type sum = 0.0;
34  for (typename V::const_iterator itr = v.begin(); itr != v.end(); ++itr) {
35  sum += *itr;
36  }
37  return sum;
38 }
39 
40 
41 
42 // vector assignment
43 template<class V>
44 void testVeq(const V * v, double & time, V * result) {
45  Stype tmp = 0.0;
46  test::Timer t(time,"V=V ");
47  for (int l = 0; l < 10*NLOOP; l++) {
48  for (int k = 0; k < NLIST; k++) {
49  result[k] = v[k];
50  }
51  tmp += SumOfElements(result[NLIST-1]);
52  }
53  gResultSum += tmp;
54 }
55 
56 // matrix assignmnent
57 template<class M>
58 void testMeq(const M * m, double & time, M * result) {
59  Stype tmp = 0.0;
60  test::Timer t(time,"M=M ");
61  for (int l = 0; l < NLOOP; l++) {
62  for (int k = 0; k < NLIST; k++) {
63  result[k] = m[k];
64  }
65  tmp += SumOfElements(result[NLIST-1]);
66  }
67  gResultSum += tmp;
68 }
69 
70 
71 
72 // vector sum
73 template<class V>
74 void testVad(const V * v1, const V * v2, double & time, V * result) {
75  Stype tmp = 0.0;
76  test::Timer t(time,"V+V ");
77  for (int l = 0; l < 10*NLOOP; l++) {
78  for (int k = 0; k < NLIST; k++) {
79  result[k] = v1[k] + v2[k];
80  }
81  tmp += SumOfElements(result[NLIST-1]);
82  }
83  gResultSum += tmp;
84 }
85 
86 // matrix sum
87 template<class M>
88 void testMad(const M * m1, const M * m2, double & time, M * result) {
89  Stype tmp = 0.0;
90  test::Timer t(time,"M+M ");;
91  for (int l = 0; l < NLOOP; l++) {
92  for (int k = 0; k < NLIST; k++) {
93  result[k] = m1[k];
94  result[k] += m2[k];
95  }
96  tmp += SumOfElements(result[NLIST-1]);
97  }
98  gResultSum += tmp;
99 }
100 
101 // vector * constant
102 template<class V, class T>
103 void testVscale(const V * v, T a, double & time, V * result) {
104  Stype tmp = 0.0;
105  test::Timer t(time,"a*V ");;
106  for (int l = 0; l < NLOOP; l++) {
107  for (int k = 0; k < NLIST; k++) {
108  result[k] = a * v[k]; // v1 * a does not exist in ROOT
109  }
110  tmp += SumOfElements(result[NLIST-1]);
111  }
112  gResultSum += tmp;
113 }
114 
115 
116 // matrix * constant
117 template<class M, class T>
118 void testMscale(const M * m1, T a, double & time, M * result) {
119  Stype tmp = 0.0;
120  test::Timer t(time,"a*M ");;
121  for (int l = 0; l < NLOOP; l++) {
122  for (int k = 0; k < NLIST; k++) {
123  result[k] = m1[k]; result[k] *= a;
124  }
125  tmp += SumOfElements(result[NLIST-1]);
126  }
127  gResultSum += tmp;
128 }
129 
130 
131 // simple Matrix vector op
132 template<class M, class V>
133 void testMV(const M * mat, const V * v, double & time, V * result) {
134  Stype tmp = 0.0;
135  test::Timer t(time,"M*V ");
136  for (int l = 0; l < NLOOP; l++) {
137  for (int k = 0; k < NLIST; k++) {
138  result[k] = mat[k] * v[k];
139  }
140  tmp += SumOfElements(result[NLIST-1]);
141  }
142  gResultSum += tmp;
143 }
144 
145 // general matrix vector op
146 template<class M, class V>
147 void testGMV(const M * mat, const V * v1, const V *v2, double & time, V * result) {
148  Stype tmp = 0.0;
149  test::Timer t(time,"M*V+");
150  for (int l = 0; l < NLOOP; l++) {
151  for (int k = 0; k < NLIST; k++) {
152  result[k] = mat[k] * v1[k] + v2[k];
153  }
154  tmp += SumOfElements(result[NLIST-1]);
155  }
156  gResultSum += tmp;
157 }
158 
159 
160 // general matrix matrix op
161 template<class A, class B, class C>
162 void testMM(const A * a, const B * b, const C * c, double & time, C * result) {
163  Stype tmp = 0.0;
164  test::Timer t(time,"M*M ");
165  for (int l = 0; l < NLOOP; l++) {
166  for (int k = 0; k < NLIST; k++) {
167  result[k] = a[k] * b[k] + c[k];
168  }
169  tmp += SumOfElements(result[NLIST-1]);
170  }
171  gResultSum += tmp;
172 }
173 
174 
175 
176 // specialized functions (depending on the package)
177 
178 //smatrix
179 template<class V, class T>
180 void testDot_S(const V * v1, const V * v2, T * result, double & time) {
181  Stype tmp = 0.0;
182  test::Timer t(time,"dot ");
183  for (int l = 0; l < 10*NLOOP; l++) {
184  for (int k = 0; k < NLIST; k++) {
185  result[k] = Dot(v1[k],v2[k]);
186  }
187  tmp += result[NLIST-1];
188  }
189  gResultSum += tmp;
190 }
191 
192 
193 // double testDot_S(const std::vector<V*> & w1, const std::vector<V*> & w2, double & time) {
194 // test::Timer t(time,"dot ");
195 // double result=0;
196 // for (int l = 0; l < NLOOP; l++)
197 // {
198 // V & v1 = *w1[l];
199 // V & v2 = *w2[l];
200 // result = Dot(v1,v2);
201 // }
202 // return result;
203 // }
204 
205 template<class M, class V, class T>
206 void testInnerProd_S(const M * a, const V * v, T * result, double & time) {
207  Stype tmp = 0.0;
208  test::Timer t(time,"prod");
209  for (int l = 0; l < 10*NLOOP; l++) {
210  for (int k = 0; k < NLIST; k++) {
211  result[k] = Similarity(v[k],a[k]);
212  }
213  tmp += result[NLIST-1];
214  }
215  gResultSum += tmp;
216 }
217 
218 //inversion
219 template<class M>
220 void testInv_S( const M * m, double & time, M * result){
221  Stype tmp = 0.0;
222  test::Timer t(time,"inv ");
223  int ierr = 0;
224  int ifail = 0;
225  for (int l = 0; l < NLOOP; l++) {
226  for (int k = 0; k < NLIST; k++) {
227  result[k] = m[k].Inverse(ifail);
228  ierr += ifail;
229  //result = mtmp.Inverse(ifail);
230  // assert(ifail == 0);
231  }
232  tmp += SumOfElements(result[NLIST-1]);
233  }
234  gResultSum += tmp;
235  assert(ierr == 0);
236 }
237 
238 template<class M>
239 void testInvFast_S( const M * m, double & time, M * result){
240  Stype tmp = 0.0;
241  test::Timer t(time,"invF");
242  int ierr = 0;
243  int ifail = 0;
244  for (int l = 0; l < NLOOP; l++) {
245  for (int k = 0; k < NLIST; k++) {
246  result[k] = m[k].InverseFast(ifail);
247  ierr += ifail;
248  //result = mtmp.Inverse(ifail);
249  // assert(ifail == 0);
250  }
251  tmp += SumOfElements(result[NLIST-1]);
252  }
253  gResultSum += tmp;
254  assert(ierr == 0);
255 }
256 
257 template<class M>
258 void testInvChol_S( const M * m, double & time, M * result){
259  Stype tmp = 0.0;
260  test::Timer t(time,"invC");
261  int ierr = 0;
262  int ifail = 0;
263  for (int l = 0; l < NLOOP; l++) {
264  for (int k = 0; k < NLIST; k++) {
265  result[k] = m[k].InverseChol(ifail);
266  ierr += ifail;
267  //result = mtmp.Inverse(ifail);
268  // assert(ifail == 0);
269  }
270  tmp += SumOfElements(result[NLIST-1]);
271  }
272  gResultSum += tmp;
273  assert(ierr == 0);
274 }
275 
276 
277 // general matrix matrix op
278 template<class A, class B, class C>
279 void testATBA_S(const A * a, const B * b, double & time, C * result) {
280  Stype tmp = 0.0;
281  test::Timer t(time,"At*M*A");
282  for (int l = 0; l < NLOOP; l++) {
283  for (int k = 0; k < NLIST; k++) {
284  C tmp = b[k] * Transpose(a[k]);
285  result[k] = a[k] * tmp;
286  }
287  tmp += SumOfElements(result[NLIST-1]);
288  }
289  gResultSum += tmp;
290 }
291 
292 // general matrix matrix op
293 template<class A, class B, class C>
294 void testATBA_S2(const A * a, const B * b, double & time, C * result) {
295  Stype tmp = 0.0;
296  test::Timer t(time,"At*M*A");
297  for (int l = 0; l < NLOOP; l++) {
298  for (int k = 0; k < NLIST; k++) {
299  //result = Transpose(a) * b * a;
300  //result = a * b * Transpose(a);
301  //result = a * b * a;
302  result[k] = SimilarityT(a[k],b[k]);
303  //result = a * result;
304  }
305  tmp += SumOfElements(result[NLIST-1]);
306  }
307  gResultSum += tmp;
308 }
309 
310 template<class A, class C>
311 void testMT_S(const A * a, double & time, C * result) {
312  Stype tmp = 0.0;
313  test::Timer t(time,"Transp");
314  for (int l = 0; l < NLOOP; l++) {
315  for (int k = 0; k < NLIST; k++) {
316  //result = Transpose(a) * b * a;
317  //result = a * b * Transpose(a);
318  //result = a * b * a;
319  result[k] = Transpose(a[k]);
320  }
321  tmp += SumOfElements(result[NLIST-1]);
322  }
323  gResultSum += tmp;
324 }
325 
326 /////////////////////////////////////
327 // for root
328 //////////////////////////////////
329 
330 // simple Matrix vector op
331 template<class M, class V>
332 void testMV_T(const M & mat, const V & v, double & time, V & result) {
333  V vtmp = v;
334  test::Timer t(time,"M*V ");
335  for (int l = 0; l < NLOOP; l++)
336  {
337  vtmp[0] = gV[l];
338  Add(result,0.0,mat,vtmp);
339  }
340 }
341 
342 // general matrix vector op
343 template<class M, class V>
344 void testGMV_T(const M & mat, const V & v1, const V & v2, double & time, V & result) {
345  V vtmp = v1;
346  test::Timer t(time,"M*V+");
347  for (int l = 0; l < NLOOP; l++)
348  {
349  vtmp[0] = gV[l];
350  memcpy(result.GetMatrixArray(),v2.GetMatrixArray(),v2.GetNoElements()*sizeof(Double_t));
351  Add(result,1.0,mat,vtmp);
352  }
353 }
354 
355 // general matrix matrix op
356 template<class A, class B, class C>
357 void testMM_T(const A & a, const B & b, const C & c, double & time, C & result) {
358  B btmp = b;
359  test::Timer t(time,"M*M ");
360  for (int l = 0; l < NLOOP; l++)
361  {
362  btmp(0,0) = gV[l];
363  result.Mult(a,btmp);
364  result += c;
365  }
366 }
367 
368 // matrix sum
369 template<class M>
370 void testMad_T(const M & m1, const M & m2, double & time, M & result) {
371  M mtmp = m2;
372  test::Timer t(time,"M+M ");
373  for (int l = 0; l < NLOOP; l++)
374  {
375  mtmp(0,0) = gV[l];
376  result.Plus(m1,mtmp);
377  }
378 }
379 
380 template<class A, class B, class C>
381 void testATBA_T(const A & a, const B & b, double & time, C & result) {
382  B btmp = b;
383  test::Timer t(time,"At*M*A");
384  C tmp = a;
385  for (int l = 0; l < NLOOP; l++)
386  {
387  btmp(0,0) = gV[l];
388  tmp.Mult(a,btmp);
389  result.MultT(tmp,a);
390  }
391 }
392 
393 template<class V>
394 double testDot_T(const V & v1, const V & v2, double & time) {
395  V vtmp = v2;
396  test::Timer t(time,"dot ");
397  double result=0;
398  for (int l = 0; l < 10*NLOOP; l++)
399  {
400  vtmp[0] = gV[l];
401  result = Dot(v1,vtmp);
402  }
403  return result;
404 }
405 
406 template<class M, class V>
407 double testInnerProd_T(const M & a, const V & v, double & time) {
408  V vtmp = v;
409  test::Timer t(time,"prod");
410  double result=0;
411  for (int l = 0; l < NLOOP; l++) {
412  vtmp[0] = gV[l];
413  result = a.Similarity(vtmp);
414  }
415  return result;
416 }
417 
418 //inversion
419 template<class M>
420 void testInv_T(const M & m, double & time, M& result){
421  M mtmp = m;
422  test::Timer t(time,"inv ");
423  for (int l = 0; l < NLOOP; l++)
424  {
425  mtmp(0,0) = gV[l];
426  memcpy(result.GetMatrixArray(),mtmp.GetMatrixArray(),mtmp.GetNoElements()*sizeof(Double_t));
427  result.InvertFast();
428  }
429 }
430 
431 template<class M>
432 void testInv_T2(const M & m, double & time, M& result){
433  M mtmp = m;
434  test::Timer t(time,"inv2");
435  for (int l = 0; l < NLOOP; l++)
436  {
437  memcpy(result.GetMatrixArray(),mtmp.GetMatrixArray(),mtmp.GetNoElements()*sizeof(Double_t));
438  result.InvertFast();
439  }
440 }
441 
442 
443 // vector sum
444 template<class V>
445 void testVad_T(const V & v1, const V & v2, double & time, V & result) {
446  V vtmp = v2;
447  test::Timer t(time,"V+V ");;
448  for (int l = 0; l < 10*NLOOP; l++)
449  {
450  vtmp[0] = gV[l];
451  result.Add(v1,vtmp);
452  }
453 }
454 
455 // vector * constant
456 template<class V>
457 void testVscale_T(const V & v1, double a, double & time, V & result) {
458  V vtmp = v1;
459  test::Timer t(time,"a*V ");;
460  for (int l = 0; l < NLOOP; l++)
461  {
462  // result = a * v1;
463  result.Zero();
464  vtmp[0] = gV[l];
465  Add(result,a,vtmp);
466  }
467 }
468 
469 // general matrix matrix op
470 template<class A, class B, class C>
471 void testATBA_T2(const A & a, const B & b, double & time, C & result) {
472  B btmp = b;
473  test::Timer t(time,"At*M*A");
474  for (int l = 0; l < NLOOP; l++)
475  {
476  btmp(0,0) = gV[l];
477  memcpy(result.GetMatrixArray(),btmp.GetMatrixArray(),btmp.GetNoElements()*sizeof(Double_t));
478  result.Similarity(a);
479  }
480 }
481 
482 // matrix * constant
483 template<class M>
484 void testMscale_T(const M & m1, double a, double & time, M & result) {
485  M mtmp = m1;
486  test::Timer t(time,"a*M ");;
487  for (int l = 0; l < NLOOP; l++)
488  {
489  //result = a * m1;
490  result.Zero();
491  mtmp(0,0) = gV[l];
492  Add(result,a,mtmp);
493  }
494 }
495 
496 template<class A, class C>
497 void testMT_T(const A & a, double & time, C & result) {
498  A atmp = a;
499  test::Timer t(time,"Transp");
500  for (int l = 0; l < NLOOP; l++)
501  {
502  atmp(0,0) = gV[l];
503  result.Transpose(atmp);
504  }
505 }
506 
507 ////////////////////////////////////////////
508 // for clhep
509 ////////////////////////////////////////////
510 
511 //smatrix
512 template<class V>
513 double testDot_C(const V & v1, const V & v2, double & time) {
514  V vtmp = v2;
515  test::Timer t(time,"dot ");
516  double result=0;
517  for (int l = 0; l < 10*NLOOP; l++)
518  {
519  vtmp[0] = gV[l];
520  result = dot(v1,vtmp);
521  }
522  return result;
523 }
524 
525 template<class M, class V>
526 double testInnerProd_C(const M & a, const V & v, double & time) {
527  V vtmp = v;
528  test::Timer t(time,"prod");
529  double result=0;
530  for (int l = 0; l < NLOOP; l++)
531  {
532  vtmp[0] = gV[l];
533  V tmp = a*vtmp;
534  result = dot(vtmp,tmp);
535  }
536  return result;
537 }
538 
539 
540 // matrix assignmnent(index starts from 1)
541 template<class M>
542 void testMeq_C(const M & m, double & time, M & result) {
543  M mtmp = m;
544  test::Timer t(time,"M=M ");
545  for (int l = 0; l < NLOOP; l++)
546  {
547  mtmp(1,1) = gV[l];
548  result = mtmp;
549  }
550 }
551 
552 // matrix sum
553 template<class M>
554 void testMad_C(const M & m1, const M & m2, double & time, M & result) {
555  M mtmp = m2;
556  test::Timer t(time,"M+M ");;
557  for (int l = 0; l < NLOOP; l++)
558  {
559  mtmp(1,1) = gV[l];
560  result = m1; result += mtmp;
561  }
562 }
563 
564 
565 // matrix * constant
566 template<class M>
567 void testMscale_C(const M & m1, double a, double & time, M & result) {
568  M mtmp = m1;
569  test::Timer t(time,"a*M ");;
570  for (int l = 0; l < NLOOP; l++)
571  {
572  mtmp(1,1) = gV[l];
573  result = mtmp * a;
574  }
575 }
576 
577 
578 // clhep matrix matrix op (index starts from 1)
579 template<class A, class B, class C>
580 void testMM_C(const A & a, const B & b, const C & c, double & time, C & result) {
581  B btmp = b;
582  test::Timer t(time,"M*M ");
583  for (int l = 0; l < NLOOP; l++)
584  {
585  btmp(1,1) = gV[l];
586  result = a * btmp + c;
587  }
588 }
589 
590 
591 //inversion
592 template<class M>
593 void testInv_C( const M & a, double & time, M& result){
594  M mtmp = a;
595  test::Timer t(time,"inv ");
596  int ifail = 0;
597  for (int l = 0; l < NLOOP; l++)
598  {
599  mtmp(1,1) = gV[l];
600  result = mtmp.inverse(ifail);
601  if (ifail) {std::cout <<"error inverting" << mtmp << std::endl; return; }
602  }
603 }
604 
605 // general matrix matrix op
606 template<class A, class B, class C>
607 void testATBA_C(const A & a, const B & b, double & time, C & result) {
608  B btmp = b;
609  test::Timer t(time,"At*M*A");
610  for (int l = 0; l < NLOOP; l++)
611  {
612  btmp(1,1) = gV[l];
613  //result = a.T() * b * a;
614  result = a * btmp * a.T();
615  }
616 }
617 
618 
619 template<class A, class B, class C>
620 void testATBA_C2(const A & a, const B & b, double & time, C & result) {
621  B btmp = b;
622  test::Timer t(time,"At*M*A");
623  for (int l = 0; l < NLOOP; l++)
624  {
625  btmp(1,1) = gV[l];
626  result = btmp.similarity(a);
627  }
628 }
629 
630 
631 template<class A, class C>
632 void testMT_C(const A & a, double & time, C & result) {
633  A atmp = a;
634  test::Timer t(time,"Transp");
635  for (int l = 0; l < NLOOP; l++)
636  {
637  atmp(1,1) = gV[l];
638  result = atmp.T();
639  }
640 }
641 
642 
643 #endif
T Dot(const SVector< T, D > &lhs, const SVector< T, D > &rhs)
Vector dot product.
Definition: Functions.h:166
T Similarity(const SMatrix< T, D, D, R > &lhs, const SVector< T, D > &rhs)
Similarity Vector - Matrix Product: v^T * A * v returning a scalar value of type T ...
void testVscale_T(const V &v1, double a, double &time, V &result)
static double B[]
void testATBA_S2(const A *a, const B *b, double &time, C *result)
Random number generator class based on M.
Definition: TRandom3.h:29
void Add(THist< DIMENSION, PRECISIONA > &to, THist< DIMENSION, PRECISIONB > &from)
Definition: THist.h:335
const Double_t * v1
Definition: TArcBall.cxx:33
double Stype
Definition: testKalman.cxx:77
void testMT_T(const A &a, double &time, C &result)
double testDot_C(const V &v1, const V &v2, double &time)
double T(double x)
Definition: ChebyshevPol.h:34
#define assert(cond)
Definition: unittest.h:542
void testATBA_T2(const A &a, const B &b, double &time, C &result)
void testMT_S(const A *a, double &time, C *result)
Expr< TransposeOp< SMatrix< T, D1, D2, R >, T, D1, D2 >, T, D2, D1, typename TranspPolicy< T, D1, D2, R >::RepType > Transpose(const SMatrix< T, D1, D2, R > &rhs)
Matrix Transpose B(i,j) = A(j,i) returning a matrix expression.
V::value_type SumOfElements(const V &v)
Definition: matrix_op_vec.h:32
TArc * a
Definition: textangle.C:12
void testGMV(const M *mat, const V *v1, const V *v2, double &time, V *result)
void testVeq(const V *v, double &time, V *result)
Definition: matrix_op_vec.h:44
void testVscale(const V *v, T a, double &time, V *result)
void testDot_S(const V *v1, const V *v2, T *result, double &time)
Stype gResultSum
static double A[]
void testMad(const M *m1, const M *m2, double &time, M *result)
Definition: matrix_op_vec.h:88
void testMM_T(const A &a, const B &b, const C &c, double &time, C &result)
Double_t dot(const TVector2 &v1, const TVector2 &v2)
Definition: CsgOps.cxx:333
void testInv_T2(const M &m, double &time, M &result)
void testMV(const M *mat, const V *v, double &time, V *result)
#define NLOOP
Definition: piRandom.C:21
void testInv_C(const M &a, double &time, M &result)
virtual Double_t Rndm(Int_t i=0)
Machine independent random number generator.
Definition: TRandom3.cxx:93
void testMscale_C(const M &m1, double a, double &time, M &result)
void testMT_C(const A &a, double &time, C &result)
void testATBA_S(const A *a, const B *b, double &time, C *result)
void testGMV_T(const M &mat, const V &v1, const V &v2, double &time, V &result)
RooCmdArg Timer(Bool_t flag=kTRUE)
static double C[]
void testInnerProd_S(const M *a, const V *v, T *result, double &time)
ROOT::R::TRInterface & r
Definition: Object.C:4
SVector< double, 2 > v
Definition: Dict.h:5
void testATBA_C2(const A &a, const B &b, double &time, C &result)
void testVad(const V *v1, const V *v2, double &time, V *result)
Definition: matrix_op_vec.h:74
double testDot_T(const V &v1, const V &v2, double &time)
TMarker * m
Definition: textangle.C:8
std::vector< float > gV
Definition: matrix_op_vec.h:16
TLine * l
Definition: textangle.C:4
void testMeq(const M *m, double &time, M *result)
Definition: matrix_op_vec.h:58
void testATBA_T(const A &a, const B &b, double &time, C &result)
void testMscale_T(const M &m1, double a, double &time, M &result)
const int NLIST
Definition: testKalman.cxx:83
void testATBA_C(const A &a, const B &b, double &time, C &result)
void testMV_T(const M &mat, const V &v, double &time, V &result)
double Double_t
Definition: RtypesCore.h:55
void testInv_T(const M &m, double &time, M &result)
void testInvChol_S(const M *m, double &time, M *result)
double testInnerProd_T(const M &a, const V &v, double &time)
void testMeq_C(const M &m, double &time, M &result)
void testInvFast_S(const M *m, double &time, M *result)
void testMad_T(const M &m1, const M &m2, double &time, M &result)
void testMM_C(const A &a, const B &b, const C &c, double &time, C &result)
void testMM(const A *a, const B *b, const C *c, double &time, C *result)
void testVad_T(const V &v1, const V &v2, double &time, V &result)
double testInnerProd_C(const M &a, const V &v, double &time)
SMatrix< T, D2, D2, MatRepSym< T, D2 > > SimilarityT(const SMatrix< T, D1, D2, R > &lhs, const SMatrix< T, D1, D1, MatRepSym< T, D1 > > &rhs)
Transpose Similarity Matrix Product : B = U^T * A * U for A symmetric returning a symmetric matrix ex...
double result[121]
void testInv_S(const M *m, double &time, M *result)
void testMscale(const M *m1, T a, double &time, M *result)
void testMad_C(const M &m1, const M &m2, double &time, M &result)
void initValues()
Definition: matrix_op_vec.h:18