-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Boolean argmin/argmax to FlatZinc, and perform offset…
… calculation natively rather than through MiniZinc constraints
- Loading branch information
Showing
6 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
predicate gecode_maximum_arg_bool_offset(array[int] of var bool: x, int: offset, var int: i); | ||
|
||
predicate maximum_arg_bool(array[int] of var bool: x, var int: i) = | ||
gecode_maximum_arg_bool_offset(x,min(index_set(x)),i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
predicate gecode_maximum_arg_int(array[int] of var int: x, var int: i); | ||
predicate gecode_maximum_arg_int_offset(array[int] of var int: x, int: offset, var int: i); | ||
|
||
predicate maximum_arg_int(array[int] of var int: x, var int: i) = | ||
gecode_maximum_arg_int(x,(i-min(index_set(x)))::domain); | ||
gecode_maximum_arg_int_offset(x,min(index_set(x)),i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
predicate gecode_minimum_arg_bool_offset(array[int] of var bool: x, int: offset, var int: i); | ||
|
||
predicate minimum_arg_bool(array[int] of var bool: x, var int: i) = | ||
gecode_minimum_arg_bool_offset(x,min(index_set(x)),i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
predicate gecode_minimum_arg_int(array[int] of var int: x, var int: i); | ||
predicate gecode_minimum_arg_int_offset(array[int] of var int: x, int: offset, var int: i); | ||
|
||
predicate minimum_arg_int(array[int] of var int: x, var int: i) = | ||
gecode_minimum_arg_int(x,(i-min(index_set(x)))::domain); | ||
gecode_minimum_arg_int_offset(x,min(index_set(x)),i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters