timings-eigen.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2016 CNRS
3 //
4 
5 #include <iostream>
7 #include <Eigen/Dense>
8 #include <Eigen/Geometry>
9 #include <Eigen/StdVector>
10 
11 using namespace Eigen;
12 
13 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Quaternion<double>)
14 
15 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 1, 1, RowMajor>)
16 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 2, 2, RowMajor>)
17 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 3, 3, RowMajor>)
18 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 4, 4, RowMajor>)
19 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 5, 5, RowMajor>)
20 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 6, 6, RowMajor>)
21 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 7, 7, RowMajor>)
22 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 8, 8, RowMajor>)
23 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 9, 9, RowMajor>)
24 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 50, 50, RowMajor>)
25 
26 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 1, 1, ColMajor>)
27 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 2, 2, ColMajor>)
28 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 3, 3, ColMajor>)
29 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 4, 4, ColMajor>)
30 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 5, 5, ColMajor>)
31 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 6, 6, ColMajor>)
32 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 7, 7, ColMajor>)
33 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 8, 8, ColMajor>)
34 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 9, 9, ColMajor>)
35 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 50, 50, ColMajor>)
36 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 2, 1>)
37 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 3, 1>)
38 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 4, 1>)
39 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 5, 1>)
40 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 6, 1>)
41 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 7, 1>)
42 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 8, 1>)
43 EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Matrix<double, 9, 1>)
44 
45 template<int NBT>
46 void checkQuaternionToMatrix(std::string label)
47 {
48 
49  using namespace Eigen;
50 
52 
53  /* Random pre-initialization of all matrices in the stack. */
54  std::vector<Quaterniond> q1s(NBT);
55  std::vector<Matrix3d> R3s(NBT);
56  for (size_t i = 0; i < NBT; ++i)
57  {
58  q1s[i] = Quaterniond(Vector4d::Random()).normalized();
59  R3s[i] = Matrix3d::Random();
60  }
61 
62  /* Timed product. */
63  timer.tic();
64  SMOOTH(NBT)
65  {
66  R3s[_smooth] = q1s[_smooth].toRotationMatrix();
67  }
68 
69  std::cout << label << " = \t\t";
70  timer.toc(std::cout, NBT);
71 }
72 
73 template<int NBT>
74 void checkQuaternion(std::string label)
75 {
76 
77  using namespace Eigen;
78 
80 
81  /* Random pre-initialization of all matrices in the stack. */
82  std::vector<Quaterniond> q1s(NBT);
83  std::vector<Vector3d> v2s(NBT);
84  std::vector<Vector3d> v3s(NBT);
85  for (size_t i = 0; i < NBT; ++i)
86  {
87  q1s[i] = Quaterniond(Vector4d::Random()).normalized();
88  v2s[i] = Vector3d::Random();
89  v3s[i] = Vector3d::Random();
90  }
91 
92  /* Timed product. */
93  timer.tic();
94  SMOOTH(NBT)
95  {
96  v3s[_smooth] = q1s[_smooth] * v2s[_smooth];
97  }
98 
99  std::cout << label << " = \t\t";
100  timer.toc(std::cout, NBT);
101 }
102 
103 template<int NBT>
104 void checkQuaternionQuaternion(std::string label)
105 {
106 
107  using namespace Eigen;
108 
110 
111  /* Random pre-initialization of all matrices in the stack. */
112  std::vector<Quaterniond> q1s(NBT);
113  std::vector<Quaterniond> q2s(NBT);
114  std::vector<Quaterniond> q3s(NBT);
115  for (size_t i = 0; i < NBT; ++i)
116  {
117  q1s[i] = Quaterniond(Vector4d::Random()).normalized();
118  q2s[i] = Quaterniond(Vector4d::Random()).normalized();
119  q3s[i] = Quaterniond(Vector4d::Random()).normalized();
120  }
121 
122  /* Timed product. */
123  timer.tic();
124  SMOOTH(NBT)
125  {
126  q3s[_smooth] = q1s[_smooth] * q2s[_smooth];
127  }
128 
129  std::cout << label << " = \t\t";
130  timer.toc(std::cout, NBT);
131 }
132 
133 template<int NBT>
134 void checkQuaternionD(std::string label)
135 {
136 
137  using namespace Eigen;
138 
140 
141  /* Random pre-initialization of all matrices in the stack. */
142  std::vector<Quaterniond> q1s(NBT);
143  std::vector<VectorXd> v2s(NBT);
144  std::vector<VectorXd> v3s(NBT);
145  for (size_t i = 0; i < NBT; ++i)
146  {
147  q1s[i] = Quaterniond(Vector4d::Random()).normalized();
148  v2s[i] = VectorXd::Random(3);
149  v3s[i] = VectorXd::Random(3);
150  }
151 
152  /* Timed product. */
153  timer.tic();
154  SMOOTH(NBT)
155  {
156  v3s[_smooth] = q1s[_smooth] * v2s[_smooth];
157  }
158 
159  std::cout << label << " = \t\t";
160  timer.toc(std::cout, NBT);
161 }
162 
163 // M1*M2 = M3
164 template<int MSIZE, int NBT, int OptionM1, int OptionM2, int OptionM3>
165 void checkMatrix(std::string label)
166 {
167  using namespace Eigen;
168 
170 
171  /* Random pre-initialization of all matrices in the stack. */
172  std::vector<Matrix<double, MSIZE, MSIZE, OptionM1>> R1s(NBT);
173  std::vector<Matrix<double, MSIZE, MSIZE, OptionM2>> R2s(NBT);
174  std::vector<Matrix<double, MSIZE, MSIZE, OptionM3>> R3s(NBT);
175  for (size_t i = 0; i < NBT; ++i)
176  {
177  R1s[i] = Matrix<double, MSIZE, MSIZE, OptionM1>::Random();
178  R2s[i] = Matrix<double, MSIZE, MSIZE, OptionM2>::Random();
179  R3s[i] = Matrix<double, MSIZE, MSIZE, OptionM3>::Random();
180  }
181 
182  /* Timed product. */
183  timer.tic();
184  SMOOTH(NBT)
185  {
186  R3s[_smooth].noalias() = R1s[_smooth] * R2s[_smooth];
187  }
188 
189  std::cout << label << " = \t\t";
190  timer.toc(std::cout, NBT);
191 }
192 
193 // M1.T*M2 = M3
194 template<int MSIZE, int NBT, int OptionM1, int OptionM2, int OptionM3>
195 void checkMatrixTMatrix(std::string label)
196 {
197  using namespace Eigen;
198 
200 
201  /* Random pre-initialization of all matrices in the stack. */
202  std::vector<Matrix<double, MSIZE, MSIZE, OptionM1>> R1s(NBT);
203  std::vector<Matrix<double, MSIZE, MSIZE, OptionM2>> R2s(NBT);
204  std::vector<Matrix<double, MSIZE, MSIZE, OptionM3>> R3s(NBT);
205  for (size_t i = 0; i < NBT; ++i)
206  {
207  R1s[i] = Matrix<double, MSIZE, MSIZE, OptionM1>::Random();
208  R2s[i] = Matrix<double, MSIZE, MSIZE, OptionM2>::Random();
209  R3s[i] = Matrix<double, MSIZE, MSIZE, OptionM3>::Random();
210  }
211 
212  /* Timed product. */
213  timer.tic();
214  SMOOTH(NBT)
215  {
216  R3s[_smooth].noalias() = R1s[_smooth].transpose() * R2s[_smooth];
217  }
218 
219  std::cout << label << " = \t\t";
220  timer.toc(std::cout, NBT);
221 }
222 
223 template<int MSIZE, int NBT>
224 void checkVector(std::string label)
225 {
226  using namespace Eigen;
227 
229  std::vector<Matrix<double, MSIZE, MSIZE>> R1s(NBT);
230  std::vector<Matrix<double, MSIZE, 1>> v2s(NBT);
231  std::vector<Matrix<double, MSIZE, 1>> v3s(NBT);
232  for (size_t i = 0; i < NBT; ++i)
233  {
234  R1s[i] = Matrix<double, MSIZE, MSIZE>::Random();
235  v2s[i] = Matrix<double, MSIZE, 1>::Random();
236  v3s[i] = Matrix<double, MSIZE, 1>::Random();
237  }
238 
239  timer.tic();
240  SMOOTH(NBT)
241  {
242  v3s[_smooth] = R1s[_smooth] * v2s[_smooth];
243  }
244 
245  std::cout << label << " = \t\t";
246  timer.toc(std::cout, NBT);
247 }
248 
249 template<int NBT, int OptionM1, int OptionM2, int OptionM3>
250 void checkDMatrix(int MSIZE, std::string label)
251 {
252  using namespace Eigen;
253 
255  std::vector<Matrix<double, Dynamic, Dynamic, OptionM1>> R1s(NBT);
256  std::vector<Matrix<double, Dynamic, Dynamic, OptionM2>> R2s(NBT);
257  std::vector<Matrix<double, Dynamic, Dynamic, OptionM3>> R3s(NBT);
258  for (size_t i = 0; i < NBT; ++i)
259  {
260  R1s[i] = Matrix<double, Dynamic, Dynamic, OptionM1>::Random(MSIZE, MSIZE);
261  R2s[i] = Matrix<double, Dynamic, Dynamic, OptionM2>::Random(MSIZE, MSIZE);
262  R3s[i] = Matrix<double, Dynamic, Dynamic, OptionM3>::Random(MSIZE, MSIZE);
263  }
264 
265  timer.tic();
266  SMOOTH(NBT)
267  {
268  R3s[_smooth].noalias() = R1s[_smooth] * R2s[_smooth];
269  }
270 
271  std::cout << label << " = \t\t";
272  timer.toc(std::cout, NBT);
273 }
274 
275 // M1.T*M2 = M3
276 template<int NBT, int OptionM1, int OptionM2, int OptionM3>
277 void checkDMatrixTMatrix(int MSIZE, std::string label)
278 {
279  using namespace Eigen;
280 
282  std::vector<Matrix<double, Dynamic, Dynamic, OptionM1>> R1s(NBT);
283  std::vector<Matrix<double, Dynamic, Dynamic, OptionM2>> R2s(NBT);
284  std::vector<Matrix<double, Dynamic, Dynamic, OptionM3>> R3s(NBT);
285  for (size_t i = 0; i < NBT; ++i)
286  {
287  R1s[i] = Matrix<double, Dynamic, Dynamic, OptionM1>::Random(MSIZE, MSIZE);
288  R2s[i] = Matrix<double, Dynamic, Dynamic, OptionM2>::Random(MSIZE, MSIZE);
289  R3s[i] = Matrix<double, Dynamic, Dynamic, OptionM3>::Random(MSIZE, MSIZE);
290  }
291 
292  timer.tic();
293  SMOOTH(NBT)
294  {
295  R3s[_smooth].noalias() = R1s[_smooth].transpose() * R2s[_smooth];
296  }
297 
298  std::cout << label << " = \t\t";
299  timer.toc(std::cout, NBT);
300 }
301 
302 template<int NBT>
303 void checkDVector(int MSIZE, std::string label)
304 {
305  using namespace Eigen;
306 
308  std::vector<MatrixXd> R1s(NBT);
309  std::vector<MatrixXd> v2s(NBT);
310  std::vector<MatrixXd> v3s(NBT);
311  for (size_t i = 0; i < NBT; ++i)
312  {
313  R1s[i] = MatrixXd::Random(MSIZE, MSIZE);
314  v2s[i] = MatrixXd::Random(MSIZE, 1);
315  v3s[i] = MatrixXd::Random(MSIZE, 1);
316  }
317 
318  timer.tic();
319  SMOOTH(NBT)
320  {
321  v3s[_smooth] = R1s[_smooth] * v2s[_smooth];
322  }
323 
324  std::cout << label << " = \t\t";
325  timer.toc(std::cout, NBT);
326 }
327 
328 int main()
329 {
330 
331 #ifdef NDEBUG
332  const int NBT = 1000 * 1000;
333 #else
334  const int NBT = 1;
335  std::cout << "(the time score in debug mode is not relevant) " << std::endl;
336 #endif
337  checkQuaternion<NBT>("quaternion-vector static ");
338  checkQuaternionD<NBT>("quaternion-vector dynamic");
339  checkQuaternionQuaternion<NBT>("quaternion-quaternion ");
340  checkQuaternionToMatrix<NBT>("quaternion->matrix static");
341  std::cout << std::endl;
342 
343  using namespace Eigen;
344  checkVector<3, NBT>("matrix-vector static 3x3");
345  checkDVector<NBT>(3, "matrix-vector dynamic 3x3");
346  checkMatrix<3, NBT, ColMajor, ColMajor, ColMajor>("colmatrix = colmatrix*colmatrix static 3x3");
347  checkMatrix<3, NBT, RowMajor, ColMajor, ColMajor>("colmatrix = rowmatrix*colmatrix static 3x3");
348  checkMatrix<3, NBT, ColMajor, RowMajor, ColMajor>("colmatrix = colmatrix*rowmatrix static 3x3");
349  checkMatrix<3, NBT, RowMajor, RowMajor, ColMajor>("colmatrix = rowmatrix*rowmatrix static 3x3");
350  checkMatrix<3, NBT, ColMajor, ColMajor, RowMajor>("rowmatrix = colmatrix*colmatrix static 3x3");
351  checkMatrix<3, NBT, RowMajor, ColMajor, RowMajor>("rowmatrix = rowmatrix*colmatrix static 3x3");
352  checkMatrix<3, NBT, ColMajor, RowMajor, RowMajor>("rowmatrix = colmatrix*rowmatrix static 3x3");
353  checkMatrix<3, NBT, RowMajor, RowMajor, RowMajor>("rowmatrix = rowmatrix*rowmatrix static 3x3");
354 
355  checkDMatrix<NBT, ColMajor, ColMajor, ColMajor>(
356  3, "colmatrix = colmatrix*colmatrix dynamic 3x3");
357  checkDMatrix<NBT, RowMajor, ColMajor, ColMajor>(
358  3, "colmatrix = rowmatrix*colmatrix dynamic 3x3");
359  checkDMatrix<NBT, ColMajor, RowMajor, ColMajor>(
360  3, "colmatrix = colmatrix*rowmatrix dynamic 3x3");
361  checkDMatrix<NBT, RowMajor, RowMajor, ColMajor>(
362  3, "colmatrix = rowmatrix*rowmatrix dynamic 3x3");
363  checkDMatrix<NBT, ColMajor, ColMajor, RowMajor>(
364  3, "rowmatrix = colmatrix*colmatrix dynamic 3x3");
365  checkDMatrix<NBT, RowMajor, ColMajor, RowMajor>(
366  3, "rowmatrix = rowmatrix*colmatrix dynamic 3x3");
367  checkDMatrix<NBT, ColMajor, RowMajor, RowMajor>(
368  3, "rowmatrix = colmatrix*rowmatrix dynamic 3x3");
369  checkDMatrix<NBT, RowMajor, RowMajor, RowMajor>(
370  3, "rowmatrix = rowmatrix*rowmatrix dynamic 3x3");
371 
372  std::cout << std::endl;
373 
374  checkVector<4, NBT>("matrix-vector static 4x4");
375  checkDVector<NBT>(4, "matrix-vector dynamic 4x4");
376 
377  checkMatrix<4, NBT, ColMajor, ColMajor, ColMajor>("colmatrix = colmatrix*colmatrix static 4x4");
378  checkMatrix<4, NBT, RowMajor, ColMajor, ColMajor>("colmatrix = rowmatrix*colmatrix static 4x4");
379  checkMatrix<4, NBT, ColMajor, RowMajor, ColMajor>("colmatrix = colmatrix*rowmatrix static 4x4");
380  checkMatrix<4, NBT, RowMajor, RowMajor, ColMajor>("colmatrix = rowmatrix*rowmatrix static 4x4");
381  checkMatrix<4, NBT, ColMajor, ColMajor, RowMajor>("rowmatrix = colmatrix*colmatrix static 4x4");
382  checkMatrix<4, NBT, RowMajor, ColMajor, RowMajor>("rowmatrix = rowmatrix*colmatrix static 4x4");
383  checkMatrix<4, NBT, ColMajor, RowMajor, RowMajor>("rowmatrix = colmatrix*rowmatrix static 4x4");
384  checkMatrix<4, NBT, RowMajor, RowMajor, RowMajor>("rowmatrix = rowmatrix*rowmatrix static 4x4");
385 
386  checkMatrixTMatrix<4, NBT, ColMajor, ColMajor, ColMajor>(
387  "colmatrix = colmatrix.transpose()*colmatrix static 4x4");
388  checkMatrixTMatrix<4, NBT, RowMajor, ColMajor, ColMajor>(
389  "colmatrix = rowmatrix.transpose()*colmatrix static 4x4");
390  checkMatrixTMatrix<4, NBT, ColMajor, RowMajor, ColMajor>(
391  "colmatrix = colmatrix.transpose()*rowmatrix static 4x4");
392  checkMatrixTMatrix<4, NBT, RowMajor, RowMajor, ColMajor>(
393  "colmatrix = rowmatrix.transpose()*rowmatrix static 4x4");
394  checkMatrixTMatrix<4, NBT, ColMajor, ColMajor, RowMajor>(
395  "rowmatrix = colmatrix.transpose()*colmatrix static 4x4");
396  checkMatrixTMatrix<4, NBT, RowMajor, ColMajor, RowMajor>(
397  "rowmatrix = rowmatrix.transpose()*colmatrix static 4x4");
398  checkMatrixTMatrix<4, NBT, ColMajor, RowMajor, RowMajor>(
399  "rowmatrix = colmatrix.transpose()*rowmatrix static 4x4");
400  checkMatrixTMatrix<4, NBT, RowMajor, RowMajor, RowMajor>(
401  "rowmatrix = rowmatrix.transpose()*rowmatrix static 4x4");
402 
403  checkDMatrix<NBT, ColMajor, ColMajor, ColMajor>(
404  4, "colmatrix = colmatrix*colmatrix dynamic 4x4");
405  checkDMatrix<NBT, RowMajor, ColMajor, ColMajor>(
406  4, "colmatrix = rowmatrix*colmatrix dynamic 4x4");
407  checkDMatrix<NBT, ColMajor, RowMajor, ColMajor>(
408  4, "colmatrix = colmatrix*rowmatrix dynamic 4x4");
409  checkDMatrix<NBT, RowMajor, RowMajor, ColMajor>(
410  4, "colmatrix = rowmatrix*rowmatrix dynamic 4x4");
411  checkDMatrix<NBT, ColMajor, ColMajor, RowMajor>(
412  4, "rowmatrix = colmatrix*colmatrix dynamic 4x4");
413  checkDMatrix<NBT, RowMajor, ColMajor, RowMajor>(
414  4, "rowmatrix = rowmatrix*colmatrix dynamic 4x4");
415  checkDMatrix<NBT, ColMajor, RowMajor, RowMajor>(
416  4, "rowmatrix = colmatrix*rowmatrix dynamic 4x4");
417  checkDMatrix<NBT, RowMajor, RowMajor, RowMajor>(
418  4, "rowmatrix = rowmatrix*rowmatrix dynamic 4x4");
419 
420  checkDMatrixTMatrix<NBT, ColMajor, ColMajor, ColMajor>(
421  4, "colmatrix = colmatrix.transpose()*colmatrix dynamic 4x4");
422  checkDMatrixTMatrix<NBT, RowMajor, ColMajor, ColMajor>(
423  4, "colmatrix = rowmatrix.transpose()*colmatrix dynamic 4x4");
424  checkDMatrixTMatrix<NBT, ColMajor, RowMajor, ColMajor>(
425  4, "colmatrix = colmatrix.transpose()*rowmatrix dynamic 4x4");
426  checkDMatrixTMatrix<NBT, RowMajor, RowMajor, ColMajor>(
427  4, "colmatrix = rowmatrix.transpose()*rowmatrix dynamic 4x4");
428  checkDMatrixTMatrix<NBT, ColMajor, ColMajor, RowMajor>(
429  4, "rowmatrix = colmatrix.transpose()*colmatrix dynamic 4x4");
430  checkDMatrixTMatrix<NBT, RowMajor, ColMajor, RowMajor>(
431  4, "rowmatrix = rowmatrix.transpose()*colmatrix dynamic 4x4");
432  checkDMatrixTMatrix<NBT, ColMajor, RowMajor, RowMajor>(
433  4, "rowmatrix = colmatrix.transpose()*rowmatrix dynamic 4x4");
434  checkDMatrixTMatrix<NBT, RowMajor, RowMajor, RowMajor>(
435  4, "rowmatrix = rowmatrix.transpose()*rowmatrix dynamic 4x4");
436 
437  checkMatrix<50, NBT / 10, ColMajor, ColMajor, ColMajor>(
438  "colmatrix = colmatrix*colmatrix static 50x50");
439  checkMatrix<50, NBT / 10, RowMajor, ColMajor, ColMajor>(
440  "colmatrix = rowmatrix*colmatrix static 50x50");
441  checkMatrix<50, NBT / 10, ColMajor, RowMajor, ColMajor>(
442  "colmatrix = colmatrix*rowmatrix static 50x50");
443  checkMatrix<50, NBT / 10, RowMajor, RowMajor, ColMajor>(
444  "colmatrix = rowmatrix*rowmatrix static 50x50");
445  checkMatrix<50, NBT / 10, ColMajor, ColMajor, RowMajor>(
446  "rowmatrix = colmatrix*colmatrix static 50x50");
447  checkMatrix<50, NBT / 10, RowMajor, ColMajor, RowMajor>(
448  "rowmatrix = rowmatrix*colmatrix static 50x50");
449  checkMatrix<50, NBT / 10, ColMajor, RowMajor, RowMajor>(
450  "rowmatrix = colmatrix*rowmatrix static 50x50");
451  checkMatrix<50, NBT / 10, RowMajor, RowMajor, RowMajor>(
452  "rowmatrix = rowmatrix*rowmatrix static 50x50");
453 
454  checkMatrixTMatrix<50, NBT / 10, ColMajor, ColMajor, ColMajor>(
455  "colmatrix = colmatrix.transpose()*colmatrix static 50x50");
456  checkMatrixTMatrix<50, NBT / 10, RowMajor, ColMajor, ColMajor>(
457  "colmatrix = rowmatrix.transpose()*colmatrix static 50x50");
458  checkMatrixTMatrix<50, NBT / 10, ColMajor, RowMajor, ColMajor>(
459  "colmatrix = colmatrix.transpose()*rowmatrix static 50x50");
460  checkMatrixTMatrix<50, NBT / 10, RowMajor, RowMajor, ColMajor>(
461  "colmatrix = rowmatrix.transpose()*rowmatrix static 50x50");
462  checkMatrixTMatrix<50, NBT / 10, ColMajor, ColMajor, RowMajor>(
463  "rowmatrix = colmatrix.transpose()*colmatrix static 50x50");
464  checkMatrixTMatrix<50, NBT / 10, RowMajor, ColMajor, RowMajor>(
465  "rowmatrix = rowmatrix.transpose()*colmatrix static 50x50");
466  checkMatrixTMatrix<50, NBT / 10, ColMajor, RowMajor, RowMajor>(
467  "rowmatrix = colmatrix.transpose()*rowmatrix static 50x50");
468  checkMatrixTMatrix<50, NBT / 10, RowMajor, RowMajor, RowMajor>(
469  "rowmatrix = rowmatrix.transpose()*rowmatrix static 50x50");
470 
471  checkDMatrix<NBT / 10, ColMajor, ColMajor, ColMajor>(
472  50, "colmatrix = colmatrix*colmatrix dynamic 50x50");
473  checkDMatrix<NBT / 10, RowMajor, ColMajor, ColMajor>(
474  50, "colmatrix = rowmatrix*colmatrix dynamic 50x50");
475  checkDMatrix<NBT / 10, ColMajor, RowMajor, ColMajor>(
476  50, "colmatrix = colmatrix*rowmatrix dynamic 50x50");
477  checkDMatrix<NBT / 10, RowMajor, RowMajor, ColMajor>(
478  50, "colmatrix = rowmatrix*rowmatrix dynamic 50x50");
479  checkDMatrix<NBT / 10, ColMajor, ColMajor, RowMajor>(
480  50, "rowmatrix = colmatrix*colmatrix dynamic 50x50");
481  checkDMatrix<NBT / 10, RowMajor, ColMajor, RowMajor>(
482  50, "rowmatrix = rowmatrix*colmatrix dynamic 50x50");
483  checkDMatrix<NBT / 10, ColMajor, RowMajor, RowMajor>(
484  50, "rowmatrix = colmatrix*rowmatrix dynamic 50x50");
485  checkDMatrix<NBT / 10, RowMajor, RowMajor, RowMajor>(
486  50, "rowmatrix = rowmatrix*rowmatrix dynamic 50x50");
487 
488  checkDMatrixTMatrix<NBT / 10, ColMajor, ColMajor, ColMajor>(
489  50, "colmatrix = colmatrix.transpose()*colmatrix dynamic 50x50");
490  checkDMatrixTMatrix<NBT / 10, RowMajor, ColMajor, ColMajor>(
491  50, "colmatrix = rowmatrix.transpose()*colmatrix dynamic 50x50");
492  checkDMatrixTMatrix<NBT / 10, ColMajor, RowMajor, ColMajor>(
493  50, "colmatrix = colmatrix.transpose()*rowmatrix dynamic 50x50");
494  checkDMatrixTMatrix<NBT / 10, RowMajor, RowMajor, ColMajor>(
495  50, "colmatrix = rowmatrix.transpose()*rowmatrix dynamic 50x50");
496  checkDMatrixTMatrix<NBT / 10, ColMajor, ColMajor, RowMajor>(
497  50, "rowmatrix = colmatrix.transpose()*colmatrix dynamic 50x50");
498  checkDMatrixTMatrix<NBT / 10, RowMajor, ColMajor, RowMajor>(
499  50, "rowmatrix = rowmatrix.transpose()*colmatrix dynamic 50x50");
500  checkDMatrixTMatrix<NBT / 10, ColMajor, RowMajor, RowMajor>(
501  50, "rowmatrix = colmatrix.transpose()*rowmatrix dynamic 50x50");
502  checkDMatrixTMatrix<NBT / 10, RowMajor, RowMajor, RowMajor>(
503  50, "rowmatrix = rowmatrix.transpose()*rowmatrix dynamic 50x50");
504 
505  std::cout << std::endl;
506 
507  std::cout << "--" << std::endl;
508  return 0;
509 }
checkVector
void checkVector(std::string label)
Definition: timings-eigen.cpp:224
PinocchioTicToc::toc
double toc()
Definition: timer.hpp:88
Eigen
checkMatrixTMatrix
void checkMatrixTMatrix(std::string label)
Definition: timings-eigen.cpp:195
inverse-kinematics.i
int i
Definition: inverse-kinematics.py:20
checkDMatrixTMatrix
void checkDMatrixTMatrix(int MSIZE, std::string label)
Definition: timings-eigen.cpp:277
timer.hpp
checkQuaternion
void checkQuaternion(std::string label)
Definition: timings-eigen.cpp:74
checkQuaternionQuaternion
void checkQuaternionQuaternion(std::string label)
Definition: timings-eigen.cpp:104
SMOOTH
#define SMOOTH(s)
Definition: timer.hpp:38
checkQuaternionToMatrix
void checkQuaternionToMatrix(std::string label)
Definition: timings-eigen.cpp:46
checkDVector
void checkDVector(int MSIZE, std::string label)
Definition: timings-eigen.cpp:303
checkQuaternionD
void checkQuaternionD(std::string label)
Definition: timings-eigen.cpp:134
PinocchioTicToc::NS
@ NS
Definition: timer.hpp:54
main
int main()
Definition: timings-eigen.cpp:328
checkDMatrix
void checkDMatrix(int MSIZE, std::string label)
Definition: timings-eigen.cpp:250
label
label
PinocchioTicToc
Definition: timer.hpp:47
checkMatrix
void checkMatrix(std::string label)
Definition: timings-eigen.cpp:165
PinocchioTicToc::tic
void tic()
Definition: timer.hpp:82


pinocchio
Author(s):
autogenerated on Sat Jun 1 2024 02:40:38