src/prox_penalty/wave.rs

changeset 76
b921ed0ab99b
parent 75
677a5fd1b014
equal deleted inserted replaced
75:677a5fd1b014 76:b921ed0ab99b
104 let mut d = &*τv + self.preapply(μ.sub_matching(&μ_base)); 104 let mut d = &*τv + self.preapply(μ.sub_matching(&μ_base));
105 105
106 // If no merging heuristic is used, let's be more conservative about spike insertion, 106 // If no merging heuristic is used, let's be more conservative about spike insertion,
107 // and skip it after first round. If merging is done, being more greedy about spike 107 // and skip it after first round. If merging is done, being more greedy about spike
108 // insertion also seems to improve performance. 108 // insertion also seems to improve performance.
109 let skip_by_rough_check = if config.merging.enabled { 109 let skip_by_rough_check = config.conservative && (!config.merging.enabled || count > 0);
110 false
111 } else {
112 count > 0
113 };
114 110
115 // Find a spike to insert, if needed 111 // Find a spike to insert, if needed
116 let (ξ, _v_ξ, in_bounds) = 112 let (ξ, _v_ξ, in_bounds) =
117 match reg.find_tolerance_violation(&mut d, τ, ε, skip_by_rough_check, config) { 113 match reg.find_tolerance_violation(&mut d, τ, ε, skip_by_rough_check, config) {
118 None => break 'insertion true, 114 None => break 'insertion true,

mercurial