% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Symmetrize.R
\name{Symmetrize}
\alias{Symmetrize}
\title{Symmetrize a matrix or tensor}
\usage{
Symmetrize(x)
}
\arguments{
\item{x}{A matrix or rTensor Tensor object (must have equal modes)}
}
\value{
Symmetrized matrix or Tensor
}
\description{
For a matrix, computes (A + A^T) / 2.
For a tensor, averages over all permutations of indices.
}
\examples{
A <- matrix(c(1, 2, 3, 4), 2, 2)
Symmetrize(A)

library(rTensor)
arr <- array(rnorm(27), dim = c(3, 3, 3))
S <- Symmetrize(as.tensor(arr))
isSymmetricTensor(S)  # TRUE
}
