diff options
author | 2009-02-06 09:01:50 +0000 | |
---|---|---|
committer | 2009-02-06 09:01:50 +0000 | |
commit | 6fbca948031ff48ac8bba35afcabad967965befa (patch) | |
tree | 6160a5c4f64996d6c713e5ee3f8cebd26ca3ca7b /doc/snippets/MatrixBase_reverse.cpp | |
parent | dc9707990553566d7ac5d42fa79839812470f842 (diff) |
apply Ricard patch for Reverse with minor modifications
Diffstat (limited to 'doc/snippets/MatrixBase_reverse.cpp')
-rw-r--r-- | doc/snippets/MatrixBase_reverse.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/snippets/MatrixBase_reverse.cpp b/doc/snippets/MatrixBase_reverse.cpp new file mode 100644 index 000000000..f545a2837 --- /dev/null +++ b/doc/snippets/MatrixBase_reverse.cpp @@ -0,0 +1,8 @@ +MatrixXi m = MatrixXi::Random(3,4); +cout << "Here is the matrix m:" << endl << m << endl; +cout << "Here is the reverse of m:" << endl << m.reverse() << endl; +cout << "Here is the coefficient (1,0) in the reverse of m:" << endl + << m.reverse()(1,0) << endl; +cout << "Let us overwrite this coefficient with the value 4." << endl; +m.reverse()(1,0) = 4; +cout << "Now the matrix m is:" << endl << m << endl; |