forked from M-Labs/nalgebra
removed useless if
This commit is contained in:
parent
d4d3f69429
commit
19fce3addc
@ -159,6 +159,7 @@ where
|
||||
let mut x = x.clone_owned();
|
||||
let mut beta = crate::one::<N::RealField>();
|
||||
for j in 0..n {
|
||||
// updates the diagonal
|
||||
let diag = N::real(unsafe { *self.chol.get_unchecked((j, j)) });
|
||||
let diag2 = diag * diag;
|
||||
let xj = unsafe { *x.get_unchecked(j) };
|
||||
@ -167,8 +168,7 @@ where
|
||||
let new_diag = (diag2 + sigma_xj2 / beta).sqrt();
|
||||
unsafe { *self.chol.get_unchecked_mut((j, j)) = N::from_real(new_diag) };
|
||||
beta += sigma_xj2 / diag2;
|
||||
// Update the terms of L
|
||||
if j < n {
|
||||
// updates the terms of L
|
||||
let mut xjplus = x.rows_range_mut(j + 1..);
|
||||
let mut col_j = self.chol.slice_range_mut(j + 1.., j);
|
||||
// temp_jplus -= (wj / N::from_real(diag)) * col_j;
|
||||
@ -183,7 +183,6 @@ where
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<N: ComplexField, D: DimSub<Dynamic>, S: Storage<N, D, D>> SquareMatrix<N, D, S>
|
||||
|
Loading…
Reference in New Issue
Block a user