Skip to content

Commit

Permalink
enlarge unsafe block in factor
Browse files Browse the repository at this point in the history
  • Loading branch information
goulart-paul committed May 29, 2024
1 parent eac9d5c commit eb6c5d9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/qdldl/qdldl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,14 @@ fn _factor_inner<T: FloatT>(
for (&Lxj, &Lij) in zip(&Lx[f..l], &Li[f..l]) {
*(y_vals.get_unchecked_mut(Lij)) -= Lxj * y_vals_cidx;
}
}

// Now I have the cidx^th element of y = L\b.
// so compute the corresponding element of
// this row of L and put it into the right place
Lx[tmp_idx] = y_vals_cidx * Dinv[cidx];
D[k] -= y_vals_cidx * Lx[tmp_idx];
// Now I have the cidx^th element of y = L\b.
// so compute the corresponding element of
// this row of L and put it into the right place
let Lx_tmp_idx = y_vals_cidx * *Dinv.get_unchecked(cidx);
*Lx.get_unchecked_mut(tmp_idx) = Lx_tmp_idx;
*D.get_unchecked_mut(k) -= y_vals_cidx * Lx_tmp_idx;
}
}

// record which row it went into
Expand Down

0 comments on commit eb6c5d9

Please sign in to comment.