Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <deque>
- #include <numeric>
- int main()
- {
- std::vector<double> b = { 0.0089, -0.0045, -0.0045, 0.0089 };
- std::vector<double> a = { 1, 2.5641, -2.2185, 0.6456 };
- std::deque<double> d( std::max(a.size(), b.size()) );
- for (int i = 0; i < 150; ++i)
- {
- d.push_front(1.0);
- d.pop_back();
- d[0] = std::inner_product(begin(a), end(a), begin(d), 0.0);
- double y = std::inner_product(begin(b), end(b), begin(d), 0.0);
- std::cout << y << std::endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement