powered by
Checks that the input is a diagonal matrix.
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))
is_diagonal_matrix(x, tol = 100 * .Machine$double.eps, .xname = get_name_in_parent(x))
Input to check.
Absolute values smaller than tol are not considered.
tol
How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".
"stop"
"warning"
"message"
"none"
Not intended to be used directly.
TRUE if the input is all zeroes (after coercion to be a matrix).
TRUE
# 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) # }
Run the code above in your browser using DataLab