Cholesky Decomposition. For a symmetric, positive definite matrix A, the Cholesky decomposition is an lower triangular matrix L so that A = L*L'. If the matrix is not symmetric or positive definite, the constructor returns a partial decomposition and sets an internal flag that may be queried by the isSPD() method.
Inheritance: DirectSolver
Example #1
0
 public MatrixValue Function(MatrixValue M)
 {
     var chol = new CholeskyDecomposition(M);
     return chol.GetL();
 }
Example #2
0
        /// <summary>
        /// Computes the inverse (if it exists).
        /// </summary>
        /// <returns>The inverse matrix.</returns>
        public MatrixValue Inverse()
        {
            var target = One(DimensionX);

            if (DimensionX < 24)
            {
                var lu = new YAMP.Numerics.LUDecomposition(this);
                return lu.Solve(target);
            }
            else if (IsSymmetric)
            {
                var cho = new YAMP.Numerics.CholeskyDecomposition(this);
                return cho.Solve(target);
            }

            var qr = YAMP.Numerics.QRDecomposition.Create(this);
            return qr.Solve(target);
        }