ProteoWizard
Classes | Functions
ralab::base::resample::utilities Namespace Reference

Classes

struct  meanfunctor
 

Functions

template<typename InputIterator , typename OutputIterator , typename TN >
OutputIterator summ (InputIterator begin, InputIterator end, OutputIterator destBegin, TN lag=1)
 
template<typename TRealI >
double determine (TRealI begin, TRealI end, double maxj=5.)
 

Function Documentation

§ summ()

template<typename InputIterator , typename OutputIterator , typename TN >
OutputIterator ralab::base::resample::utilities::summ ( InputIterator  begin,
InputIterator  end,
OutputIterator  destBegin,
TN  lag = 1 
)
Parameters
[in]beginbegin
[in]endend
[out]destBegindest begin
[in]lagan integer indicating which lag to use.

Definition at line 52 of file determinebinwidth.hpp.

Referenced by ralab::base::resample::utilities::meanfunctor< T >::operator()(), and ralab::base::resample::SamplingWith::operator()().

58  {
59  return( std::transform(begin + lag
60  , end
61  , begin
62  , destBegin
63  , meanfunctor<typename InputIterator::value_type>())
64  );
65  }

§ determine()

template<typename TRealI >
double ralab::base::resample::utilities::determine ( TRealI  begin,
TRealI  end,
double  maxj = 5. 
)

Definition at line 68 of file determinebinwidth.hpp.

Referenced by ralab::base::resample::SamplingWith::operator()().

68  {
69  //BOOST_ASSERT(!boost::range::is_sorted(begin,end));
70  double j = 1.;
71  double average = *begin;
72  double sum = average;
73  int32_t i = 1;
74  for(; begin != end ; ++begin, ++i){
75  while(*begin > (j+0.5) *average){
76  ++j;
77  }
78  if(j > maxj){
79  break;
80  }
81  sum += *begin/j;
82  average = sum/static_cast<double>(i);
83  }
84  return average;
85 
86  }
boost::int32_t int32_t
Definition: bin1d.hpp:40