Skip to content

Commit 0fb4b2b

Browse files
authored
fix: add relative termination for power iteration (#101)
1 parent b113780 commit 0fb4b2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ double estimate_maximum_singular_value(cusparseHandle_t sparse_handle,
157157
double residual_norm;
158158
CUBLAS_CHECK(cublasDnrm2_v2_64(blas_handle, m, next_eigenvector_d, 1, &residual_norm));
159159

160-
if (residual_norm < tolerance)
160+
if (residual_norm < tolerance * fmin(1.0, sigma_max_sq))
161161
break;
162162
}
163163

0 commit comments

Comments
 (0)