aboutsummaryrefslogtreecommitdiff
path: root/doc/snippets/MatrixBase_template_int_topRows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/snippets/MatrixBase_template_int_topRows.cpp')
-rw-r--r--doc/snippets/MatrixBase_template_int_topRows.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/snippets/MatrixBase_template_int_topRows.cpp b/doc/snippets/MatrixBase_template_int_topRows.cpp
new file mode 100644
index 000000000..0110251a5
--- /dev/null
+++ b/doc/snippets/MatrixBase_template_int_topRows.cpp
@@ -0,0 +1,6 @@
+Array44i a = Array44i::Random();
+cout << "Here is the array a:" << endl << a << endl;
+cout << "Here is a.topRows<2>():" << endl;
+cout << a.topRows<2>() << endl;
+a.topRows<2>().setZero();
+cout << "Now the array a is:" << endl << a << endl;