From 9acaa35e33964915507a6124fdae318af6503a7f Mon Sep 17 00:00:00 2001 From: Marc Haubenstock Date: Sat, 22 Oct 2022 21:26:09 +0200 Subject: [PATCH] fixed iteration --- nalgebra-lapack/src/eigen.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nalgebra-lapack/src/eigen.rs b/nalgebra-lapack/src/eigen.rs index 995d765e..5f621dbf 100644 --- a/nalgebra-lapack/src/eigen.rs +++ b/nalgebra-lapack/src/eigen.rs @@ -186,8 +186,9 @@ where true => Some(Vec::, D>>::with_capacity(number_of_complex_entries)), false => None }; - - for mut c in 0..number_of_elements_value { + + let mut c = 0; + while c < number_of_elements_value { if self.eigenvalues_im[c] != T::zero() { //Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first. eigenvalues.push(Complex::::new(self.eigenvalues_re[c].clone(), self.eigenvalues_im[c].clone()));