Tutorial_ArrayClass_interop_matrix.cpp
Go to the documentation of this file.
00001 #include <Eigen/Dense>
00002 #include <iostream>
00003 
00004 using namespace Eigen;
00005 using namespace std;
00006 
00007 int main()
00008 {
00009   MatrixXf m(2,2);
00010   MatrixXf n(2,2);
00011   MatrixXf result(2,2);
00012 
00013   m << 1,2,
00014        3,4;
00015   n << 5,6,
00016        7,8;
00017 
00018   result = m * n;
00019   cout << "-- Matrix m*n: --" << endl << result << endl << endl;
00020   result = m.array() * n.array();
00021   cout << "-- Array m*n: --" << endl << result << endl << endl;
00022   result = m.cwiseProduct(n);
00023   cout << "-- With cwiseProduct: --" << endl << result << endl << endl;
00024   result = m.array() + 4;
00025   cout << "-- Array m + 4: --" << endl << result << endl << endl;
00026 }


libicr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:33:55