brainspace.gradient.utils.is_symmetric

brainspace.gradient.utils.is_symmetric(x, tol=1e-10)[source]

Check if input is symmetric.

Parameters:
  • x (2D ndarray or sparse matrix) – Input data.
  • tol (float, optional) – Maximum allowed tolerance for equivalence. Default is 1e-10.
Returns:

is_symm (bool) – True if x is symmetric. False, otherwise.

Raises:

ValueError – If x is not square.