\HeaderA{facmul}{Multiplication by Decomposition Factors}{facmul}
\methaliasA{facmul.default}{facmul}{facmul.default}
\keyword{array}{facmul}
\keyword{algebra}{facmul}
\begin{Description}\relax
Performs multiplication by factors for certain decompositions (and
allows explicit formation of those factors).
\end{Description}
\begin{Usage}
\begin{verbatim}
facmul(x, factor, y, transpose, left, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a matrix decomposition. 
No missing values or IEEE special values are allowed.

\item[\code{factor}] an indicator for selecting a particular factor for multiplication.

\item[\code{y}] a matrix or vector to be multiplied by the factor or its transpose.
No missing values or IEEE special values are allowed.

\item[\code{transpose}] a logical value.  When \code{FALSE} (the default) the factor is
applied.  When \code{TRUE} the transpose of the factor is applied.

\item[\code{left}] a logical value.  When \code{TRUE} (the default) the factor is
applied from the left.  When \code{FALSE} the factor is applied
from the right.

\item[\code{...}] the method for \code{"qr.Matrix"} has additional arguments.

\end{ldescription}
\end{Arguments}
\begin{Value}
the product of the selected factor (or its transpose) and \code{y}
\end{Value}
\begin{Section}{NOTE}
Factors for decompositions such as \code{lu} and \code{qr} can be
stored in a compact form.
The function \code{facmul} allows multiplication without explicit
formation of the factors, saving both storage and operations.
\end{Section}
\begin{References}\relax
Golub, G., and Van Loan, C. F. (1989).
\emph{Matrix Computations,}
2nd edition, Johns Hopkins, Baltimore.
\end{References}
\begin{Examples}
\begin{ExampleCode}
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)
\end{ExampleCode}
\end{Examples}

