This functions helps to create dynamic sum expression based on external variables. Should only be used within other 'ompr' functions.
sum_expr(expr, ...)
the expanded sum as an AST
# create a sum from x_1 to x_10 sum_expr(x[i], i = 1:10)#> x[1L] + x[2L] + x[3L] + x[4L] + x[5L] + x[6L] + x[7L] + x[8L] + #> x[9L] + x[10L]# create a sum from x_2 to x_10 with even indexes sum_expr(x[i], i = 1:10, i %% 2 == 0)#> x[2L] + x[4L] + x[6L] + x[8L] + x[10L]