aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2017-02-21 17:03:10 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2017-02-21 17:03:10 +0100
commitd29e9d71192240b7daa5efd477bb72a205b0d9fe (patch)
treebaa94d8d4ee38f8ea43097cfb4b3aa7be7256eca /doc/snippets
parent9b6e365018c0a20e5ed1b504dc1f945cce09ec5f (diff)
Improve documentation of reshaped
Diffstat (limited to 'doc/snippets')
-rw-r--r--doc/snippets/MatrixBase_reshaped_all.cpp5
-rw-r--r--doc/snippets/MatrixBase_reshaped_auto.cpp4
2 files changed, 9 insertions, 0 deletions
diff --git a/doc/snippets/MatrixBase_reshaped_all.cpp b/doc/snippets/MatrixBase_reshaped_all.cpp
new file mode 100644
index 000000000..501f6276f
--- /dev/null
+++ b/doc/snippets/MatrixBase_reshaped_all.cpp
@@ -0,0 +1,5 @@
+using Eigen::placeholders::all;
+Matrix4i m = Matrix4i::Random();
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Here is m(all).transpose():" << endl << m(all).transpose() << endl;
+cout << "Here is m.reshaped(fix<1>,AutoSize):" << endl << m.reshaped(fix<1>,AutoSize) << endl;
diff --git a/doc/snippets/MatrixBase_reshaped_auto.cpp b/doc/snippets/MatrixBase_reshaped_auto.cpp
new file mode 100644
index 000000000..8f02ae893
--- /dev/null
+++ b/doc/snippets/MatrixBase_reshaped_auto.cpp
@@ -0,0 +1,4 @@
+Matrix4i m = Matrix4i::Random();
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Here is m.reshape(2, AutoSize):" << endl << m.reshaped(2, AutoSize) << endl;
+cout << "Here is m.reshape(AutoSize, fix<8>, RowOrder):" << endl << m.reshaped(AutoSize, fix<8>, RowOrder) << endl;