aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/Tutorial_std_sort_rows.cpp
blob: fdd850d13710fa12d299e5eb44ff091a4d9303e5 (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";