File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33name = " ndarray"
44version = " 0.17.2"
55edition = " 2021"
6- rust-version = " 1.64 "
6+ rust-version = " 1.94 "
77authors = [
88 " Ulrik Sverdrup \" bluss\" " ,
99 " Jim Turner"
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ impl ProductQuantizer {
257257// Method 5: SPO Bundle (our method)
258258// ============================================================================
259259
260- const PHI : f64 = 1.618_033_988_749_895 ;
260+ const PHI : f64 = std :: f64 :: consts :: GOLDEN_RATIO ;
261261
262262const fn golden_shift ( d : usize ) -> usize {
263263 let raw = ( d as f64 / ( PHI * PHI ) ) as usize ;
Original file line number Diff line number Diff line change 1111// Constants
1212// ============================================================================
1313
14- /// Golden ratio φ ≈ 1.618033988749895
15- const PHI : f64 = 1.618_033_988_749_895 ;
14+ /// Golden ratio φ — Rust 1.94 stdlib constant.
15+ const PHI : f64 = std :: f64 :: consts :: GOLDEN_RATIO ;
1616
1717/// Compute golden shift for dimension d, ensuring odd (gcd=1 with power-of-2 d).
1818/// floor(d / φ²), rounded to nearest odd.
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ use super::fingerprint::Fingerprint;
1717/// Golden angle in radians: 2π / φ² ≈ 2.39996...
1818const GOLDEN_ANGLE : f64 = 2.399_963_229_728_653 ;
1919
20- /// Euler-Mascheroni constant γ ≈ 0.5772.. .
21- const EULER_GAMMA : f64 = 0.577_215_664_901_532_9 ;
20+ /// Euler-Mascheroni constant γ — Rust 1.94 stdlib constant .
21+ const EULER_GAMMA : f64 = std :: f64 :: consts :: EULER_GAMMA ;
2222
2323/// Bundle dimensionality: 8192 f64 values (must be even for Givens pairs)
2424const D : usize = 8192 ;
Original file line number Diff line number Diff line change @@ -466,9 +466,7 @@ mod tests {
466466 fn test_f64_golden_step_hydration_cost ( ) {
467467 use std:: f64:: consts;
468468 // Rust 1.94: std::f64::consts::PHI and GAMMA are stable.
469- // On 1.93: define manually.
470- #[ allow( dead_code) ]
471- const PHI : f64 = 1.618033988749894848204586834365638118 ;
469+ const PHI : f64 = std:: f64:: consts:: GOLDEN_RATIO ;
472470
473471 // Simulate: 4096D f64 vector → Base17-style projection → hydration back
474472 let d = 4096usize ;
You can’t perform that action at this time.
0 commit comments