2010-06-29 01:42:09 +08:00
|
|
|
#include <Eigen/Dense>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace Eigen;
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
ArrayXXf m(2,2);
|
|
|
|
|
2010-07-13 05:45:57 +08:00
|
|
|
// assign some values coefficient by coefficient
|
2010-06-29 01:42:09 +08:00
|
|
|
m(0,0) = 1.0; m(0,1) = 2.0;
|
2010-07-13 05:45:57 +08:00
|
|
|
m(1,0) = 3.0; m(1,1) = m(0,1) + m(1,0);
|
2010-06-29 01:42:09 +08:00
|
|
|
|
2010-07-13 05:45:57 +08:00
|
|
|
// print values to standard output
|
2010-06-29 01:42:09 +08:00
|
|
|
cout << m << endl << endl;
|
|
|
|
|
|
|
|
// using the comma-initializer is also allowed
|
|
|
|
m << 1.0,2.0,
|
|
|
|
3.0,4.0;
|
|
|
|
|
2010-07-13 05:45:57 +08:00
|
|
|
// print values to standard output
|
2010-06-29 01:42:09 +08:00
|
|
|
cout << m << endl;
|
|
|
|
}
|