From 6466d0622e07ffd06e4f8fd854a8efa1b4ae48c9 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 29 Oct 2024 16:35:39 +0100 Subject: [PATCH] Rename the function to find_domain_point. --- examples/optimal_experiment_design.jl | 12 ++++++------ src/MOI_bounded_oracle.jl | 4 ++-- src/interface.jl | 8 ++++---- src/managed_blmo.jl | 4 ++-- src/utilities.jl | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/optimal_experiment_design.jl b/examples/optimal_experiment_design.jl index 3c577b8b3..5f1440dbd 100644 --- a/examples/optimal_experiment_design.jl +++ b/examples/optimal_experiment_design.jl @@ -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) @@ -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, ) @@ -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, ) @@ -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) @@ -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, ) @@ -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, ) diff --git a/src/MOI_bounded_oracle.jl b/src/MOI_bounded_oracle.jl index 1eb66a524..89b3f20d2 100644 --- a/src/MOI_bounded_oracle.jl +++ b/src/MOI_bounded_oracle.jl @@ -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, @@ -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, diff --git a/src/interface.jl b/src/interface.jl index 5b0b16b1d..e08054c92 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -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 @@ -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, @@ -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 @@ -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, diff --git a/src/managed_blmo.jl b/src/managed_blmo.jl index f20bc8e54..3a580c716 100644 --- a/src/managed_blmo.jl +++ b/src/managed_blmo.jl @@ -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, @@ -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, diff --git a/src/utilities.jl b/src/utilities.jl index d1b4250e6..0e4885a7c 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -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