% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/isSymmetric.R
\name{isSymmetricTensor}
\alias{isSymmetricTensor}
\title{Check if a matrix or tensor is symmetric}
\usage{
isSymmetricTensor(x, tol = 1e-10)
}
\arguments{
\item{x}{A matrix or rTensor Tensor object}

\item{tol}{Numeric tolerance for comparison (default: 1e-10)}
}
\value{
Logical indicating whether x is symmetric
}
\description{
For a matrix, checks if A[i,j] == A[j,i] for all i,j.
For a tensor, checks if the tensor is invariant under all permutations
of its indices (i.e., fully symmetric).
}
\examples{
# Matrix
A <- matrix(c(1,2,2,3), 2, 2)
isSymmetricTensor(A)  # TRUE

# 3-mode symmetric tensor
library(rTensor)
arr <- array(0, dim = c(3, 3, 3))
for (i in 1:3) for (j in 1:3) for (k in 1:3) {
  arr[i, j, k] <- i + j + k
}
isSymmetricTensor(as.tensor(arr))  # TRUE
}
