is_symmetric_matrix: Is the input a symmetric matrix?

Description Usage Arguments Value Examples

Description

Checks that the input is a symmetric matrix.

Usage

1
2
3
4
5
assert_is_symmetric_matrix(x, tol = 100 * .Machine$double.eps, ...,
  severity = getOption("assertive.severity", "stop"))

is_symmetric_matrix(x, tol = 100 * .Machine$double.eps,
  .xname = get_name_in_parent(x), ...)

Arguments

x

Input to check.

tol

Differences smaller than tol are not considered.

...

Passed to all.equal.

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

.xname

Not intended to be used directly.

Value

TRUE if the input is symmetric (after coercion to be a matrix).

Examples

1
2
3
4
m <- diag(3); m[3, 1] <- 1e-100
assert_is_symmetric_matrix(m)
#These examples should fail.
assertive.base::dont_stop(assert_is_symmetric_matrix(m, tol = 0))


Search within the assertive.matrices package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.