class BasisFunctionKnots {

  public static BasisFunctionKnots fromKnots(double[] knots, int degree) {
    ArgumentChecker.notEmpty(knots, "knots");
    ArgumentChecker.notNegative(degree, "degree");
    int nKnots = knots.length;
    ArgumentChecker.isTrue(nKnots - 3 * degree > 0, "Require at least {} knots for degree {}, only given {}", 3 * degree + 1,
        degree, nKnots);

    // check knots are ascending
    for (int i = 1; i < nKnots; i++) {
      ArgumentChecker.isTrue(knots[i] - knots[i - 1] > 0, "knots are not ascending");
    }
    int nSplines = nKnots - degree - 1;
    return new BasisFunctionKnots(knots, degree, nSplines);
  }

  private  BasisFunctionKnots(double[] knots, int degree, int nSplines);

}