Learn R Programming

Matrix (version 0.3-19)

LowerTriangular.test: Test a Matrix for Triangularity

Description

LowerTriangular.test (UpperTriangular.test) returns the maximum modulus of the strict upper (lower) triangle of x. is.LowerTriangular and is.UpperTriangular check if this value is less than a tolerance.

Usage

is.LowerTriangular(x, tol = 0)
is.UpperTriangular(x, tol = 0)
LowerTriangular.test(x)
UpperTriangular.test(x)

Arguments

x
a numeric or complex matrix.
tol
tolerance for the maximum modulus of the elements in the upper (or lower) triangle of the matrix.

Value

  • LowerTriangular.test (UpperTriangular.test) returns the maximum modulus of the elements in the strict upper (lower) triangle of the matrix x. is.LowerTriangular (is.UpperTriangular) returns a logical value according to whether the result of LowerTriangular.test (UpperTriangular.test) is less than or equal to tol.

Examples

Run this code
x <- hilbert(9)
x[row(x) > col(x)] <- 0
is.UpperTriangular(x, tol = 0)
UpperTriangular.test(x)

Run the code above in your browser using DataLab