diff --git a/examples/sort-axis.rs b/examples/sort-axis.rs index 56d17eb5b..27096aa10 100644 --- a/examples/sort-axis.rs +++ b/examples/sort-axis.rs @@ -303,8 +303,10 @@ mod tests { assert_eq!(sorted_f[0], 74880.05859375); assert_eq!(sorted_f[283103], 109439.94140625); - let perm = - a.sort_axis_(Axis(0), |i, j| a[[i, 0]].partial_cmp(&a[[j, 0]]).unwrap()); + let perm = a.sort_axis_by(Axis(0), |i, j| a[[i, 0]] < a[[j, 0]]); + assert_eq!(perm.indices[0], 5897); + assert_eq!(perm.indices[283103], 176939); + let b = a.permute_axis(Axis(0), &perm); assert_eq!(b[[0, 0]], 74880.05859375); assert_eq!(b[[283103, 0]], 109439.941);