@@ -135,32 +135,11 @@ function set_pvals!(com::CS.CoM, constraint::Constraint)
135
135
# nothing to do i.e x <= x will be x-x <= 0 => 0 <= 0 without variables
136
136
length (indices) == 0 && return
137
137
variables = Variable[v for v in com. search_space[indices]]
138
- pvals_intervals = Vector {NamedTuple} ()
139
- push! (pvals_intervals, (from = variables[1 ]. lower_bound, to = variables[1 ]. upper_bound))
140
- for i in 1 : length (indices)
141
- extra_from = variables[i]. min
142
- extra_to = variables[i]. max
143
- comp_inside = false
144
- for cpvals in pvals_intervals
145
- if extra_from >= cpvals. from && extra_to <= cpvals. to
146
- # completely inside the interval already
147
- comp_inside = true
148
- break
149
- elseif extra_from >= cpvals. from && extra_from <= cpvals. to
150
- extra_from = cpvals. to + 1
151
- elseif extra_to <= cpvals. to && extra_to >= cpvals. from
152
- extra_to = cpvals. from - 1
153
- end
154
- end
155
- if ! comp_inside && extra_to >= extra_from
156
- push! (pvals_intervals, (from = extra_from, to = extra_to))
157
- end
138
+ pvals_set = Set {Int} ()
139
+ for variable in variables
140
+ union! (pvals_set, values (variable))
158
141
end
159
- pvals = collect ((pvals_intervals[1 ]. from): (pvals_intervals[1 ]. to))
160
- for interval in pvals_intervals[2 : end ]
161
- pvals = vcat (pvals, collect ((interval. from): (interval. to)))
162
- end
163
- constraint. pvals = pvals
142
+ constraint. pvals = collect (pvals_set)
164
143
if constraint isa IndicatorConstraint || constraint isa ReifiedConstraint
165
144
set_pvals! (com, constraint. inner_constraint)
166
145
end
@@ -770,7 +749,6 @@ function solve!(com::CS.CoM)
770
749
feasible = prune! (com; pre_backtrack = true , initial_check = true )
771
750
# finished pruning will be called in second call a few lines down...
772
751
773
-
774
752
if ! feasible
775
753
com. solve_time = time () - com. start_time
776
754
return :Infeasible
0 commit comments