/** * Return diagonal matrix of singular values. * * @return S as a diagonal matrix. */ public Matrix getS() { int minRC = Math.min(m, n); Matrix S = MatrixFactory.createMatrix(minRC, minRC); for (int i = 1; i <= minRC; i++) { S.set(i, i, this.s[i - 1]); } return S; }
/** * Return the left singular vectors * * @return U (left singular vectors) as a matrix. */ public Matrix getU() { return MatrixFactory.createMatrix(m, Math.min(m + 1, n), U); }
/** * Return the right singular vectors * * @return V (right singular vectors) as a matrix. */ public Matrix getV() { return MatrixFactory.createMatrix(n, n, V); }
static { MatrixFactory.getInstance().registerMatrixProducer(producer.getClass().getName(), producer); }