示例#1
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));
        }
示例#2
0
        //@Override
        public bool setA(DMatrixSparseCSC A)
        {
            DMatrixSparseCSC C = reduce.apply(A);

            return(cholesky.decompose(C));
        }