We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10155e7 commit 060653dCopy full SHA for 060653d
1 file changed
src/conic_form.jl
@@ -42,9 +42,8 @@ end
42
_coef_type(::MOI.Utilities.AbstractModel{T}) where {T} = T
43
44
function objective_vector(model::MOI.ModelLike; T = _coef_type(model))
45
- obj = MOI.get(src, MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}())
46
- dest.objective_constant = MOI.constant(obj)
47
- c = zeros(A.n)
+ obj = MOI.get(model, MOI.ObjectiveFunction{MOI.ScalarAffineFunction{T}}())
+ c = zeros(MOI.get(model, MOI.NumberOfVariables()))
48
for term in obj.terms
49
c[term.variable.value] += term.coefficient
50
end
0 commit comments