@@ -271,6 +271,10 @@ impl SeriesApproximation {
271271 derivative_probe += next_coefficients[ k] * self . approximation_probes_derivative [ i] [ k - 1 ] ;
272272 } ;
273273
274+ probe. reduce ( ) ;
275+ // series_probe.reduce();
276+ // derivative_probe.reduce();
277+
274278 let relative_error = ( probe - series_probe) . norm_square ( ) ;
275279 let mut derivative = derivative_probe. norm_square ( ) ;
276280
@@ -280,10 +284,14 @@ impl SeriesApproximation {
280284 derivative. exponent = 0 ;
281285 }
282286
287+ // println!("checking at: {}", *probe_iteration_level);
288+ // println!("relative error: {} derivative: {} delta_square: {}", relative_error, derivative, self.delta_pixel_square);
289+ // println!("probe: {} series_probe: {}", probe, series_probe);
290+
283291 // The first element is reduced, the second might need to be reduced a little more
284292 // Check that the error over the derivative is less than the pixel spacing
285- if relative_error / derivative > self . delta_pixel_square {
286- // println!("{} ", *probe_iteration_level);
293+ if relative_error / derivative > self . delta_pixel_square || relative_error . exponent > 0 {
294+ // println!("exceeded at: {} ", *probe_iteration_level);
287295
288296 if * probe_iteration_level <= ( current_probe_check_value + self . data_storage_interval + 1 ) {
289297 * probe_iteration_level = next_probe_check_value;
@@ -354,7 +362,18 @@ impl SeriesApproximation {
354362 }
355363 }
356364
357- // println!("{:?}", self.valid_interpolation);
365+ println ! ( "series approximation valid interpolation buffer:" ) ;
366+ let temp_size = self . probe_sampling - 1 ;
367+ for i in 0 ..temp_size {
368+ let test = & self . valid_interpolation [ ( i * temp_size) ..( ( i + 1 ) * temp_size) ] ;
369+ print ! ( "[" ) ;
370+
371+ for element in test {
372+ print ! ( "{:>8}," , element) ;
373+ }
374+
375+ print ! ( "\x08 ]\n " ) ;
376+ }
358377
359378 if !self . experimental {
360379 self . valid_interpolation = vec ! [ self . min_valid_iteration; ( self . probe_sampling - 1 ) * ( self . probe_sampling - 1 ) ] ;
0 commit comments