assert_is_diagonal_matrix

0th

Percentile

Is the input a diagonal matrix?

Checks that the input is a diagonal matrix.

Usage
assert_is_diagonal_matrix(x, tol = 100 * .Machine$double.eps,
  severity = getOption("assertive.severity", "stop"))

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

Arguments
x

Input to check.

tol

Absolute values smaller than tol are not considered.

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 all zeroes (after coercion to be a matrix).

Aliases
  • assert_is_diagonal_matrix
  • is_diagonal_matrix
Examples
# NOT RUN {
x <- diag(3)
is_diagonal_matrix(x)
x[1, 2] <- 100 * .Machine$double.eps
is_diagonal_matrix(x)
x[2, 3] <- 101 * .Machine$double.eps
is_diagonal_matrix(x)
# }
Documentation reproduced from package assertive.matrices, version 0.0-2, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.