style: apply rustfmt across all crates and demos
Consistent formatting pass: line wrapping, import sorting, trailing whitespace removal, let-chain indentation, merged derive attributes, and unsafe block reformatting. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -621,7 +621,9 @@ impl DipoleFitter {
|
||||
|
||||
for iter in 0..self.config.max_iter {
|
||||
// Compute gain at current position
|
||||
let gain = if let Ok(g) = self.compute_gain_at_position(&pos) { self.whiten_gain(&g) } else {
|
||||
let gain = if let Ok(g) = self.compute_gain_at_position(&pos) {
|
||||
self.whiten_gain(&g)
|
||||
} else {
|
||||
// Position outside head, move back toward center
|
||||
let alpha = 0.5;
|
||||
pos = [
|
||||
@@ -666,7 +668,9 @@ impl DipoleFitter {
|
||||
// Damped normal equations: (J^T J + λI) Δp = J^T r
|
||||
let jtj_damped = &jtj + DMatrix::identity(3, 3) * lambda;
|
||||
|
||||
let delta_pos = if let Some(inv) = jtj_damped.try_inverse() { inv * &jtr } else {
|
||||
let delta_pos = if let Some(inv) = jtj_damped.try_inverse() {
|
||||
inv * &jtr
|
||||
} else {
|
||||
lambda *= 10.0;
|
||||
continue;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user