You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working with ZIMPL, I encountered a potential discrepancy in the documentation regarding the usage of the max and min functions. Specifically, the usage demonstrated in Section 4.1.1 (Numeric expressions), Table 2 appears to differ from the syntax used in Section 4.3 (Parameters).
Steps to Reproduce
According to the usage of max in Section 4.1.1 (Numeric expressions), Table 2, it is suggested that we can use max(s in S) e(s) to compute the maximum value of the function e over a set S. To verify this, I tested the following example:
# test.zpl
set I := { 1..3 };
var x;
param num := max(i in I) i^2;
minimize f: x;
subto c: x == num;
When running this model in SCIP, I received the following error:
After modifying the param statement to the syntax shown in Section 4.3, the issue was resolved:
param num := max <i> in I : i^2;
Questions
Does this discrepancy indicate an error in my model when using the syntax demonstrated in Section 4.1.1? Should the syntax max(i in I) i^2 work in certain contexts but I am simply using it incorrectly, or is it only illustrative and not intended to be a valid ZIMPL statement?
Environment
SCIP version: 9.2.0
ZIMPL version: 3.6.2
Operating System: Windows 10 22H2
Thank you for your time and assistance! I look forward to hearing your insights.
The text was updated successfully, but these errors were encountered:
This is a mistake in the documentation. Correct is max in I : i^2 .
Note it is possible to add a with statement: max in I with i < 7: i^2
Will be fixed in the next release.
Description
While working with ZIMPL, I encountered a potential discrepancy in the documentation regarding the usage of the
max
andmin
functions. Specifically, the usage demonstrated in Section 4.1.1 (Numeric expressions), Table 2 appears to differ from the syntax used in Section 4.3 (Parameters).Steps to Reproduce
According to the usage of
max
in Section 4.1.1 (Numeric expressions), Table 2, it is suggested that we can usemax(s in S) e(s)
to compute the maximum value of the functione
over a setS
. To verify this, I tested the following example:When running this model in SCIP, I received the following error:
After modifying the
param
statement to the syntax shown in Section 4.3, the issue was resolved:Questions
Does this discrepancy indicate an error in my model when using the syntax demonstrated in Section 4.1.1? Should the syntax
max(i in I) i^2
work in certain contexts but I am simply using it incorrectly, or is it only illustrative and not intended to be a valid ZIMPL statement?Environment
Thank you for your time and assistance! I look forward to hearing your insights.
The text was updated successfully, but these errors were encountered: