fatf.utils.data.tools.validate_binary_matrix

fatf.utils.data.tools.validate_binary_matrix(binary_array, name=None)[source]

Validates a binary, square and symmetric numpy array.

Parameters
binary_arraynumpy.ndarray

A square (equal number of rows and columns), boolean symmetric numpy array.

Returns
is_validboolean

True if the matrix is valid, False otherwise.

Raises
IncorrectShapeError

The matrix is not 2-dimensional or square.

TypeError

The matrix is not of boolean type.

ValueError

The matrix is a structured numpy array or is not diagonally symmetric.