solve.lu.Matrix(a, b, tol=0, transpose=F, norma, tune, workspace)
lu.Matrix
, representing the LU decomposition of a
square matrix.
transpose=T
, the number of rows of
b
must equal the
number of rows of the matrix underlying
a
, wheras if
transpose=F
the number
of rows of
b
must equal the number of columns of the matrix underlying
a
.
tol
is negative, no
condition estimation is done. Otherwise, the reciprocal one norm condition
estimate is computed and the solve or inverse computation is done only if
the condition estimate is greater than
tol
. By default
tol = 0
.
a
is to be used in the solve or inverse operation.
The default is to use the untransposed matrix.
a
, since the
default for
lu.Matrix
is to return the one and infinity norms of the matrix
in an attribute.
NB
,
NBMIN
, and
NX
as described in
.laenv
.
A
is the matrix whose LU decomposition is represented
by
a
, an object of class
Matrix"
is returned that is the solution
x
to the system of equations A %*% x = b
If
b
is not supplied, the inverse of
A
is returned.
Attributes include a copy of the call to
solve
,
the optimal workspace for the underlying software,
and the one norm reciprocal condition estimate if
tol
is nonnegative.
Based on the functions dgecon, dgetri, zgecon, and zgetri from
LAPACK (Anderson et al. 1994).
This function will not attempt a solve for
lu.Matrix
objects for
matrices that are not square.
Anderson, E., et al. (1994). LAPACK User's Guide, 2nd edition, SIAM, Philadelphia.
n <- 5 a <- Matrix( rnorm(n*n), nrow = n, ncol = n)z b <- rnorm(n) z <- lu(a) # LU decomposition of a a %*% solve(z,b) - b # residual solve(z) %*% a # should be identity