mutable struct LinearProgramData{M<:AbstractLagrangianMethod, C<:AbstractProblemClass}
obj::QuadExpr # objective
constraints::Vector{<:ConstraintRef} # constraints being relaxed
relaxed_bounds::Vector{Float64} # bounds on constraints when we relax them
senses::Vector{Symbol} # we will cache the sense of constraints
slacks::Vector{AffExpr} # also cache Ax-b
old_bound::Vector{Float64} # cache before relaxing constraints
method::M # method parameters
pc::C # problem class
end
function setlagrangianobjective!(m::JuMP.Model, d::LinearProgramData{M, C}, π::Vector{Float64}) where {M<:AbstractLagrangianMethod, C<:LinearProgram}
if getobjectivesense(m) == :Min
if length(d.obj.qvars1) == 0
@objective(m, :Min, d.obj.aff + dot(π, d.slacks))
else
@objective(m, :Min, d.obj + dot(π, d.slacks))
end
else
if length(d.obj.qvars1) == 0
@objective(m, :Max, d.obj.aff - dot(π, d.slacks))
else
@objective(m, :Max, d.obj - dot(π, d.slacks))
end
end
end
我在学习一个JuMP的第三方库,想看懂他是什么意思,但是遇到了问题就是,不知道里面每个变量是什么意思,比如以上代码我想知道qvars1是什么意思(这个变量应该是JuMP的),通过google及搜索JuMP的GitHub库,或者本地运行help都不知道,请问有什么好的办法吗