summaryrefslogtreecommitdiffhomepage
path: root/eigen/doc/snippets/MatrixBase_array_const.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'eigen/doc/snippets/MatrixBase_array_const.cpp')
-rw-r--r--eigen/doc/snippets/MatrixBase_array_const.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/eigen/doc/snippets/MatrixBase_array_const.cpp b/eigen/doc/snippets/MatrixBase_array_const.cpp
new file mode 100644
index 0000000..cd3b26a
--- /dev/null
+++ b/eigen/doc/snippets/MatrixBase_array_const.cpp
@@ -0,0 +1,4 @@
+Vector3d v(-1,2,-3);
+cout << "the absolute values:" << endl << v.array().abs() << endl;
+cout << "the absolute values plus one:" << endl << v.array().abs()+1 << endl;
+cout << "sum of the squares: " << v.array().square().sum() << endl;