Skip to content

Commit 208fd76

Browse files
committed
Add documentation on extracting factors from sparse cholfact/ldltfact
1 parent 6b0e706 commit 208fd76

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

doc/stdlib/linalg.rst

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,27 @@ Linear algebra functions in Julia are largely implemented by calling functions f
104104

105105
.. function:: cholfact(A; shift=0, perm=Int[]) -> CHOLMOD.Factor
106106

107-
Compute the Cholesky factorization of a sparse positive definite matrix ``A``. A fill-reducing permutation is used. The main application of this type is to solve systems of equations with ``\``, but also the methods ``diag``, ``det``, ``logdet`` are defined. The function calls the C library CHOLMOD and many other functions from the library are wrapped but not exported.
107+
Compute the Cholesky factorization of a sparse positive definite
108+
matrix ``A``. A fill-reducing permutation is used. ``F =
109+
cholfact(A)`` is most frequently used to solve systems of equations
110+
with ``F\b``, but also the methods ``diag``, ``det``, ``logdet``
111+
are defined for ``F``. You can also extract individual factors
112+
from ``F``, using ``F[:L]``. However, since pivoting is on by
113+
default, the factorization is internally represented as ``A ==
114+
P'*L*L'*P`` with a permutation matrix ``P``; using just ``L``
115+
without accounting for ``P`` will give incorrect answers. To
116+
include the effects of permutation, it's typically preferable to
117+
extact "combined" factors like ``PtL = F[:PtL]`` (the equivalent of
118+
``P'*L``) and ``LtP = F[:UP]`` (the equivalent of ``L'*P``).
108119

109120
Setting optional ``shift`` keyword argument computes the factorization
110121
of ``A+shift*I`` instead of ``A``. If the ``perm`` argument is nonempty,
111122
it should be a permutation of `1:size(A,1)` giving the ordering to use
112123
(instead of CHOLMOD's default AMD ordering).
113124

125+
The function calls the C library CHOLMOD and many other functions
126+
from the library are wrapped but not exported.
127+
114128
.. function:: cholfact!(A [,LU=:U [,pivot=Val{false}]][;tol=-1.0]) -> Cholesky
115129

116130
``cholfact!`` is the same as :func:`cholfact`, but saves space by overwriting the input ``A``, instead of creating a copy. ``cholfact!`` can also reuse the symbolic factorization from a different matrix ``F`` with the same structure when used as: ``cholfact!(F::CholmodFactor, A)``.
@@ -121,13 +135,29 @@ Linear algebra functions in Julia are largely implemented by calling functions f
121135

122136
.. function:: ldltfact(A; shift=0, perm=Int[]) -> CHOLMOD.Factor
123137

124-
Compute the LDLt factorization of a sparse symmetric or Hermitian matrix ``A``. A fill-reducing permutation is used. The main application of this type is to solve systems of equations with ``\``, but also the methods ``diag``, ``det``, ``logdet`` are defined. The function calls the C library CHOLMOD and many other functions from the library are wrapped but not exported.
138+
Compute the LDLt factorization of a sparse symmetric or Hermitian
139+
matrix ``A``. A fill-reducing permutation is used. ``F =
140+
ldltfact(A)`` is most frequently used to solve systems of equations
141+
with ``F\b``, but also the methods ``diag``, ``det``, ``logdet``
142+
are defined for ``F``. You can also extract individual factors from
143+
``F``, using ``F[:L]``. However, since pivoting is on by default,
144+
the factorization is internally represented as ``A == P'*L*D*L'*P``
145+
with a permutation matrix ``P``; using just ``L`` without
146+
accounting for ``P`` will give incorrect answers. To include the
147+
effects of permutation, it's typically preferable to extact
148+
"combined" factors like ``PtL = F[:PtL]`` (the equivalent of
149+
``P'*L``) and ``LtP = F[:UP]`` (the equivalent of ``L'*P``). The
150+
complete list of supported factors is ``:L, :PtL, :D, :UP, :U, :LD,
151+
:DU, :PtLD, :DUP``.
125152

126153
Setting optional ``shift`` keyword argument computes the factorization
127154
of ``A+shift*I`` instead of ``A``. If the ``perm`` argument is nonempty,
128155
it should be a permutation of `1:size(A,1)` giving the ordering to use
129156
(instead of CHOLMOD's default AMD ordering).
130157

158+
The function calls the C library CHOLMOD and many other functions
159+
from the library are wrapped but not exported.
160+
131161
.. function:: qr(A [,pivot=Val{false}][;thin=true]) -> Q, R, [p]
132162

133163
Compute the (pivoted) QR factorization of ``A`` such that either ``A = Q*R`` or ``A[:,p] = Q*R``. Also see ``qrfact``. The default is to compute a thin factorization. Note that ``R`` is not extended with zeros when the full ``Q`` is requested.

0 commit comments

Comments
 (0)