Skip to content

Commit

Permalink
Update ngm/__init__.py
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Olesen <[email protected]>
  • Loading branch information
paigemiller and swo authored Jan 15, 2025
1 parent 7a2c0c9 commit fcd0933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ngm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def dominant_eigen(X: np.ndarray, norm: str = "L1") -> DominantEigen:
# check for complex numbers
if not np.isreal(value):
raise RuntimeError("Complex eigenvalue")
if np.iscomplex(vector).any() and not np.all(vector.imag == 0):
if not all(np.isreal(vector)):
raise RuntimeError("Complex numbers in eigenvector")

# Ensure the value and vector are real
Expand Down

0 comments on commit fcd0933

Please sign in to comment.