CHMfactor-class {Matrix} | R Documentation |
The virtual class "CHMfactor"
is a class of
CHOLMOD-based Cholesky factorizations of symmetric, sparse,
compressed, column-oriented matrices. Such a factorization is
simplicial (virtual class "CHMsimpl"
) or supernodal (virtual
class "CHMsuper"
). Objects that inherit from these classes are
either numeric factorizations (classes "dCHMsimpl"
and
"dCHMsuper"
) or symbolic factorizations (classes
"nCHMsimpl"
and "nCHMsuper"
).
## S4 method for signature 'CHMfactor': update(object, parent, mult = 0, ...)
object |
a "CHMfactor" object. |
parent |
a "dsCMatrix" matrix or
"dgCMatrix" object with the same nonzero
pattern as the matrix that generated object . If
parent is a symmetric matrix (class
"dsCMatrix" ) then object should be a
decomposition of a matrix with the same nonzero pattern as
parent . If parent is not symmetric then object
should be the decomposition of a matrix with the same nonzero
pattern as tcrossprod(parent) . |
mult |
a numeric scalar (default 0). mult times the
identity matrix is (implicitly) added to parent or
tcrossprod(parent) before updating the decomposition
object . |
... |
Optional additional arguments to the methods. |
Objects can be created by calls of the form new("dCHMsuper", ...)
but are more commonly created via Cholesky()
,
applied to dsCMatrix
or
lsCMatrix
objects.
of "CHMfactor"
and all classes inheriting from it:
perm
:colcount
:"integer"
.... type
:"integer"
.... Slots of the non virtual classes “[dl]CHM(super|simpl)”:
p
:"integer"
of pointers, one
for each column, to the initial (zero-based) index of elements in
the column. Only present in classes that contain "CHMsimpl"
.i
:"integer"
of length nnzero
(number of non-zero elements). These are the row numbers for
each non-zero element in the matrix. Only present in classes that
contain "CHMsimpl"
.x
:"d*"
classes: "numeric"
- the
non-zero elements of the matrix.signature(from = "CHMfactor", to = "sparseMatrix")
signature(x = "CHMfactor")
signature(a = "CHMfactor", b = "ddenseMatrix")
The solve
methods for a "CHMfactor"
object take an
optional third argument system
whose value can be one of the
character strings "A"
, "LDLt"
, "LD"
,
"DLt"
, "L"
, "Lt"
, "D"
, "P"
or
"Pt"
. This argument describes the system to be solved. The
default is to solve Ax = b
for x
where A
is
sparse, positive-definite matrix that was factored to produce
"a"
.signature(a = "CHMfactor", b = "matrix")
, andsignature(a = "CHMfactor", b = "numeric")
call
the above signature(*, b = "ddenseMatrix")
method.signature(a = "CHMfactor", b = "dsparseMatrix")
takes the same third argument system
and calls the
corresponding sparse CHOLMOD algorithm.signature(x = "CHMfactor", logarithm =
"logical")
returns the determinant (or the logarithm of the
determinant, if logarithm = TRUE
, the default) of the
matrix whose decomposition is represented by x
. The
determinant of the decomposition is not well defined because the
decomposition may be “LDL'” or “LL'”. The
determinant of the original matrix that was decomposed is well
defined.signature(object = "CHMfactor")
. The
update
method requires an additional argument
parent
, which is a "dsCMatrix"
object with
the same structure of nonzeros as the matrix that was decomposed
to produce object
, and provides an optional argument
mult
, a numeric scalar. This method updates the numeric
values in object
to the decomposition of A+mI where
A is the matrix represented by parent
and m is
the scalar mult
. Because only the numeric values are
updated this method should be faster than creating and decomposing
A+mI. It is not uncommon to want, say, the determinant of
A+mI for many different values of m. This method
would be the preferred approach in such cases.
Cholesky
, also for examples;
class dgCMatrix
.