\HeaderA{crossprod}{Matrix Crossproduct}{crossprod}
\keyword{algebra}{crossprod}
\keyword{array}{crossprod}
\begin{Description}\relax
Given matrices \code{x} and \code{y} as arguments,
\code{crossprod} returns their matrix cross-product.
This is formally equivalent to, but faster than, the
call \code{t(x) \%*\% y}.
\end{Description}
\begin{Usage}
\begin{verbatim}
crossprod(x, y = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x, y}] matrices: \code{y = NULL} is taken to be the
same matrix as \code{x}.  Vectors are promoted to single-column
matrices.
\end{ldescription}
\end{Arguments}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{\%*\%}{.Rpcent.*.Rpcent.}} and outer product \code{\LinkA{\%o\%}{.Rpcent.o.Rpcent.}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
(z <- crossprod(1:4))    # = sum(1 + 2^2 + 3^2 + 4^2)
drop(z)                  # scalar
\end{ExampleCode}
\end{Examples}

