\Header{crossprod}{Matrix Crossproduct}
\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}.
\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{\Link{\%*\%}} and outer product \code{\Link{\%o\%}}.
\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}

