ProteoWizard
Public Member Functions | Public Attributes | List of all members
ralab::base::resample::SamplingWith Struct Reference

#include <determinebinwidth.hpp>

Public Member Functions

template<typename TRealI >
double operator() (TRealI begin, TRealI end)
 

Public Attributes

std::vector< double > diff_
 
std::vector< double > summ_
 
std::vector< double > am_
 

Detailed Description

Definition at line 48 of file determinebinwidth.hpp.

Member Function Documentation

◆ operator()()

template<typename TRealI >
double ralab::base::resample::SamplingWith::operator() ( TRealI  begin,
TRealI  end 
)
inline

Definition at line 55 of file determinebinwidth.hpp.

56 {
57 //BOOST_ASSERT(!boost::range::is_sorted(begin,end));
58 typedef typename std::iterator_traits<TRealI>::value_type TReal;
59 std::size_t N = std::distance(begin,end);
60 double am;
61 if(N > 1){
62 diff_.resize(N-1);
63 summ_.resize(N-1);
64 am_.resize(N-1);
65 ralab::base::base::diff(begin,end,diff_.begin(),1);
66
67 utilities::summ( begin , end, summ_.begin(),1);
68 //square the sum
69 //std::transform(summ_.begin(),summ_.end(),summ_.begin(),boost::bind(sqrt,_1));
70 std::transform(summ_.begin(),summ_.end(),summ_.begin(),SquareRoot<TReal>());
71 std::transform(diff_.begin(),diff_.end(),summ_.begin(),am_.begin(),std::divides<double>());
72 std::sort(am_.begin(),am_.end());
73 am = utilities::determine(am_.begin(),am_.end());
74 }else{
75 am = 0.;
76 }
77 return am;
78 }
N
Definition Chemistry.hpp:80
OutputIterator diff(InputIterator begin, InputIterator end, OutputIterator destBegin, TN lag)
lagged differences
Definition diff.hpp:58
OutputIterator summ(InputIterator begin, InputIterator end, OutputIterator destBegin, TN lag=1)
double determine(TRealI begin, TRealI end, double maxj=5.)

References am_, ralab::base::resample::utilities::determine(), ralab::base::base::diff(), diff_, N, ralab::base::resample::utilities::summ(), and summ_.

Member Data Documentation

◆ diff_

std::vector<double> ralab::base::resample::SamplingWith::diff_

Definition at line 49 of file determinebinwidth.hpp.

Referenced by operator()().

◆ summ_

std::vector<double> ralab::base::resample::SamplingWith::summ_

Definition at line 50 of file determinebinwidth.hpp.

Referenced by operator()().

◆ am_

std::vector<double> ralab::base::resample::SamplingWith::am_

Definition at line 51 of file determinebinwidth.hpp.

Referenced by operator()().


The documentation for this struct was generated from the following file: