2010-06-29 01:42:59 +08:00
|
|
|
#include <Eigen/Dense>
|
|
|
|
#include <iostream>
|
|
|
|
|
2010-10-18 20:44:27 +08:00
|
|
|
using namespace std;
|
|
|
|
|
2010-06-29 01:42:59 +08:00
|
|
|
int main()
|
|
|
|
{
|
2010-07-14 17:16:12 +08:00
|
|
|
Eigen::MatrixXf m(3,3);
|
2010-06-29 01:42:59 +08:00
|
|
|
m << 1,2,3,
|
|
|
|
4,5,6,
|
|
|
|
7,8,9;
|
2010-10-18 20:44:27 +08:00
|
|
|
cout << "Here is the matrix m:" << endl << m << endl;
|
|
|
|
cout << "2nd Row: " << m.row(1) << endl;
|
|
|
|
m.col(2) += 3 * m.col(0);
|
|
|
|
cout << "After adding 3 times the first column into the third column, the matrix m is:\n";
|
|
|
|
cout << m << endl;
|
2010-06-29 01:42:59 +08:00
|
|
|
}
|