test_eigen2.cxx
Go to the documentation of this file.
1 #include "WireCellUtil/Testing.h"
2 #include "WireCellUtil/ExecMon.h"
3 
4 #include <Eigen/Core>
5 #include <iostream>
6 
7 using namespace std;
8 using namespace Eigen;
10 
12 {
13  em("mba: start");
14  Matrix3f mat1, mat2, mat3, mat4, mat5;
15  mat1 << 1, 2, 3, 4, 5, 6, 7, 8, 9;
16  mat2 << 1, 1, 1, 1, 1, 1, 1, 1, 1;
17  mat3 = mat1.array() + mat2.array();
18  mat4 = mat1 * mat2;
19  // mat5 = mat1 * mat2.array(); compilation error, can't mix!
20 
21  cerr << "mat1:\n" << mat1 << endl;
22  cerr << "mat2:\n" << mat2 << endl;
23  cerr << "mat3:\n" << mat3 << endl;
24  cerr << "mat4:\n" << mat4 << endl;
25 }
26 
27 int main()
28 {
29  ExecMon em;
31 
32  cerr << em.summary() << endl;
33 
34  return 0;
35 }
STL namespace.
int main()
Definition: test_eigen2.cxx:27
void test_matrix_by_array(ExecMon &em)
Definition: test_eigen2.cxx:11
std::string summary() const
Return summary up to now.
Definition: ExecMon.cxx:21
QTextStream & endl(QTextStream &s)