\HeaderA{symmpart}{Symmetric Part and Skew(symmetric) Part of a Matrix}{symmpart}
\aliasA{skewpart}{symmpart}{skewpart}
\aliasA{skewpart,ddenseMatrix-method}{symmpart}{skewpart,ddenseMatrix.Rdash.method}
\aliasA{skewpart,denseMatrix-method}{symmpart}{skewpart,denseMatrix.Rdash.method}
\aliasA{skewpart,diagonalMatrix-method}{symmpart}{skewpart,diagonalMatrix.Rdash.method}
\aliasA{skewpart,Matrix-method}{symmpart}{skewpart,Matrix.Rdash.method}
\aliasA{skewpart,matrix-method}{symmpart}{skewpart,matrix.Rdash.method}
\aliasA{skewpart,symmetricMatrix-method}{symmpart}{skewpart,symmetricMatrix.Rdash.method}
\aliasA{skewpart-methods}{symmpart}{skewpart.Rdash.methods}
\aliasA{symmpart,ddenseMatrix-method}{symmpart}{symmpart,ddenseMatrix.Rdash.method}
\aliasA{symmpart,denseMatrix-method}{symmpart}{symmpart,denseMatrix.Rdash.method}
\aliasA{symmpart,diagonalMatrix-method}{symmpart}{symmpart,diagonalMatrix.Rdash.method}
\aliasA{symmpart,Matrix-method}{symmpart}{symmpart,Matrix.Rdash.method}
\aliasA{symmpart,matrix-method}{symmpart}{symmpart,matrix.Rdash.method}
\aliasA{symmpart,symmetricMatrix-method}{symmpart}{symmpart,symmetricMatrix.Rdash.method}
\aliasA{symmpart-methods}{symmpart}{symmpart.Rdash.methods}
\keyword{array}{symmpart}
\keyword{arith}{symmpart}
\begin{Description}\relax
symmpart(x) computes the symmetric part \code{(x + t(x))/2} and the
skew symmetric part \code{(x - t(x))/2} of a square matrix \code{x}.
Note that \code{x == symmpart(x) + skewpart(x)} for all square
matrices.
\end{Description}
\begin{Usage}
\begin{verbatim}
symmpart(x)
skewpart(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a \emph{square} matrix; either \dQuote{traditional} of class
\code{"matrix"}, or typically, inheriting from the
\code{\LinkA{Matrix}{Matrix.Rdash.class}} class.
\end{ldescription}
\end{Arguments}
\begin{Value}
\code{symmpart()} returns a symmetric matrix, inheriting from
\code{\LinkA{symmetricMatrix}{symmetricMatrix.Rdash.class}} iff \code{x} inherited from
\code{Matrix}.

\code{skewpart()} returns a skew-symmetric matrix,
typically of the same class as \code{x} (or the closest
\dQuote{general} one, see \code{\LinkA{generalMatrix}{generalMatrix.Rdash.class}}).
\end{Value}
\begin{Examples}
\begin{ExampleCode}
m <- Matrix(1:4, 2,2)
symmpart(m)
skewpart(m)

stopifnot(all(m == symmpart(m) + skewpart(m)))
\end{ExampleCode}
\end{Examples}

