"k ", .
struct OP {
const int a, b;
OP(const int p, const int q): a(p), b(q){};
int operator()(const int v1, const int v2) {
return a*v1+b*v2;
}
}
thrust::device_vector<int> w(v.size());
thrust::transform(v.begin(), v.end()-1,
v.begin()+1,
w.begin(),
OP(a, b));
v = w;
, "", .
, .:)