Last data update: 2014.03.03

R: Multiplication by Decomposition Factors
facmulR Documentation

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, ...)

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.

Value

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

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

library(Matrix)
x <- Matrix(rnorm(9), 3, 3)
## Not run: 
qrx <- qr(x)                      # QR factorization of x
y <- rnorm(3)
facmul( qr(x), factor = "Q", y)   # form Q y

## End(Not run)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Matrix)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Matrix/facmul.Rd_%03d_medium.png", width=480, height=480)
> ### Name: facmul
> ### Title: Multiplication by Decomposition Factors
> ### Aliases: facmul facmul.default
> ### Keywords: array algebra
> 
> ### ** Examples
> 
> library(Matrix)
> x <- Matrix(rnorm(9), 3, 3)
> ## Not run: 
> ##D qrx <- qr(x)                      # QR factorization of x
> ##D y <- rnorm(3)
> ##D facmul( qr(x), factor = "Q", y)   # form Q y
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>