ReverseAD zero out the Jtv vector in
https://github.com/jump-dev/MathOptInterface.jl/blob/85afcdbbd30bdb1cdc466bf6d75bcafd49ad1def/src/Nonlinear/ReverseAD/mathoptinterface_api.jl#L266
but it is called after the contribution of the quadratic part has been written
|
fill!(Jtv, 0.0) |
|
offset = length(model.qp_data) |
|
v_qp = view(v, 1:offset) |
|
# Evaluate jtprod for linear-quadratic part of the model. |
|
MOI.eval_constraint_jacobian_transpose_product(model.qp_data, Jtv, x, v_qp) |
|
# Evaluate jtprod for all VectorNonlinearOracle. |
|
for (f, s) in model.vector_nonlinear_oracle_constraints |
|
_eval_constraint_transpose_jacobian_product(Jtv, x, offset, f, s, v) |
|
offset += s.set.output_dimension |
|
end |
|
# Evaluate jtprod for remaining nonlinear expressions. |
|
v_nlp = view(v, (offset+1):length(v)) |
|
MOI.eval_constraint_jacobian_transpose_product(model.nlp_data.evaluator, Jtv, x, v_nlp) |
|
return |
ReverseAD zero out the Jtv vector in
https://github.com/jump-dev/MathOptInterface.jl/blob/85afcdbbd30bdb1cdc466bf6d75bcafd49ad1def/src/Nonlinear/ReverseAD/mathoptinterface_api.jl#L266
but it is called after the contribution of the quadratic part has been written
MadNLP.jl/ext/MadNLPMOI/MOI_wrapper.jl
Lines 1262 to 1275 in 9947ee1