View source: R/linear-optimization-model-impl.R
sum_over | R Documentation |
This functions helps to create summations over indexes.
sum_over(.expr, ...)
sum_expr(.expr, ...)
.expr |
an expression that can be expanded to a sum |
... |
bind variables in expr using dots. See examples. |
the sum over all the indexes
add_constraint
set_objective
Please note that sum_expr
is deprecated when used together with
MIPModel
.
if (FALSE) {
# create a sum from x_1 to x_10
sum_over(x[i], i = 1:10)
# create a sum from x_2 to x_10 with even indexes
sum_over(x[i], i = 1:10, i %% 2 == 0)
sum_over(x[i, j], i = 1:10, j = 1:i)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.