1 /*! |
1 // Optimisation on non-Riemannian manifolds. |
2 Optimisation on non-Riemannian manifolds. |
2 #![doc = include_str!(concat!(env!("OUT_DIR"), "/README_uglified.md"))] |
3 */ |
|
4 |
3 |
5 // We use unicode. We would like to use much more of it than Rust allows. |
4 // We use unicode. We would like to use much more of it than Rust allows. |
6 // Live with it. Embrace it. |
5 // Live with it. Embrace it. |
7 #![allow(uncommon_codepoints)] |
6 #![allow(uncommon_codepoints)] |
8 #![allow(mixed_script_confusables)] |
7 #![allow(mixed_script_confusables)] |
138 run_and_save(dir, "x2", &f, &g, OnCube::new(F2, Loc([0.3, 0.1])), τ, logmap)?; |
137 run_and_save(dir, "x2", &f, &g, OnCube::new(F2, Loc([0.3, 0.1])), τ, logmap)?; |
139 run_and_save(dir, "x3", &f, &g, OnCube::new(F6, Loc([0.6, 0.2])), τ, logmap) |
138 run_and_save(dir, "x3", &f, &g, OnCube::new(F6, Loc([0.6, 0.2])), τ, logmap) |
140 } |
139 } |
141 |
140 |
142 |
141 |
143 /// A simple test on the cube |
142 /// A simple test on a [`Cylinder`]. |
144 fn simple_cylinder_test(dir : &str) -> DynError { |
143 fn simple_cylinder_test(dir : &str) -> DynError { |
145 let π = f64::PI; |
144 let π = f64::PI; |
146 |
145 |
147 let cyl = Cylinder { |
146 let cyl = Cylinder { |
148 radius : 1.0, |
147 radius : 1.0, |
200 run_and_save(dir, "x3", &f, &g, cyl.on_bottom(-π*0.3, 0.9), τ, logmap) |
199 run_and_save(dir, "x3", &f, &g, cyl.on_bottom(-π*0.3, 0.9), τ, logmap) |
201 |
200 |
202 } |
201 } |
203 |
202 |
204 |
203 |
205 /// Runs [forward_backward] and saves the results. |
204 /// Runs [`forward_backward`] and saves the results. |
206 pub fn run_and_save<F, G, M, I>( |
205 pub fn run_and_save<F, G, M, I>( |
207 dir : &str, |
206 dir : &str, |
208 name : &str, |
207 name : &str, |
209 f : &F, |
208 f : &F, |
210 g : &G, |
209 g : &G, |