diff options
author | 2018-11-12 22:06:33 +0100 | |
---|---|---|
committer | 2018-11-12 22:06:33 +0100 | |
commit | c81bdbdadc72b96dda3c4a120bfb189df62ece18 (patch) | |
tree | c8b348d22d891a70322ef9caed6001c949f301af /doc/snippets/Tutorial_std_sort_rows.cpp | |
parent | 0105146915c62f732841bb63d5c2046ed7cb3864 (diff) |
Add manual doc on STL-compatible iterators
Diffstat (limited to 'doc/snippets/Tutorial_std_sort_rows.cpp')
-rw-r--r-- | doc/snippets/Tutorial_std_sort_rows.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/snippets/Tutorial_std_sort_rows.cpp b/doc/snippets/Tutorial_std_sort_rows.cpp new file mode 100644 index 000000000..fdd850d13 --- /dev/null +++ b/doc/snippets/Tutorial_std_sort_rows.cpp @@ -0,0 +1,5 @@ +ArrayXXi A = ArrayXXi::Random(4,4).abs(); +cout << "Here is the initial matrix A:\n" << A << "\n"; +for(auto row : A.rowwise()) + std::sort(row.begin(), row.end()); +cout << "Here is the sorted matrix A:\n" << A << "\n";
\ No newline at end of file |