From d29e9d71192240b7daa5efd477bb72a205b0d9fe Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 21 Feb 2017 17:03:10 +0100 Subject: Improve documentation of reshaped --- doc/snippets/MatrixBase_reshaped_all.cpp | 5 +++++ doc/snippets/MatrixBase_reshaped_auto.cpp | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 doc/snippets/MatrixBase_reshaped_all.cpp create mode 100644 doc/snippets/MatrixBase_reshaped_auto.cpp (limited to 'doc/snippets') 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; -- cgit v1.2.3