Algosim documentation: IsScalar

IsScalar

Tests if a matrix is a scalar multiple of the identity matrix.

Syntax

Description

If A is a matrix then IsScalar(A, ε) is true iff A is square and there is a number z such that A[i, j] is equal to z if i = j and equal to 0 otherwise (all comparisons made with epsilon ε).

Examples

IsScalar(❨❨5, 0, 0❩, ❨0, 5, 0❩, ❨0, 0, 5❩❩)
true

See also