def _numpy_matrix_to_zero(e):
 if (not np):
  raise ImportError
 test = np.zeros_like(e)
 if np.allclose(e, test):
  return 0.0
 else:
  return e

def _numpy_matrix_to_zero ( e ) : if ( not np ) : raise ImportError test = np . zeros_like ( e ) if np . allclose ( e , test ) : return 0.0 else : return e
convert a numpy zero matrix to the zero scalar .