def safe_max_abs(A, ia):
 if np.sum(ia):
  return np.max(np.abs(A[ia]))
 else:
  return 0.0

def safe_max_abs ( A , ia ) : if np . sum ( ia ) : return np . max ( np . abs ( A [ ia ] ) ) else : return 0.0
compute np .