FACT++  1.0
template<class T >
StateMachineSmartFACT::Statistics::Statistics ( const T &  t,
size_t  offset_min = 0,
size_t  offset_max = 0 
)
inline

Definition at line 775 of file smartfact.cc.

776  : min(0), max(0), med(0), avg(0)
777  {
778  if (t.empty())
779  return;
780 
781  T copy(t);
782  sort(copy.begin(), copy.end());
783 
784  if (offset_min>t.size())
785  offset_min = 0;
786  if (offset_max>t.size())
787  offset_max = 0;
788 
789  min = copy[offset_min];
790  max = copy[copy.size()-1-offset_max];
791  avg = accumulate (t.begin(), t.end(), 0.)/t.size();
792 
793  const size_t p = copy.size()/2;
794  med = copy.size()%2 ? copy[p] : (copy[p-1]+copy[p])/2.;
795  }
TT t
Definition: test_client.c:26