public static LinearSolverSparse <DMatrixSparseCSC, DMatrixRMaj> cholesky(FillReducing permutation) { ComputePermutation <DMatrixSparseCSC> cp = FillReductionFactory_DSCC.create(permutation); CholeskyUpLooking_DSCC chol = (CholeskyUpLooking_DSCC)DecompositionFactory_DSCC.cholesky(); return(new LinearSolverCholesky_DSCC(chol, cp)); }
/** * <p> * Checks to see if the matrix is positive definite. * </p> * <p> * x<sup>T</sup> A x > 0<br> * for all x where x is a non-zero vector and A is a symmetric matrix. * </p> * * @param A square symmetric matrix. Not modified. * * @return True if it is positive definite and false if it is not. */ public static bool isPositiveDefinite(DMatrixSparseCSC A) { if (A.numRows != A.numCols) { return(false); } CholeskySparseDecomposition <DMatrixSparseCSC> chol = new CholeskyUpLooking_DSCC(); return(chol.decompose(A)); }
public LinearSolverCholesky_DSCC(CholeskyUpLooking_DSCC cholesky, ComputePermutation <DMatrixSparseCSC> fillReduce) { this.cholesky = cholesky; this.reduce = new ApplyFillReductionPermutation(fillReduce, true); }