is_diagonal {qfratio}R Documentation

Is this matrix diagonal?

Description

This internal function is used to determine whether a square matrix is diagonal (within a specified tolerance). Returns TRUE when the absolute values of all off-diagonal elements are below tol, using all.equal().

Usage

is_diagonal(A, tol = .Machine$double.eps * 100, symmetric = FALSE)

Arguments

A

Square matrix. No check is done.

tol

Numeric to specify tolerance in all.equal()

symmetric

If FALSE (default), sum of absolute values of the corresponding lower and upper triangular elements are examined with a doubled tol. If TRUE, only the lower triangular elements are examined assuming symmetry.

See Also

all.equal


[Package qfratio version 1.1.1 Index]