source: pacpussensors/trunk/Vislab/lib3dv/eigen/doc/examples/MatrixBase_cwise_const.cpp@ 136

Last change on this file since 136 was 136, checked in by ldecherf, 7 years ago

Doc

File size: 516 bytes
Line 
1#define EIGEN2_SUPPORT
2#include <Eigen/Core>
3#include <iostream>
4
5using namespace Eigen;
6using namespace std;
7
8int main()
9{
10 Matrix3i m = Matrix3i::Random();
11 cout << "Here is the matrix m:" << endl << m << endl;
12 Matrix3i n = Matrix3i::Random();
13 cout << "And here is the matrix n:" << endl << n << endl;
14 cout << "The coefficient-wise product of m and n is:" << endl;
15 cout << m.cwise() * n << endl;
16 cout << "Taking the cube of the coefficients of m yields:" << endl;
17 cout << m.cwise().pow(3) << endl;
18}
Note: See TracBrowser for help on using the repository browser.