-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MOI.VectorNonlinearFunction #204
Comments
Why do you want to support this? |
The only real reason is Others like |
A colleague wanted to verify the sparsity pattern of the Jacobian of the constraints / Hessian of the Lagrangian and got this error: nlp = MathOptNLPModel(model):
ERROR: Function MathOptInterface.VectorNonlinearFunction is not supported. I suppose that he used function tracing because he only defined the following functions: function obj_vecchia(w::AbstractVector, cache::VecchiaCache)
t1 = -cache.M * sum(w[(cache.nnz_L+1):end])
t2 = sum(
sum(
sum(
w[r] * cache.samples[k, cache.rows[r]]
for r in cache.colptr[j]:(cache.colptr[j+1] - 1)
)^2
for j in 1:cache.n
)
for k in 1:cache.M
)
return t1 + 0.5 * t2
end
function cons_vecchia(w::AbstractVector, cache::VecchiaCache)
#return exp.(w[(1:cache.n).+cache.nnz_L]) .- w[cache.colptr[1:end-1]]
return [exp(w[i]) - w[j] for (i, j) in zip((1:cache.n).+cache.nnz_L, cache.colptr[1:end-1])]
end
@constraint(model, cons_vecchia(w, cache) == 0)
@objective(model, Min, obj_vecchia(w, cache)) I didn't planned to support to support |
@CalebDerrickson |
Do I guess the issue is that you're not using the bridges to declare what sets you support. |
Sure, this should be my full code block @amontoison. I verified the change from ``
`` |
Thanks @CalebDerrickson! Thanks for your help Oscar! |
No description provided.
The text was updated successfully, but these errors were encountered: