Support Reductions
pystencils supports sympy Sum like this:
sum = sp.Sum(sp.abc.k, (sp.abc.k, 1, 100))
will be printed as:
{
for (int64_t ctr_0 = 0; ctr_0 < _size_x_0; ctr_0 += 1)
{
_data_x[_stride_x_0*ctr_0] = [&]() {
double sum = (double) 0;
for ( int k = 1.0; k <= 100.0; k += 1 ) {
sum += k;
}
return sum;
}();
}
}
This is C++ code and additionally, at the moment, it bypasses the type system a bit. Thus this should be reimplemented.