We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We should be able to do something like
for (jtype, ctype) in ((:Float32, Cfloat), (:Float64, Cdouble)) @eval begin function NLPModels.objgrad!(nlp :: CUTEstModel, x :: Vector{$jtype}, g :: Vector{$jtype}) nvar = nlp.meta.nvar ncon = nlp.meta.ncon f = $ctype[0] io_err = Cint[0] get_grad = 1 if ncon > 0 ccall(dlsym(cutest_lib, "cutest_cofg_"), Nothing, (Ptr{Int32}, Ref{Int32}, Ptr{$jtype}, Ptr{$jtype}, Ptr{$jtype}, Ref{Int32}), io_err, nvar, x, f, g, get_grad); else ccall(dlsym(cutest_lib, "cutest_uofg_"), Nothing, (Ptr{Int32}, Ref{Int32}, Ptr{$jtype}, Ptr{$jtype}, Ptr{$jtype}, Ref{Int32}), io_err, nvar, x, f, g, get_grad); end nlp.counters.neval_obj += 1 nlp.counters.neval_grad += 1 @cutest_error return f[1], g end end end
See #177
The text was updated successfully, but these errors were encountered:
Single and quadruple precision routines are now interfaced.
Sorry, something went wrong.
No branches or pull requests
We should be able to do something like
See #177
The text was updated successfully, but these errors were encountered: