public static boolean assertCumulative(final double[] da){
  final double tolerance=0.000001;
  Exam.assertTrue(Utils.realFormatArray(da),da.length > 0);
  double prev=Double.NEGATIVE_INFINITY;
  for (  final double d : da) {
    Exam.assertTrue(Utils.realFormat(d),d >= 0.0 && d <= (1.0 + tolerance) && !Double.isNaN(d));
    Exam.assertTrue(prev <= d);
    prev=d;
  }
  if (checkEquals(1.0,prev,tolerance)) {
    return true;
  }
  throw new Exam.ExamException(Utils.realFormatArray(da));
}

public static boolean assertCumulative ( final double [ ] da ) { final double tolerance = 0.000001 ; Exam . assertTrue ( Utils . realFormatArray ( da ) , da . length > 0 ) ; double prev = Double . NEGATIVE_INFINITY ; for ( final double d : da ) { Exam . assertTrue ( Utils . realFormat ( d ) , d >= 0.0 && d <= ( 1.0 + tolerance ) && ! Double . isNaN ( d ) ) ; Exam . assertTrue ( prev <= d ) ; prev = d ; } if ( checkEquals ( 1.0 , prev , tolerance ) ) { return true ; } throw new Exam . ExamException ( Utils . realFormatArray ( da ) ) ; }
assert that the array contains a cumulative monotone increasing distribution where each entry is a valid probability and the last element is 1 . 0 .
