-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Description
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:
SCIP> read test.zpl
*** Error 800: File test.zpl Line 5 : syntax 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.