我想将大型输入数组的初始化分成较小的块(只是为了可读性)。我试过这个:
array[1..3,1..2] of int: arr;
% This works:
% arr = array2d(1..3,1..2, [0,0,2,2,3,3]);
% But this not:
arr[1] = [0,0];
arr[2] = [2,2];
arr[3] = [3,3];
constraint true;
solve satisfy;
Run Code Online (Sandbox Code Playgroud)
当我运行此代码时,出现语法错误:
arr[1] = [0,0];
^
Error: syntax error, unexpected =, expecting ':'
Run Code Online (Sandbox Code Playgroud)
这是不支持的Minizinc
还是我错过了其他东西?
(有一个有点相关的问题initialize-only-certain-elements-of-array-in-dzn-file,但没有回答我的具体问题。)