Skip to content

Commit 58608d4

Browse files
updated pre_computed_set_argminmax with inface check
1 parent 4913054 commit 58608d4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/utils.jl

+2-5
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,9 @@ Base.length(storage::DeletedVertexStorage) = length(storage.storage)
382382
Computes the linear minimizer in the direction on the precomputed_set.
383383
Precomputed_set stores the vertices computed as extreme points v in each iteration.
384384
"""
385-
function pre_computed_set_argminmax(pre_computed_set, direction, x)
385+
function pre_computed_set_argminmax(lmo, pre_computed_set, direction, x)
386386
val = convert(eltype(direction), Inf)
387387
valM = convert(eltype(direction), -Inf)
388-
x_zeros = isa(x, AbstractMatrix) ? LinearIndices(x)[findall(iszero, x)] : findall(iszero, x)
389-
# x_zeros = setdiff(collect(1:length(x)), SparseArrays.nonzeroinds(x))
390388
idx = -1
391389
idxM = -1
392390
for i in eachindex(pre_computed_set)
@@ -395,8 +393,7 @@ function pre_computed_set_argminmax(pre_computed_set, direction, x)
395393
val = temp_val
396394
idx = i
397395
end
398-
399-
if (isempty(x_zeros) || iszero(pre_computed_set[i][x_zeros])) && temp_val > valM
396+
if is_inface_feasible(lmo, pre_computed_set[i], x) && temp_val > valM
400397
valM = temp_val
401398
idxM = i
402399
end

0 commit comments

Comments
 (0)