aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/MatrixBase_eval.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-12-27 21:43:10 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-12-27 21:43:10 +0000
commite7bdbe2e6a7d3d3e3f498e1ba9159b0ec1a8ccae (patch)
treeb4c3f1b04b6e00434a08bbe82cdf0a6181b271a5 /doc/snippets/MatrixBase_eval.cpp
parent6b9370e0f0608f203337539c72fe4821d925a978 (diff)
matrix storage order can now also be row-dominant (choosable for each matrix separately)
map() moves from MatrixBase to Matrix much more documentation/examples/snippets
Diffstat (limited to 'doc/snippets/MatrixBase_eval.cpp')
-rw-r--r--doc/snippets/MatrixBase_eval.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/snippets/MatrixBase_eval.cpp b/doc/snippets/MatrixBase_eval.cpp
new file mode 100644
index 000000000..376957359
--- /dev/null
+++ b/doc/snippets/MatrixBase_eval.cpp
@@ -0,0 +1,12 @@
+Matrix2f M = Matrix2f::random();
+Matrix2f m;
+m = M;
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Now we want to replace m by its own transpose." << endl;
+cout << "If we do m = m.transpose(), then m becomes:" << endl;
+m = m.transpose();
+cout << m << endl << "which is wrong!" << endl;
+cout << "Now let us instead do m = m.transpose().eval(). Then m becomes" << endl;
+m = M;
+m = m.transpose().eval();
+cout << m << endl << "which is right." << endl;