mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-31 05:13:39 +00:00
fix(hdc): Correct HYPERVECTOR_U64_LEN to 157 for 10,000 bit storage
The previous value of 156 only provided 9,984 bits (156*64), causing index out of bounds in bundle operations. Now correctly allocates 157 words (10,048 bits) to fit all 10,000 bits.
This commit is contained in:
parent
6e40b06e51
commit
e190c4789e
1 changed files with 3 additions and 3 deletions
|
|
@ -16,8 +16,8 @@ pub use memory::HdcMemory;
|
|||
/// Number of bits in a hypervector (10,000)
|
||||
pub const HYPERVECTOR_BITS: usize = 10_000;
|
||||
|
||||
/// Number of u64 words needed to store HYPERVECTOR_BITS (156 = ceil(10000/64))
|
||||
pub const HYPERVECTOR_U64_LEN: usize = 156;
|
||||
/// Number of u64 words needed to store HYPERVECTOR_BITS (157 = ceil(10000/64))
|
||||
pub const HYPERVECTOR_U64_LEN: usize = 157;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
|
@ -25,7 +25,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_constants() {
|
||||
assert_eq!(HYPERVECTOR_U64_LEN, 156);
|
||||
assert_eq!(HYPERVECTOR_U64_LEN, 157);
|
||||
assert_eq!(HYPERVECTOR_BITS, 10_000);
|
||||
assert!(HYPERVECTOR_U64_LEN * 64 >= HYPERVECTOR_BITS);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue