Skip to content

Commit

Permalink
Minor Change to Preprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewStuber committed Mar 12, 2018
1 parent 52f73b0 commit 718d8ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,22 @@ function solveBnB!(x::BnBSolver,y::BnBModel)
feas_Pre::Bool = true
feas_Post::Bool = true
if (k_int == 0)
#println("pre-check")
x.Preprocess(feas_Pre,nsBox,y.UBDg,k_int,pos,x.opt)
LBD_valt,LBD_solt,LBD_feast,temp_objtL = x.Lower_Prob(nsBox,k_int,pos,x.opt,y.UBDg)
UBD_valt,UBD_solt,UBD_feast,temp_objtU = x.Upper_Prob(nsBox,k_int,pos,x.opt,y.UBDg)
#println("preprocess-check")
LBD_valt, LBD_solt, LBD_feast, temp_objtL = x.Lower_Prob(nsBox,k_int,pos,x.opt,y.UBDg)
#println("lower-check")
UBD_valt, UBD_solt, UBD_feast, temp_objtU = x.Upper_Prob(nsBox,k_int,pos,x.opt,y.UBDg)
#println("upper-check")
x.Postprocess(feas_Post,nsBox,k_int,pos,x.opt,
temp_objtL,temp_objtU)
temp_objtL,temp_objtU,y.LBDg,y.UBDg)
#println("postprocess-check")
end

# performs prepocessing and times
tic()
x.Preprocess(feas_Pre,nsBox,y.UBDg,k_int,pos,x.opt)
feas_Pre,nsBox = x.Preprocess(feas_Pre,nsBox,y.UBDg,k_int,pos,x.opt)
push!(y.Pretime,y.Pretime[end]+toq())

if (feas_Pre)
# solves & times lower bounding problem
tic()
Expand Down Expand Up @@ -76,7 +80,7 @@ function solveBnB!(x::BnBSolver,y::BnBModel)

# performs post processing and times
tic()
feas_Post,nsBox_Post = x.Postprocess(feas_Post,nsBox,k_int,pos,x.opt,temp_objL,temp_objU)
feas_Post,nsBox_Post = x.Postprocess(feas_Post,nsBox,k_int,pos,x.opt,temp_objL,temp_objU,y.LBDg,y.UBDg)
push!(y.Posttime,y.Posttime[end]+toq())

# branch if criteria met
Expand Down
4 changes: 3 additions & 1 deletion src/src/utils/Processing.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
function default_pre(feas::Bool,X::Vector{Interval{Float64}},UBD::Float64,
k::Int64,pos::Int64,opt)
return feas,X
end

function default_post(feas::Bool,X::Vector{Interval{Float64}},k::Int64,pos::Int64,opt,tempL,tempU)
function default_post(feas::Bool,X::Vector{Interval{Float64}},k::Int64,
pos::Int64,opt,tempL,tempU,LBD,UBD)
return feas,X
end

0 comments on commit 718d8ff

Please sign in to comment.