Hi, I need a symbolic factorization of the matrix, similar to symbfact in MATLAB. I have a sparse matrix:
A = sparse([ 2 0 0 0 0 1
0 2 1 1 1 1
0 1 2 2 1 1
0 1 2 2 0 2
0 1 1 0 2 2
1 1 1 2 2 0]

Using MATLAB, I get

R = 1 0 0 0 0 1
0 1 1 1 1 1
0 0 1 1 1 1
0 0 0 1 1 1
0 0 0 0 1 1
0 0 0 0 0 1

The link below mentions symbolic factorization, but whether it is possible to obtain a matrix as a result?

Hey all! I have a quick question, which I saw was referenced here some time ago.
I was wondering if there was a standard way of factorizing A^TA (i.e. the Gram matrix of A) without actively computing the Gram matrix? This is usually done by the COLAMD procedure from CHOLMOD, but it doesn’t seem that SuiteSparse exposes this to a Julia call (though there are some references to it in spqr.jl found here ). Currently, and with only ok performance, I’m using Cholesky on A^TA, but a good chunk of the …

What do you mean by symbolic factorization?

1 Like

According to Matlab or User Guide for CHOLMOD, it is a symbolic factorization analysis that returns 0-1 matrix whose structure is that of `chol(A)`

, or `cholesky(A)`

in Julia. For example, the matrix

```
A = sparse([ 2 0 0 0 0 1
0 2 1 1 1 1
0 1 2 2 1 1
0 1 2 2 0 2
0 1 1 0 2 2
1 1 1 2 2 0])
```

is not positive definite, and Cholesky factorization failed, but symbolic factorization in the MATLAB `[count,h,parent,post,R] = symbfact(A)`

gives the result for R matrix, which I need.

I am almost sure that I need results from the function `fact_()`

.

```
# This file is a part of Julia. License is MIT: https://julialang.org/license
# Theoretically CHOLMOD supports both Int32 and Int64 indices on 64-bit.
# However experience suggests that using both in the same session causes memory
# leaks, so we restrict indices to be SuiteSparse_long (see cholmod_h.jl).
# Ref: https://github.com/JuliaLang/julia/issues/12664
# Additionally, only Float64/ComplexF64 are supported in practice.
# Ref: https://github.com/JuliaLang/julia/issues/25986
module CHOLMOD
import Base: (*), convert, copy, eltype, getindex, getproperty, show, size,
IndexStyle, IndexLinear, IndexCartesian, adjoint, axes
using Base: require_one_based_indexing
using LinearAlgebra
import LinearAlgebra: (\),
cholesky, cholesky!, det, diag, ishermitian, isposdef,
issuccess, issymmetric, ldlt, ldlt!, logdet
```

This file has been truncated. show original

dpo
May 13, 2020, 11:21pm
#4
It’s probably possible to extract it from LDLFactorizations.jl but will require a little hacking. I’ll be happy to review a pull request if you’re interested.

I found a solution, if anyone needs it, functions `etree`

and `ereach`

solve the problem.

```
# These functions are based on C functions in the CSparse library by Tim Davis.
# These are pure Julia implementations, and do not link to the CSparse library.
# CSparse can be downloaded from http://www.cise.ufl.edu/research/sparse/CSparse/CSparse.tar.gz
# CSparse is Copyright (c) 2006-2007, Timothy A. Davis and released under
# Lesser GNU Public License, version 2.1 or later. A copy of the license can be
# downloaded from http://www.gnu.org/licenses/lgpl-2.1.html
# Because these functions are based on code covered by LGPL-2.1+ the same license
# must apply to the code in this file which is
# Copyright (c) 2013-2014 Viral Shah, Douglas Bates and other contributors
# Based on Direct Methods for Sparse Linear Systems, T. A. Davis, SIAM, Philadelphia, Sept. 2006.
# Section 2.4: Triplet form
# http://www.cise.ufl.edu/research/sparse/CSparse/
# Compute the elimination tree of A using triu(A) returning the parent vector.
# A root node is indicated by 0. This tree may actually be a forest in that
# there may be more than one root, indicating complete separability.
# A trivial example is speye(n, n) in which every node is a root.
```

This file has been truncated. show original

magronv
December 10, 2021, 4:28pm
#7
Dear Mirsad,

would you have a Julia script to compute a symbolic factorization (e.g., Cholesky) of a matrix with rational entries?

Many thanks in advance,

Victor