Rev | Line | |
---|
[136] | 1 | #include <Eigen/Dense>
|
---|
| 2 | #include <iostream>
|
---|
| 3 |
|
---|
| 4 | using namespace Eigen;
|
---|
| 5 | using namespace std;
|
---|
| 6 |
|
---|
| 7 | int main()
|
---|
| 8 | {
|
---|
| 9 | ArrayXXf m(2,2);
|
---|
| 10 |
|
---|
| 11 | // assign some values coefficient by coefficient
|
---|
| 12 | m(0,0) = 1.0; m(0,1) = 2.0;
|
---|
| 13 | m(1,0) = 3.0; m(1,1) = m(0,1) + m(1,0);
|
---|
| 14 |
|
---|
| 15 | // print values to standard output
|
---|
| 16 | cout << m << endl << endl;
|
---|
| 17 |
|
---|
| 18 | // using the comma-initializer is also allowed
|
---|
| 19 | m << 1.0,2.0,
|
---|
| 20 | 3.0,4.0;
|
---|
| 21 |
|
---|
| 22 | // print values to standard output
|
---|
| 23 | cout << m << endl;
|
---|
| 24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.