本文整理汇总了C++中Trace::assign方法的典型用法代码示例。如果您正苦于以下问题:C++ Trace::assign方法的具体用法?C++ Trace::assign怎么用?C++ Trace::assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trace
的用法示例。
在下文中一共展示了Trace::assign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TrapezoidalFilter
/**
* Defines how to implement a trapezoidal filter characterized by two
* moving sum windows of width risetime separated by a length gaptime.
* Filter is calculated from channels lo to hi.
*/
void Trace::TrapezoidalFilter(Trace &filter, const TrapezoidalFilterParameters &parms, unsigned int lo, unsigned int hi) const
{
// don't let the filter work outside of its reasonable range
lo = max(lo, (unsigned int)parms.GetSize());
filter.assign(lo, 0);
//! check if we're going to do something bad here
for (unsigned int i = lo; i < hi; i++) {
int leftSum = accumulate(begin() + i - parms.GetSize(), begin() + i - parms.GetRiseSamples() - parms.GetGapSamples(), 0);
int rightSum = accumulate(begin() + i - parms.GetRiseSamples(), begin() + i, 0);
filter.push_back(rightSum - leftSum);
}
}