Test for Symmetry or Conjugate Symmetry in a Matrix

DESCRIPTION:
Either tests whether or not a Matrix is real symmetric or complex Hermitian, or else gives a metric by which such a test can be made.

USAGE:
is.Hermitian(x, tol)
Hermitian.test(x)

REQUIRED ARGUMENTS:
x:
an numeric or complex matrix.

OPTIONAL ARGUMENTS:
tol:
tolerance for the maximum modulus for the difference between elements in the lower triangle and the corresponding elements in the upper triangle.

VALUE:
For is.Hermitian, a logical value is returned. If tol is missing, this value is equivalent to inherits(x, "Hermitian"). Otherwise the result is TRUE if the maximum modulus for the difference between elements in the lower triangle and the corresponding elements in the upper triangle is less than or equal to tol, and FALSE otherwise. For Hermitian.test, the maximum modulus for the difference between elements in the lower triangle and the corresponding elements in the upper triangle is returned.

EXAMPLES:
x <- Matrix(1:9,3,3)
x[row(x) > col(x)] <- t(x)[row(x) > col(x)]
is.Hermitian(x)
# [1] F

is.Hermitian(x, tol = 0) # [1] T

Hermitian.test(x) # [1] 0