Add this function somewhere with the other utility functions
(vector: &Vector)
| 398 | } |
| 399 | // Add this function somewhere with the other utility functions |
| 400 | fn compute_vector_hash(vector: &Vector) -> u64 { |
| 401 | use std::collections::hash_map::DefaultHasher; |
| 402 | use std::hash::{Hash, Hasher}; |
| 403 | |
| 404 | let mut hasher = DefaultHasher::new(); |
| 405 | for val in vector { |
| 406 | val.to_bits().hash(&mut hasher); // Convert f64 to bits before hashing |
| 407 | } |
| 408 | hasher.finish() |
| 409 | } |
| 410 | fn main() { |
| 411 | let n_base_vectors = 200; |
| 412 | let n_perturbations = 50; |