Multiplication by Factors from an LU Decomposition
DESCRIPTION:
Performs multiplication by any of the factors in an LU decomposition.
USAGE:
facmul.lu.Matrix(x, factor, y, transpose = F, left = T)
REQUIRED ARGUMENTS:
x:
an object of class "lu.Matrix".
factor:
either "L", "U", or "P", where "L" selects the unit lower-triangular or
trapezoidal factor, "U" selects the upper triangular or trapezoidal factor,
and "P selects the row permutation applied to the original matrix in order to
obtain the decomposition.
OPTIONAL ARGUMENTS:
y:
a numeric or complex vector or matrix. The default is the identity
matrix of the order equal to the number of rows (left = T) or
number of columns (left = F) in the matrix underlying x, so that either
the factor itself (transpose = F) or its transpose
(transpose = T) are returned when y is missing.
transpose:
a logical value telling whether or not to multiply by the (if complex,
conjugate) transpose of the factor. The default is multiplication by the
factor itself.
left:
a logical value telling whether the multiplication should occur on the left
of y or on the right. The default is multiplication on the left.
VALUE:
An object of class "Matrix" corresponding to the desired matrix product.
DETAILS:
The lower and upper triangular factors for an LU decomposition from Lapack
(Anderson et al., 1994) are stored in a single array the size of the
underlying matrix. This functions allows these, as well as the permutation,
to be applied separately without their explicit formation.
REFERENCES:
Anderson, E., et al. (1994).
LAPACK User's Guide,
2nd edition, SIAM, Philadelphia.
x <- Matrix( rnorm(9), nrow = 3, ncol = 3)
z <- lu(x) # LU factorization of x
max(abs(facmul(z,"L",facmul(z,"U")) - facmul(z,"P",x))) # test product LU