aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/Tutorial_std_sort_rows_cxx11.cpp
blob: 03641603d86cbd95b4e1b6be0f6de4ba3d9ab842 (plain)
1
2
3
4
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";