File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 44use crate :: common:: ib_to_bf_prec;
55use crate :: math:: { floorlog, pow_sqrt2, sqrt2} ;
66use crate :: region:: Interval ;
7+ use crate :: ring:: z_root_two:: LAMBDA ;
78use crate :: ring:: { DRootTwo , ZRootTwo } ;
89use dashu_float:: round:: mode:: HalfEven ;
910use dashu_float:: FBig ;
1011use dashu_int:: IBig ;
1112use std:: iter;
1213
13- const LAMBDA : ZRootTwo = ZRootTwo {
14- a : IBig :: ONE ,
15- b : IBig :: ONE ,
16- } ;
17-
1814pub fn solve_odgp ( i : Interval , j : Interval ) -> impl Iterator < Item = ZRootTwo > {
1915 // Can't return two different iterator types. So we can't do this check.
2016 // I checked with dbg! to confirm that omitting this check is ok:
Original file line number Diff line number Diff line change 44mod d_omega;
55mod d_root_two;
66mod z_omega;
7- mod z_root_two;
7+ pub mod z_root_two;
88
99pub use d_omega:: DOmega ;
1010pub use d_root_two:: DRootTwo ;
Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ pub struct ZRootTwo {
1818 pub ( crate ) b : IBig ,
1919}
2020
21+ // See Definition 3.5 on pg 3 of R+S for the definition of lambda (and delta)
22+ // Careful! There is a different, unrelated defintion of lambda in
23+ // the discussion in Definition 9.1 on page 19 of R+S. It is in fact
24+ // the fixed phase factor used in the up-to-phase algorithm.
25+ pub const LAMBDA : ZRootTwo = ZRootTwo {
26+ a : IBig :: ONE ,
27+ b : IBig :: ONE ,
28+ } ;
29+
2130impl ZRootTwo {
2231 pub fn new ( a : IBig , b : IBig ) -> Self {
2332 Self { a, b }
Original file line number Diff line number Diff line change @@ -8,14 +8,11 @@ use crate::common::ib_to_bf_prec;
88use crate :: grid_op:: { EllipsePair , GridOp } ;
99use crate :: math:: { floorsqrt, log} ;
1010use crate :: region:: { Ellipse , Rectangle } ;
11- use crate :: ring:: { ZOmega , ZRootTwo } ;
11+ use crate :: ring:: z_root_two:: LAMBDA ;
12+ use crate :: ring:: ZOmega ;
1213use crate :: tdgp:: Region ;
1314use dashu_int:: IBig ;
1415use num_traits:: Pow ;
15- const LAMBDA : ZRootTwo = ZRootTwo {
16- a : IBig :: ONE ,
17- b : IBig :: ONE ,
18- } ;
1916
2017fn reduction (
2118 ellipse_pair : EllipsePair ,
You can’t perform that action at this time.
0 commit comments