Skip to content

Commit

Permalink
Rename the function to find_domain_point.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrych committed Oct 29, 2024
1 parent 62a80e9 commit 6466d06
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions examples/optimal_experiment_design.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ verbose = true
line_search = FrankWolfe.MonotonicGenericStepsize(FrankWolfe.Adaptive(), domain_oracle)
x0, active_set = build_start_point(Ex_mat, N, ub)
z = greedy_incumbent(Ex_mat, N, ub)
x, _, _ = Boscia.solve(g, grad!, blmo, active_set=active_set, start_solution=z, time_limit=10, verbose=false, domain_oracle=domain_oracle, domain_point=domain_point, custom_heuristics=[heu], line_search=line_search)
x, _, _ = Boscia.solve(g, grad!, blmo, active_set=active_set, start_solution=z, time_limit=10, verbose=false, domain_oracle=domain_oracle, find_domain_point=domain_point, custom_heuristics=[heu], line_search=line_search)

# proper run with MGLS and Adaptive
line_search = FrankWolfe.MonotonicGenericStepsize(FrankWolfe.Adaptive(), domain_oracle)
Expand All @@ -74,7 +74,7 @@ verbose = true
start_solution=z,
verbose=verbose,
domain_oracle=domain_oracle,
domain_point=domain_point,
find_domain_point=domain_point,
custom_heuristics=[heu],
line_search=line_search,
)
Expand All @@ -92,7 +92,7 @@ verbose = true
start_solution=z,
verbose=verbose,
domain_oracle=domain_oracle,
domain_point=domain_point,
find_domain_point=domain_point,
custom_heuristics=[heu],
line_search=line_search,
)
Expand All @@ -116,7 +116,7 @@ end
line_search = FrankWolfe.MonotonicGenericStepsize(FrankWolfe.Adaptive(), domain_oracle)
x0, active_set = build_start_point(Ex_mat, N, ub)
z = greedy_incumbent(Ex_mat, N, ub)
x, _, _ = Boscia.solve(g, grad!, blmo, active_set=active_set, start_solution=z, time_limit=10, verbose=false, domain_oracle=domain_oracle, domain_point=domain_point, custom_heuristics=[heu], line_search=line_search)
x, _, _ = Boscia.solve(g, grad!, blmo, active_set=active_set, start_solution=z, time_limit=10, verbose=false, domain_oracle=domain_oracle, find_domain_point=domain_point, custom_heuristics=[heu], line_search=line_search)

# proper run with MGLS and Adaptive
line_search = FrankWolfe.MonotonicGenericStepsize(FrankWolfe.Adaptive(), domain_oracle)
Expand All @@ -130,7 +130,7 @@ end
start_solution=z,
verbose=verbose,
domain_oracle=domain_oracle,
domain_point=domain_point,
find_domain_point=domain_point,
custom_heuristics=[heu],
line_search=line_search,
)
Expand All @@ -148,7 +148,7 @@ end
start_solution=z,
verbose=verbose,
domain_oracle=domain_oracle,
domain_point=domain_point,
find_domain_point=domain_point,
custom_heuristics=[heu],
line_search=line_search,
)
Expand Down
4 changes: 2 additions & 2 deletions src/MOI_bounded_oracle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ function solve(
sharpness_constant = 0.0,
sharpness_exponent = Inf,
domain_oracle=_trivial_domain,
domain_point= _trivial_domain_point,
find_domain_point= _trivial_domain_point,
start_solution=nothing,
fw_verbose=false,
use_shadow_set=true,
Expand Down Expand Up @@ -672,7 +672,7 @@ function solve(
sharpness_constant=sharpness_constant,
sharpness_exponent=sharpness_exponent,
domain_oracle=domain_oracle,
domain_point=domain_point,
find_domain_point=find_domain_point,
start_solution=start_solution,
fw_verbose=fw_verbose,
use_shadow_set=use_shadow_set,
Expand Down
8 changes: 4 additions & 4 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ domain_oracle - For a point x: returns true if x is in the domain of f,
In case of the non trivial domain oracle, the starting point has to be feasible for f. Additionally,
the user has to provide a function `domain_point`, see below. Also, depending
on the Line Search method, you might have to provide the domain oracle to it, too.
domain_point - Given the current node bounds return a domain feasible point respecting the bounds.
find_domain_point - Given the current node bounds return a domain feasible point respecting the bounds.
If no such point can be found, return nothing.
start_solution - initial solution to start with an incumbent
fw_verbose - if true, FrankWolfe logs are printed
Expand Down Expand Up @@ -102,7 +102,7 @@ function solve(
sharpness_constant = 0.0,
sharpness_exponent = Inf,
domain_oracle=_trivial_domain,
domain_point= _trivial_domain_point,
find_domain_point= _trivial_domain_point,
start_solution=nothing,
fw_verbose=false,
use_shadow_set=true,
Expand Down Expand Up @@ -150,7 +150,7 @@ function solve(

global_bounds = build_global_bounds(blmo, integer_variables)

if typeof(domain_oracle) != typeof(_trivial_domain) && typeof(domain_point) == typeof(_trivial_domain_point)
if typeof(domain_oracle) != typeof(_trivial_domain) && typeof(find_domain_point) == typeof(_trivial_domain_point)
@warn "For a non trivial domain oracle, please provide the DOMAIN POINT function. Otherwise, Boscia might not converge."
end

Expand Down Expand Up @@ -209,7 +209,7 @@ function solve(
global_tightenings=IntegerBounds(),
options=Dict{Symbol,Any}(
:domain_oracle => domain_oracle,
:domain_point => domain_point,
:find_domain_point => find_domain_point,
:dual_gap => dual_gap,
:dual_gap_decay_factor => dual_gap_decay_factor,
:dual_tightening => dual_tightening,
Expand Down
4 changes: 2 additions & 2 deletions src/managed_blmo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function solve(
sharpness_constant = 0.0,
sharpness_exponent = Inf,
domain_oracle=_trivial_domain,
domain_point= _trivial_domain_point,
find_domain_point= _trivial_domain_point,
start_solution=nothing,
fw_verbose=false,
use_shadow_set=true,
Expand Down Expand Up @@ -314,7 +314,7 @@ function solve(
sharpness_constant=sharpness_constant,
sharpness_exponent=sharpness_exponent,
domain_oracle=domain_oracle,
domain_point=domain_point,
find_domain_point=find_domain_point,
start_solution=start_solution,
fw_verbose=fw_verbose,
use_shadow_set=use_shadow_set,
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function build_active_set_by_domain_oracle(
FrankWolfe.compute_active_set_iterate!(active_set)
# No vertex is domain feasible
else
x_star = tree.root.options[:domain_point](local_bounds)
x_star = tree.root.options[:find_domain_point](local_bounds)
# No domain feasible point can be build.
# Node can be pruned.
if x_star === nothing
Expand Down

0 comments on commit 6466d06

Please sign in to comment.