Crates.io | cbsrs |
lib.rs | cbsrs |
version | 0.1.0 |
source | src |
created_at | 2024-02-05 11:23:28.558325 |
updated_at | 2024-02-05 11:23:28.558325 |
description | A Circular Binary Segmentation algorithm |
homepage | |
repository | |
max_upload_size | |
id | 1127494 |
size | 9,492 |
cbsrs
The cbsrs
crate implements the Circular Binary Segmentation algorithm (1) based on code from (2).
It exposes an extremely simple API, as a trait which operates only on Vec<usize>
.
use cbsrs::CBS;
let steps: Vec<usize> = vec![1, 1, 1, 3, 3, 2, 1, 2, 3, 300, 310, 321, 310, 299];
let shuffles = 1000;
let p = 0.05;
let res = steps.cbs(shuffles, p).unwrap();
for (start, end) in res.iter() {
println!("{start}-{end}");
}
This implementation omits the 'validation' algorithm seen in other implementations.