Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not define unnecessary auxiliary variables #979

Open
arnaud-m opened this issue Nov 29, 2022 · 0 comments
Open

Do not define unnecessary auxiliary variables #979

arnaud-m opened this issue Nov 29, 2022 · 0 comments

Comments

@arnaud-m
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Some auxiliary variables are introduced when building arithmetic and relational expressions.
This are very useful allowing to easily define complex expressions.
However, they are defined when not required.

Model m = new Model();
IntVar[] x = m.intVarArray("x", 3, 0, 1000);
model.times(x[0], x[1], x[2]).post(); 
x[1].mul(x[1]).eq(x[2]).post(); // Introduce an unnecessary auxiliary variable.
System.out.println(m);

Describe the solution you'd like
Not creating the auxiliary variable mul_exp_1.

Describe alternatives you've considered
The user can post a times constraint instead of defining an expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant