@@ -1156,8 +1156,8 @@ This constraint is sometimes called `nvalues`.
1156
1156
```julia
1157
1157
model = Utilities.Model{Float64}()
1158
1158
n = add_constrained_variable(model, MOI.Integer())
1159
- x = [add_constrained_variable(model, MOI.Integer()) for _ in 1:3]
1160
- add_constraint(model, vcat(n, x), CountDistinct(4))
1159
+ x = [add_constrained_variable(model, MOI.Integer())[1] for _ in 1:3]
1160
+ add_constraint(model, VectorOfVariables( vcat(n, x) ), CountDistinct(4))
1161
1161
# if n == 1, then x[1] == x[2] == x[3]
1162
1162
# if n == 2, then x[1] == x[2] != x[3] || x[1] != x[2] == x[3]
1163
1163
# if n == 3, then x[1] != x[2] != x[3]
@@ -1170,10 +1170,10 @@ When the first element is `dimension - 1`, `CountDistinct` is equivalent to an
1170
1170
1171
1171
```julia
1172
1172
model = Utilities.Model{Float64}()
1173
- x = [add_constrained_variable(model, MOI.Integer()) for _ in 1:3]
1174
- add_constraint(model, vcat(3, x), CountDistinct(4))
1173
+ x = [add_constrained_variable(model, MOI.Integer())[1] for _ in 1:3]
1174
+ add_constraint(model, VectorOfVariables( vcat(3, x) ), CountDistinct(4))
1175
1175
# equivalent to
1176
- add_constraint(model, x , AllDifferent(3))
1176
+ add_constraint(model, VectorOfVariables(x) , AllDifferent(3))
1177
1177
```
1178
1178
"""
1179
1179
struct CountDistinct <: AbstractVectorSet
0 commit comments