Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        /**
         * <p>
         * Checks to see if the matrix is positive definite.
         * </p>
         * <p>
         * x<sup>T</sup> A x &gt; 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));
        }
Ejemplo n.º 3
0
 public LinearSolverCholesky_DSCC(CholeskyUpLooking_DSCC cholesky,
                                  ComputePermutation <DMatrixSparseCSC> fillReduce)
 {
     this.cholesky = cholesky;
     this.reduce   = new ApplyFillReductionPermutation(fillReduce, true);
 }