Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion linear_algebra/src/power_iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def power_iteration(
lambda_ = np.dot(vector_h, np.dot(input_matrix, vector))

# Check convergence.
error = np.abs(lambda_ - lambda_previous) / lambda_
error = np.abs(lambda_ - lambda_previous) / np.abs(lambda_)
iterations += 1

if error <= error_tol or iterations >= max_iterations:
Expand Down
Loading