| 50 ε: F, |
50 ε: F, |
| 51 config: &InsertionConfig<F>, |
51 config: &InsertionConfig<F>, |
| 52 reg: &Reg, |
52 reg: &Reg, |
| 53 _state: &AlgIteratorIteration<I>, |
53 _state: &AlgIteratorIteration<I>, |
| 54 stats: &mut IterInfo<F>, |
54 stats: &mut IterInfo<F>, |
| 55 ) -> DynResult<(Option<Self::ReturnMapping>, bool)> |
55 ) -> DynResult<bool> |
| 56 where |
56 where |
| 57 I: AlgIterator, |
57 I: AlgIterator, |
| 58 { |
58 { |
| 59 // If no merging heuristic is used, let's be more conservative about spike insertion, |
59 // If no merging heuristic is used, let's be more conservative about spike insertion, |
| 60 // and skip it after first round. If merging is done, being more greedy about spike |
60 // and skip it after first round. If merging is done, being more greedy about spike |
| 61 // insertion also seems to improve performance. |
61 // insertion also seems to improve performance. |
| 62 let skip_by_rough_check = !config.merging.enabled; |
62 let skip_by_rough_check = !config.merging.enabled; |
| 63 let violation = reg.find_tolerance_violation(τv, τ, ε, skip_by_rough_check, config); |
63 let violation = reg.find_tolerance_violation(τv, τ, ε, skip_by_rough_check, config); |
| 64 reg.solve_oc_radonsq(μ, τv, τ, ε, violation, config, stats); |
64 reg.solve_oc_radonsq(μ, τv, τ, ε, violation, config, stats); |
| 65 |
65 |
| 66 Ok((None, true)) |
66 Ok(true) |
| |
67 } |
| |
68 |
| |
69 fn reweigh<I>( |
| |
70 &self, |
| |
71 μ: &mut DiscreteMeasure<Domain, F>, |
| |
72 τv: &mut M, |
| |
73 τ: F, |
| |
74 ε: F, |
| |
75 config: &InsertionConfig<F>, |
| |
76 reg: &Reg, |
| |
77 _state: &AlgIteratorIteration<I>, |
| |
78 stats: &mut IterInfo<F>, |
| |
79 ) -> DynResult<()> |
| |
80 where |
| |
81 I: AlgIterator, |
| |
82 { |
| |
83 reg.solve_oc_radonsq(μ, τv, τ, ε, None, config, stats); |
| |
84 Ok(()) |
| 67 } |
85 } |
| 68 |
86 |
| 69 fn merge_spikes( |
87 fn merge_spikes( |
| 70 &self, |
88 &self, |
| 71 μ: &mut DiscreteMeasure<Domain, F>, |
89 μ: &mut DiscreteMeasure<Domain, F>, |