@@ -42,23 +42,25 @@ include("oed_utils.jl")
4242
4343
4444m =  50 
45+ n =  Int (floor (m /  10 ))
4546verbose =  true 
4647
4748# # A-Optimal Design Problem
4849@testset  " A-Optimal Design"   begin 
4950
50-     Ex_mat, n,  N, ub =  build_data (m)
51+     Ex_mat, N, ub =  build_data (m, n )
5152
5253    g, grad! =  build_a_criterion (Ex_mat, build_safe= false )
5354    blmo =  build_blmo (m, N, ub)
5455    heu =  Boscia. Heuristic (Boscia. rounding_hyperplane_heuristic, 0.7 , :hyperplane_aware_rounding )
5556    domain_oracle =  build_domain_oracle (Ex_mat, n)
57+     domain_point =  build_domain_point_function (domain_oracle, Ex_mat, N, collect (1 : m), fill (0.0 , m), ub)
5658
5759    #  precompile
5860    line_search =  FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
5961    x0, active_set =  build_start_point (Ex_mat, N, ub)
6062    z =  greedy_incumbent (Ex_mat, N, ub)
61-     x, _, _ =  Boscia. solve (g, grad!, blmo, active_set= active_set, start_solution= z, time_limit= 10 , verbose= false , domain_oracle= domain_oracle, custom_heuristics= [heu], line_search= line_search)
63+     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)
6264
6365    #  proper run with MGLS and Adaptive
6466    line_search =  FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
@@ -72,6 +74,7 @@ verbose = true
7274        start_solution= z, 
7375        verbose= verbose, 
7476        domain_oracle= domain_oracle, 
77+         find_domain_point= domain_point, 
7578        custom_heuristics= [heu], 
7679        line_search= line_search,
7780    )
@@ -89,29 +92,31 @@ verbose = true
8992        start_solution= z, 
9093        verbose= verbose, 
9194        domain_oracle= domain_oracle, 
95+         find_domain_point= domain_point, 
9296        custom_heuristics= [heu], 
9397        line_search= line_search,
9498    )
9599
96-     @test  result_s[:dual_bound ] <=  g (x) +  1e-4  
97-     @test  result[:dual_bound ] <=  g (x_s) +  1e-4  
100+     @test  result_s[:dual_bound ] <=  g (x) +  1e-3  
101+     @test  result[:dual_bound ] <=  g (x_s) +  1e-3  
98102    @test  isapprox (g (x), g (x_s), atol= 1e-3 ) 
99103end  
100104
101105# # D-Optimal Design Problem
102106@testset  " D-optimal Design"   begin 
103-     Ex_mat, n,  N, ub =  build_data (m)
107+     Ex_mat, N, ub =  build_data (m, n )
104108
105109    g, grad! =  build_d_criterion (Ex_mat, build_safe= false )
106110    blmo =  build_blmo (m, N, ub)
107111    heu =  Boscia. Heuristic (Boscia. rounding_hyperplane_heuristic, 0.7 , :hyperplane_aware_rounding )
108112    domain_oracle =  build_domain_oracle (Ex_mat, n)
113+     domain_point =  build_domain_point_function (domain_oracle, Ex_mat, N, collect (1 : m), fill (0.0 , m), ub)
109114
110115    #  precompile
111116    line_search =  FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
112117    x0, active_set =  build_start_point (Ex_mat, N, ub)
113118    z =  greedy_incumbent (Ex_mat, N, ub)
114-     x, _, _ =  Boscia. solve (g, grad!, blmo, active_set= active_set, start_solution= z, time_limit= 10 , verbose= false , domain_oracle= domain_oracle, custom_heuristics= [heu], line_search= line_search)
119+     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)
115120
116121    #  proper run with MGLS and Adaptive
117122    line_search =  FrankWolfe. MonotonicGenericStepsize (FrankWolfe. Adaptive (), domain_oracle)
125130        start_solution= z, 
126131        verbose= verbose, 
127132        domain_oracle= domain_oracle, 
133+         find_domain_point= domain_point, 
128134        custom_heuristics= [heu], 
129135        line_search= line_search,
130136    )
142148        start_solution= z, 
143149        verbose= verbose, 
144150        domain_oracle= domain_oracle, 
151+         find_domain_point= domain_point, 
145152        custom_heuristics= [heu], 
146153        line_search= line_search,
147154    )
0 commit comments