From 44861dcbfeee041223c4aac1ee075e92fa4daa01 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 18 Sep 2016 12:42:15 +0200 Subject: update --- .../doc/examples/Tutorial_ArrayClass_addition.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 eigen/doc/examples/Tutorial_ArrayClass_addition.cpp (limited to 'eigen/doc/examples/Tutorial_ArrayClass_addition.cpp') diff --git a/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp b/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp new file mode 100644 index 0000000..480ffb0 --- /dev/null +++ b/eigen/doc/examples/Tutorial_ArrayClass_addition.cpp @@ -0,0 +1,23 @@ +#include +#include + +using namespace Eigen; +using namespace std; + +int main() +{ + ArrayXXf a(3,3); + ArrayXXf b(3,3); + a << 1,2,3, + 4,5,6, + 7,8,9; + b << 1,2,3, + 1,2,3, + 1,2,3; + + // Adding two arrays + cout << "a + b = " << endl << a + b << endl << endl; + + // Subtracting a scalar from an array + cout << "a - 2 = " << endl << a - 2 << endl; +} -- cgit v1.2.3