1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! # mini_myers
//!
//! SIMD implementation of the Myers bitvector algorithm specifically to test
//! whether short queries (<=64 nucleotides) are present in a longer DNA sequence with at most `k` edits.
//!
//! ## Features
//!
//! - **Batch processing**: Process 8 or 16 queries simultaneously depending on their length
//! - **Flexible backends**: Choose between `U32` (8 lanes) or `U64` (4 lanes) for different query lengths
//! - **Multiple modes**: Scan for minimum costs or find all match positions
//!
//! ## When to use
//!
//! - Short queries (≤32 nucleotides with U32 backend, ≤64 with U64)
//! - Multiple queries to search (best performance with multiples of 8)
//! - Need edit distance or match positions
//! - Supports DNA IUPAC codes (A, C, G, T, N, etc)
//!
//! ## Example
//!
//! ```rust
//! use mini_myers::{Searcher, Scan, Positions};
//! use mini_myers::backend::{U32, U64};
//!
//! // Create a searcher for scan mode with U32 backend
//! let mut searcher = Searcher::<U32, Scan>::new();
//! let queries = vec![b"ATG".to_vec(), b"TTG".to_vec()];
//! let encoded = searcher.encode(&queries);
//! let target = b"CCCTCGCCCCCCATGCCCCC";
//!
//! // Scan mode: get minimum cost per query
//! let results = searcher.search(&encoded, target, 4, None);
//! assert_eq!(results, vec![0.0, 1.0]);
//!
//! // Positions mode: get all match positions
//! let mut pos_searcher = Searcher::<U32, Positions>::new();
//! let encoded = pos_searcher.encode(&queries);
//! let results = pos_searcher.search(&encoded, target, 4, None);
//! println!("Found {} matches", results.len());
//!
//! // Use U64 backend for longer queries (up to 64 nucleotides)
//! let mut searcher64 = Searcher::<U64, Scan>::new();
//! let encoded = searcher64.encode(&queries);
//! let results = searcher64.search(&encoded, target, 4, None);
//! ```
//!
//! ## Performance
//!
//! For 32 queries of length 24 in a 100K DNA string with k=4:
//! - mini_myers: ~23 µs/query
//! - See benchmarks for detailed comparisons
// These traits are needed for both versions (cmp_eq/simd_eq and cmp_gt/simd_gt)
// Re-export commonly used items at the crate root
pub use ;
pub use ;
pub use TQueries;