IsIdempotent
Tests if a matrix is idempotent.
Syntax
-
IsIdempotent(A[, ε])
-
A
is a matrix -
ε
is a positive number
-
Description
IsIdempotent(A, ε)
returns true
iff A
is idempotent, that is, iff A^2 = A
, using ε
as the epsilon for floating-point comparisons.
Examples
A ≔ [IdentityMatrix(3) + ReflectionMatrix(❨3, 1, −2❩)] / 2
⎛ 0.357142857143 −0.214285714286 0.428571428571⎞ ⎜−0.214285714286 0.928571428571 0.142857142857⎟ ⎝ 0.428571428571 0.142857142857 0.714285714286⎠
IsIdempotent(A)
true