Function
should_continue
(counts: &[usize], threshold: f64, min_clusters: usize)
Source from the content-addressed store, hash-verified
| 5 | |
| 6 | #[allow(dead_code)] |
| 7 | pub fn should_continue(counts: &[usize], threshold: f64, min_clusters: usize) -> bool { |
| 8 | let mean_count = counts.iter().sum::<usize>() as f64 / counts.len() as f64; |
| 9 | let threshold_count = mean_count * (1.0 + threshold); |
| 10 | counts |
| 11 | .iter() |
| 12 | .filter(|&&count| count as f64 > threshold_count) |
| 13 | .count() |
| 14 | >= min_clusters |
| 15 | } |
| 16 | |
| 17 | #[allow(dead_code)] |
| 18 | pub fn concat_vectors(vectors: &[&[f32]]) -> Vec<i8> { |
Callers
nothing calls this directly
Tested by
no test coverage detected