24 #ifndef _SAVITZKYGOLAYSMOOTHER_HPP_
25 #define _SAVITZKYGOLAYSMOOTHER_HPP_
44 typename std::vector<T>::const_iterator start;
45 typename std::vector<T> smoothedData(data.begin(), data.begin()+4);
46 for (start = data.begin();
47 (start+8) != data.end();
50 T sum = 59 * *(start+4) + 54 * (*(start+3) + *(start+5)) +
51 39 * (*(start+2) + *(start+6)) + 14 * (*(start+1) + *(start+7)) -
52 21 * (*start + *(start+8));
53 smoothedData.push_back(sum / 231);
55 smoothedData.insert(smoothedData.end(), data.end()-4, data.end());
63 #endif // _SAVITZKYGOLAYSMOOTHER_HPP_