diff --git a/ext/NLoptMathOptInterfaceExt.jl b/ext/NLoptMathOptInterfaceExt.jl index 1db0261..180d24f 100644 --- a/ext/NLoptMathOptInterfaceExt.jl +++ b/ext/NLoptMathOptInterfaceExt.jl @@ -587,7 +587,7 @@ function _fill_gradient(grad, x, f::MOI.ScalarQuadraticFunction{Float64}) end for term in f.quadratic_terms i, j = term.variable_1.value, term.variable_2.value - grad[i] += term.coefficient * x[i] + grad[i] += term.coefficient * x[j] if i != j grad[j] += term.coefficient * x[i] end