Skip to content

Commit

Permalink
Reformat to compile in old version
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianKnodt committed Sep 25, 2023
1 parent e6ef90d commit 8651982
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions nalgebra-sparse/src/csc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,18 +686,20 @@ impl<T> CscMatrix<T> {
for (i, &row) in out_sparsity_pattern.iter().enumerate() {
let col = self.col(row);
let mut iter = col.row_indices().iter().zip(col.values().iter()).peekable();
if !assume_unit && let Some(l_val) = iter.find(|v| *v.0 >= row) && *l_val.0 == row{
out[i] /= *l_val.1;
if !assume_unit {
match iter.find(|v| *v.0 >= row) {
Some((&r, &l_val)) if r == row => out[i] /= l_val,
_ => {}
}
}
let mul = out[i];
for (offset, &nrow) in out_sparsity_pattern[i..].iter().enumerate() {
if nrow <= row {
continue;
}
let l_val = if let Some(l_val) = iter.find(|v| *v.0 >= nrow) && *l_val.0 == nrow {
*l_val.1
} else {
break;
let l_val = match iter.find(|v| *v.0 >= nrow) {
Some((&r, &l_val)) if r == nrow => l_val,
_ => break,
};
out[i + offset] -= l_val * mul;
}
Expand Down

0 comments on commit 8651982

Please sign in to comment.