class PenaltyMatrixGenerator {

  public static DoubleMatrix2D getPenaltyMatrix(int m, int k) {
    ArgumentChecker.notNegativeOrZero(m, "m");
    ArgumentChecker.notNegative(k, "k");
    ArgumentChecker.isTrue(k < m, "Difference order too high, require m > k, but have: m = {} and k = {}", m, k);
    if (k == 0) {
      return new IdentityMatrix(m);
    }
    DoubleMatrix2D d = getDifferenceMatrix(m, k);
    DoubleMatrix2D dt = MA.getTranspose(d);
    return (DoubleMatrix2D) MA.multiply(dt, d);
  }

}