IsSymmetric: Test for a Symmetric Matrix

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/IsSymmetric.R

Description

IsSymmetric() returns TRUE if A is a symmetric matrix, and FALSE otherwise.

Usage

1
2
3
4
5
6
7
IsSymmetric(A)

## Default S3 method:
IsSymmetric(A)

## S3 method for class 'yac_symbol'
IsSymmetric(A)

Arguments

A

Input.

Details

An m \times m matrix \mathbf{A} is symmetric if

\mathbf{A} = \mathbf{A}^{\mathsf{T}} .

A is considered to be a symmetric matrix if all(A == t(A)) returns TRUE.

Value

Logical.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other predicate functions: IsDiagonal(), IsIdempotent(), IsInvertible(), IsMatrix(), IsNilpotent(), IsOrthogonal(), IsPositiveDefinite(), IsScalar(), IsSingular(), IsSquareMatrix(), IsVector(), MatrixCheck()

Examples

1
2
3
4
5
6
7
8
9
# TRUE
A <- matrix(
  data = c(1, 2, 3, 2, 4, 5, 3, 5, 6),
  ncol = 3
)
IsSymmetric(A)

# FALSE
IsSymmetric(matrix(1:10, ncol = 2))

jeksterslab/matrixR documentation built on Feb. 22, 2021, 8:10 a.m.