is_symmetric {xnet}R Documentation

Test symmetry of a matrix

Description

The function isSymmetric tests for symmetry of a matrix but also takes row and column names into account. This function is a toned-down (and slightly faster) version that ignores row and column names. Currently, the function only works for real matrices, not complex ones.

Usage

is_symmetric(x, tol = 100 * .Machine$double.eps)

Arguments

x

a matrix to be tested.

tol

the tolerance for comparing the numbers.

Value

a logical value indicating whether or not the matrix is symmetric

Examples

x <- matrix(1:16,ncol = 4)
is_symmetric(x)

x <- x %*% t(x)
is_symmetric(x)


[Package xnet version 0.1.11 Index]