Skip to content

Commit

Permalink
fixed #8
Browse files Browse the repository at this point in the history
  • Loading branch information
kibaekkim committed May 12, 2023
1 parent 5e388ec commit 684f98a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ function MOI.optimize!(model::Optimizer)
eval_jac_g_cb,
has_hessian ? eval_h_cb : nothing,
num_linear_constraints,
objective_scale == -1 ? :Max : :Min,
model.options
)
options = model.inner.parameters
Expand Down
3 changes: 2 additions & 1 deletion src/algorithms/sqp_trust_region.jl
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ function print(sqp::AbstractSqpTrOptimizer, status_mark = " ")
st = ifelse(sqp.feasibility_restoration, "FR", status_mark)
@printf("%2s%6d", st, sqp.iter)
@printf("%1s", ifelse(sqp.step_acceptance, "a", "r"))
@printf(" %+6.8e", sqp.f)
objective_scale = sqp.problem.sense == :Min ? 1 : -1
@printf(" %+6.8e", sqp.f * objective_scale)
@printf(" %+6.8e", sqp.phi)
@printf(" %+6.8e", sqp.μ)
@printf(" %+6.8e", norm(sqp.lambda,Inf))
Expand Down
3 changes: 2 additions & 1 deletion src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ mutable struct Model{T,TD} <: AbstractSqpModel
eval_jac_g::Function,
eval_h::Union{Function,Nothing},
num_linear_constraints::Int,
sense::Symbol, # {:Min, :Max}
parameters::Parameters
) where {T, TD<:AbstractArray{T}} = new{T,TD}(
n, m,
Expand All @@ -60,7 +61,7 @@ mutable struct Model{T,TD} <: AbstractSqpModel
-5,
eval_f, eval_g, eval_grad_f, eval_jac_g, eval_h,
num_linear_constraints,
nothing, :Min,
nothing, sense,
parameters,
Dict{String,Any}()
)
Expand Down

0 comments on commit 684f98a

Please sign in to comment.