Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dimforge/nalgebra
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9007c02e5fd143c75f8f5296e7a5189d4e8de922
Choose a base ref
..
head repository: dimforge/nalgebra
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 31fce094c46849b4eedf185067929ec8a83769b3
Choose a head ref
Showing with 11 additions and 7 deletions.
  1. +11 −7 nalgebra-sparse/src/csc.rs
18 changes: 11 additions & 7 deletions nalgebra-sparse/src/csc.rs
Original file line number Diff line number Diff line change
@@ -571,10 +571,12 @@ impl<T> CscMatrix<T> {
let col = self.col(i);
let mut iter = col.row_indices().iter().zip(col.values().iter()).peekable();
while iter.next_if(|n| *n.0 < i).is_some() {}
if let Some(n) = iter.peek() && *n.0 == i && !unit_diagonal {
assert!(*n.0 <= i);
out[i] /= *n.1;
iter.next();
if let Some(n) = iter.peek() {
if *n.0 == i && !unit_diagonal {
assert!(*n.0 <= i);
out[i] /= *n.1;
iter.next();
}
}
let mul = out[i];
for (&ri, &v) in col.row_indices().iter().zip(col.values().iter()) {
@@ -609,9 +611,11 @@ impl<T> CscMatrix<T> {
.rev()
.peekable();
while iter.next_if(|n| *n.0 > i).is_some() {}
if let Some(n) = iter.peek() && *n.0 == i {
out[i] /= *n.1;
iter.next();
if let Some(n) = iter.peek() {
if *n.0 == i {
out[i] /= *n.1;
iter.next();
}
}
// introduce a NaN, intentionally, if the diagonal doesn't have a value.
let mul = out[i];