# HG changeset patch # User Tuomo Valkonen # Date 1666451569 -10800 # Node ID df3901ec2f5d2bee96ef263be39adfb0b4c9df53 # Parent 9f27689eb1302a2bb02cd0819fba8fc693d38697 Fix some unit tests after fundamental changes that made them invalid diff -r 9f27689eb130 -r df3901ec2f5d src/fe_model/p2_local_model.rs --- a/src/fe_model/p2_local_model.rs Sat Oct 22 13:47:15 2022 +0300 +++ b/src/fe_model/p2_local_model.rs Sat Oct 22 18:12:49 2022 +0300 @@ -376,7 +376,6 @@ self.minimise_edge(&x2, &x3), self.minimise_edge(&x3, &x0)]; - for edge in more_edge { if edge.1 < min_edge.1 { min_edge = edge; @@ -433,7 +432,7 @@ let domain = Simplex(vertices); // A simple quadratic function for which the approximation is exact on reals, // and appears exact on f64 as well. - let f = |&Loc([x, y]) : &Loc| x*x + x*y + x - y + 1.0; + let f = |&Loc([x, y]) : &Loc| - (x*x + x*y + x - 2.0 * y + 1.0); let model = domain.p2_model(f); let xs = [Loc([0.5, 0.5]), Loc([0.25, 0.25])]; @@ -441,6 +440,6 @@ assert_eq!(model.value(&x), f(&x)); } - assert_eq!(model.minimise(&domain), (Loc([1.0, 1.0]), 3.0)); + assert_eq!(model.minimise(&domain), (Loc([1.0, 0.0]), -3.0)); } } diff -r 9f27689eb130 -r df3901ec2f5d src/iterate.rs --- a/src/iterate.rs Sat Oct 22 13:47:15 2022 +0300 +++ b/src/iterate.rs Sat Oct 22 18:12:49 2022 +0300 @@ -908,8 +908,9 @@ .iter() .map(|LogItem{ data : v, iter : _ }| v.clone()) .collect::>(), - (0..10).step_by(3) - .map(|i| (2 as int).pow(i+1)) + (1..10).map(|i| (2 as int).pow(i)) + .skip(2) + .step_by(3) .collect::>()) } }