Skip to content

Commit 8cf8a58

Browse files
refactor: remove dead loop in n_j guard and suppress clippy warning
- Remove no-op loop in spike-and-slab n_j < 1e-12 guard: beta[j] is 0.0 so x_col[t] * 0.0 = 0.0 never changes the residual - Add #[allow(clippy::too_many_arguments)] to sample_state_path to eliminate the last remaining clippy warning
1 parent aa17193 commit 8cf8a58

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/sampler.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ fn flatten_chain_results(mut chain_results: Vec<ChainResult>, n_samples: usize)
668668
result
669669
}
670670

671+
#[allow(clippy::too_many_arguments)]
671672
fn sample_state_path<R: rand::Rng>(
672673
rng: &mut R,
673674
y_adj: &[f64],
@@ -914,9 +915,7 @@ fn sample_spike_and_slab<R: rand::Rng>(
914915
if n_j < 1e-12 {
915916
gamma[j] = false;
916917
beta[j] = 0.0;
917-
for (t, r) in residual.iter_mut().enumerate().take(t_pre) {
918-
*r -= x_col[t] * beta[j];
919-
}
918+
// No residual update needed: beta[j] is 0, so x_col[t] * 0 = 0
920919
continue;
921920
}
922921

0 commit comments

Comments
 (0)