Defines matrices computation helpers objects.
Returns if given array_like variable \(x\) is an identity matrix.
Parameters: |
|
---|---|
Returns: | Is identity matrix. |
Return type: | bool |
Examples
>>> is_identity(np.array([1, 0, 0, 0, 1, 0, 0, 0, 1]).reshape(3, 3))
True
>>> is_identity(np.array([1, 2, 0, 0, 1, 0, 0, 0, 1]).reshape(3, 3))
False