11#ifndef __epsic_smoothed_h 
   12#define __epsic_smoothed_h 
   24  class boxcar_mode : 
public mode_decorator
 
   26    std::vector< Spinor<double> > instances;
 
   33      instances.resize (smooth);
 
   34      for (
unsigned i=1; i<smooth; i++)
 
   35        instances[i] = source->get_field();
 
   40    boxcar_mode (mode* s, 
unsigned n) : mode_decorator(s) { smooth = n; }
 
   42    Spinor<double> get_field ()
 
   44      if (instances.size() < smooth)
 
   47      instances[current] = source->get_field();
 
   48      current = (current + 1) % smooth;
 
   50      Spinor<double> result;
 
   51      for (
unsigned i=0; i<smooth; i++)
 
   52        result += instances[i];
 
   54      result /= sqrt(smooth);