assert_is_lower_triangular_matrix

0th

Percentile

Is the matrix upper/lower triangular?

Checks that the input is an upper or lower triangular matrix.

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

assert_is_upper_triangular_matrix(x, strictly = FALSE, tol = 100 * .Machine$double.eps, severity = getOption("assertive.severity", "stop"))

is_lower_triangular_matrix(x, strictly = FALSE, tol = 100 * .Machine$double.eps, .xname = get_name_in_parent(x))

is_upper_triangular_matrix(x, strictly = FALSE, tol = 100 * .Machine$double.eps, .xname = get_name_in_parent(x))

Arguments
x

Input to check.

strictly

Logical. If TRUE, the diagonal must consist of zeroes.

tol

Abolute deviations from the expected 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_lower_triangular_matrix
  • assert_is_upper_triangular_matrix
  • is_lower_triangular_matrix
  • is_upper_triangular_matrix
Examples
# NOT RUN {
x <- matrix(c(1, 2, 3, 0, 5, 6, 0, 0, 9), nrow = 3)
is_lower_triangular_matrix(x)
is_lower_triangular_matrix(x, strictly = TRUE)
is_upper_triangular_matrix(t(x))
is_upper_triangular_matrix(t(x), strictly = TRUE)
x[1, 2] <- 100 * .Machine$double.eps
is_lower_triangular_matrix(x)
x[2, 3] <- 101 * .Machine$double.eps
is_lower_triangular_matrix(x)
# }
Documentation reproduced from package assertive.matrices, version 0.0-2, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.