Skip to content

Commit

Permalink
update GMP to MomentOpt
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoffrin committed May 9, 2019
1 parent 09e4b97 commit 957ccba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions examples/polopt.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Solve a global optimization problem with GMP.jl
Solve a global optimization problem with MomentOpt.jl
For theortic background see : https://epubs.siam.org/doi/10.1137/S1052623400366802
Let K be a basic semialgebraic compact set and f a polynomial function. We are intersted in
Expand All @@ -8,13 +8,13 @@
min f(x)
x∈K
An equivalent formulation of this problem as GMP is given by
An equivalent formulation of this problem as Generalized Moment Problem is given by
min <μ,f>
<μ,1> = 1
μ∈M(K)
The optimal measure in the GMP above will be atomic and each atom will be a global minimizer
The optimal measure in the Generalized Moment Problem above will be atomic and each atom will be a global minimizer
of f on K.
"""

Expand Down
8 changes: 4 additions & 4 deletions examples/volume.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
Approximate the volume of a semi algebraic set with GMP.jl.
Approximate the volume of a semi algebraic set with MomentOpt.jl.
For theoretical background see : https://homepages.laas.fr/henrion/Papers/volume.pdf
Let K ⊆ B ⊆ R^n be semialgebraic compact sets and the moments of a the Lebesgue meausre
on B be known. One is interested in computing the volume of K. This can be done by solving
the GMP
the Generalized Moment Problem
max <μ,1>
μ + ν = λ
Expand Down Expand Up @@ -39,8 +39,8 @@ using Plots
pyplot()


# relaxation order for the GMP
order =6
# relaxation order for the Generalized Moment Problem
order = 6

# polnomial variables
@polyvar x y
Expand Down
10 changes: 5 additions & 5 deletions src/model.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export GMPModel, add_measure!, measures, add_constraints!, add_constraint!

"""
GMP
A Generalized Moment Problem
"""
mutable struct GMPModel
objective::OBJ where OBJ<:AbstractMomentObjective
constraints::Vector{<:AbstractMomentConstraint}
measures::Vector{Measure}

dual::JuMP.Model
dual::JuMP.Model
cref::Dict{Measure,Any}
dref::Dict{Any,Any}
dstatus::MathOptInterface.TerminationStatusCode
Expand Down Expand Up @@ -45,7 +45,7 @@ end

function add_measure!(m::GMPModel, name::String, vars::Vector{V} ;kwargs...) where V<:MP.AbstractVariable
append!(m.measures,[Measure(name,vars;kwargs...)])
end
end

function measures(gmp::GMPModel)
return gmp.measures
Expand Down Expand Up @@ -99,7 +99,7 @@ function add_objective!(gmp::GMPModel,sense::Symbol,mu::Measure,pol::PT) where {
obj = MomObj(sense, Mom(pol,mu))
add_objective!(gmp,obj)
end

function add_objective!(gmp::GMPModel,sense::Symbol,pol::T,mu::Measure) where {M<:AbstractMomentExpressionLike, T<:Number}
obj = MomObj(sense, CMom(pol,mu))
add_objective!(gmp,obj)
Expand All @@ -109,4 +109,4 @@ function add_objective!(gmp::GMPModel,sense::Symbol,mu::Measure,pol::T) where {M
obj = MomObj(sense, CMom(pol,mu))
add_objective!(gmp,obj)
end

0 comments on commit 957ccba

Please sign in to comment.