Learn R Programming

Matrix (version 1.5-1)

facmul: Multiplication by Decomposition Factors

Description

Performs multiplication by factors for certain decompositions (and allows explicit formation of those factors).

Usage

facmul(x, factor, y, transpose, left, ...)

Value

the product of the selected factor (or its transpose) and y

Arguments

x

a matrix decomposition. No missing values or IEEE special values are allowed.

factor

an indicator for selecting a particular factor for multiplication.

y

a matrix or vector to be multiplied by the factor or its transpose. No missing values or IEEE special values are allowed.

transpose

a logical value. When FALSE (the default) the factor is applied. When TRUE the transpose of the factor is applied.

left

a logical value. When TRUE (the default) the factor is applied from the left. When FALSE the factor is applied from the right.

...

the method for "qr.Matrix" has additional arguments.

NOTE

Factors for decompositions such as lu and qr can be stored in a compact form. The function facmul allows multiplication without explicit formation of the factors, saving both storage and operations.

References

Golub, G., and Van Loan, C. F. (1989). Matrix Computations, 2nd edition, Johns Hopkins, Baltimore.

Examples

Run this code
library(Matrix)
x <- Matrix(rnorm(9), 3, 3)
if (FALSE) {
qrx <- qr(x)                      # QR factorization of x
y <- rnorm(3)
facmul( qr(x), factor = "Q", y)   # form Q y
}

Run the code above in your browser using DataLab