@Override public double[] project(double[] x) { if (x.length != p) { throw new IllegalArgumentException( String.format("Invalid input vector size: %d, expected: %d", x.length, p)); } double[] y = new double[scaling[0].length]; Math.atx(scaling, x, y); Math.minus(y, smean); return y; }
@Override public double[][] project(double[][] x) { double[][] y = new double[x.length][scaling[0].length]; for (int i = 0; i < x.length; i++) { if (x[i].length != p) { throw new IllegalArgumentException( String.format("Invalid input vector size: %d, expected: %d", x[i].length, p)); } Math.atx(scaling, x[i], y[i]); Math.minus(y[i], smean); } return y; }