00001 #include <Eigen/Dense> 00002 #include <iostream> 00003 00004 using namespace Eigen; 00005 using namespace std; 00006 00007 int main() 00008 { 00009 ArrayXXf a(3,3); 00010 ArrayXXf b(3,3); 00011 a << 1,2,3, 00012 4,5,6, 00013 7,8,9; 00014 b << 1,2,3, 00015 1,2,3, 00016 1,2,3; 00017 00018 // Adding two arrays 00019 cout << "a + b = " << endl << a + b << endl << endl; 00020 00021 // Subtracting a scalar from an array 00022 cout << "a - 2 = " << endl << a - 2 << endl; 00023 }