/** * Perform thin SVD on matrix, calculating at most ndims dimensions. * * @param matrix * the matrix * @param ndims * the number of singular values/vectors to calculate; actual * number may be less. */ public ThinSingularValueDecomposition(Matrix matrix, int ndims) { this(new JamaDenseMatrix(matrix), ndims); }
@Override public ch.akuhn.matrix.Matrix newInstance(int rows, int cols) { return new JamaDenseMatrix(rows, cols); } }
/** * Compute the lower-rank approximation of the Moore-Penrose Pseudo-Inverse. * * @param matrix * The matrix to invert. * @param rank * the desired rank. * @return the pseudo-inverse. */ public static Matrix pseudoInverse(Matrix matrix, int rank) { return pseudoInverse(new JamaDenseMatrix(matrix), rank); }