36 std::vector<double> data;
38 std::vector<double>
y;
39 std::transform(data.begin(), data.end(), std::back_inserter(y),
static_cast<double(*)(
double)
>(sin) );
41 std::vector<double> filt3(21,1./21.);
42 double sumfilt = std::accumulate(filt3.begin(), filt3.end(), 0.0 );
45 std::vector<double> result;
59 result.resize(y.size());
75 std::vector<int> tmp, res;
78 res.resize(std::distance(res.begin(),it));
79 double ref[] = { 4, 5, 1, 2, 3, 4 ,5, 1, 2};
84 bool iseq = std::equal(res.begin(),res.end(),ref);
88 res.resize(std::distance(res.begin(),it));
90 double ref2[] = {2, 1, 1, 2, 3, 4, 5, 5, 4};
91 iseq = std::equal(res.begin(),res.end(),ref2);
98 int main(
int argc,
char **argv) {
TContainer::iterator prepareData(TIterator dataBeg, TIterator dataEnd, size_t fsize, TContainer &res, bool mirror=false)
Example Sequence : 1 2 3 4 5; width 5 and mirror false: 4 5 1 2 3 4 5 1 2, if mirror true than: 2 1 1...
void filter_sequence(TIterator dataBeg, TIterator dataEnd, TFilterIterator filterBeg, size_t fsize, TOutputIterator resBeg, bool circular=false, uint32_t sides=2)
#define unit_assert_equal(x, y, epsilon)
void seq(TReal from, TReal to, std::vector< TReal > &result)
generates the sequence from, from+/-1, ..., to (identical to from:to).
int main(int argc, char **argv)
KernelTraitsBase< Kernel >::space_type::ordinate_type y
void filter(const TContainer &data, const TContainer &filter, TContainer &result, bool circular=false, uint32_t sides=2)
Applies linear convolution (filtering) to a univariate time series.