Solve and Inverse with LU Decomposition

DESCRIPTION:
Given the LU decomposition of a square matrix, either solves a system of linear equations with that matrix as coefficient matrix or else computes the inverse of the matrix.

USAGE:
solve.lu.Matrix(a, b, tol=0, transpose=F, norma, tune, workspace)

REQUIRED ARGUMENTS:
a:
An object of class lu.Matrix, representing the LU decomposition of a square matrix.

OPTIONAL ARGUMENTS:
b:
A matrix or vector. If 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:
Tolerance for reciprocal condition estimation. If 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.
transpose:
A logical variable indicating whether or not the transpose (conjugate transpose if complex) of a is to be used in the solve or inverse operation. The default is to use the untransposed matrix.
norma:
The one norm of the matrix for use in condition estimation. By default, it is assumed that the norm is available as an attribute of a, since the default for lu.Matrix is to return the one and infinity norms of the matrix in an attribute.
tune:
a integer vector or list of named tuning parameters that may affect computational efficiency. The relevant parameters are the blocksize parameters NB, NBMIN, and NX as described in .laenv.
workspace:
workspace provided to the underlying software. The default is to use the optimum value relative to the tuning parameters. The optimal workspace for the problem (with the given tuning parameters) is included as part of the output attributes.

VALUE:
If 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.

DETAILS:
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.


REFERENCES:
Anderson, E., et al. (1994). LAPACK User's Guide, 2nd edition, SIAM, Philadelphia.

SEE ALSO:
solve , solve.lu.Hermitian , solve.Matrix , solve.qr.Matrix , solve.svd.Matrix .

EXAMPLES:
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