Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamed82008 committed May 14, 2022
1 parent 029af62 commit bea8322
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NonconvexMMA"
uuid = "d3d89cbb-4ecd-4604-818d-8d1ff343e4da"
authors = ["Mohamed Tarek <[email protected]> and contributors"]
version = "0.1.2"
version = "0.1.3"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
9 changes: 3 additions & 6 deletions src/mma_algorithm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,15 @@ end
function MMAWorkspace(
model::VecModel,
optimizer::AbstractOptimizer,
x0::AbstractVector;
x0::AbstractVector{T};
options = default_options(model, optimizer),
convcriteria::ConvergenceCriteria = KKTCriteria(),
plot_trace::Bool = false,
show_plot::Bool = plot_trace,
save_plot = nothing,
callback::Function = plot_trace ? LazyPlottingCallback(; show_plot = show_plot, save_plot = save_plot) : NoCallback(),
kwargs...,
)
T = eltype(x0)
) where {T}
init!(model)
dualmodel = MMADualModel(MMAApproxModel(model, x0; kwargs...))

Expand Down Expand Up @@ -466,8 +465,7 @@ function increaseρ!(
end

function getoptimobj(obj, minimize = true)
optimobj(z) = optimobj(1.0, nothing, z)
function optimobj(F, G, z)
return (F, G, z) -> begin
if G !== nothing
val, grad = value_gradient(obj, z)
if minimize
Expand All @@ -493,5 +491,4 @@ function getoptimobj(obj, minimize = true)
end
return nothing
end
return optimobj
end

2 comments on commit bea8322

@mohamed82008
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/60242

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.3 -m "<description of version>" bea83227394482bbed681de30f314a05f3605763
git push origin v0.1.3

Please sign in to comment.