checkNonDecreasing function

void checkNonDecreasing(
  1. String name,
  2. List<double> arr
)

Implementation

void checkNonDecreasing(String name, List<double> arr) {
  for (int i = 1; i < arr.length; ++i) {
    invariant(arr[i] >= arr[i - 1], [
      '%s must be monotonically non-decreasing. (%s)',
      name,
      arr.toString()
    ]);
  }
}