class DoublesScheduleGenerator {

  public static double[] leftTruncate(final double lower, final double[] set) {

    final int n = set.length;
    if (n == 0) {
      return set;
    }
    if (lower < set[0]) {
      return set;
    }
    if (lower >= set[n - 1]) {
      return new double[0];
    }

    final int index = Arrays.binarySearch(set, lower);
    final int chop = index >= 0 ? index + 1 : -(index + 1);
    double[] res;
    if (chop == 0) {
      res = set;
    } else {
      res = new double[n - chop];
      System.arraycopy(set, chop, res, 0, n - chop);
    }
    return res;
  }

}