Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The model and solver were both
void*, souno_optimize(model, solver)compiled silently. They are now distinct incompletestructtypes; the getters take aconst uno_solver*. The ABI is unchanged, C code still compiles (implicitvoid*conversions), and the Julia/Fortran wrappers are unchanged (Ptr{Cvoid}/type(c_ptr)):wrapper_julia.jlmaps the handles toPtr{Cvoid}. C++ callers need the typed handles.The model setters returned
bool(true upon success), unlike the options, result and optimize functions, and contrary to the README (0 upon success). They now returnUNO_MODEL_SUCCESS(0),UNO_MODEL_INVALID_ARGUMENT,UNO_MODEL_INVALID_INDEX,UNO_MODEL_INVALID_VALUEorUNO_MODEL_ERROR;uno_set_solver_callbacksreturnsUNO_SOLVER_SUCCESS/INVALID_ARGUMENT/ERROR. ANULLarray passed to a bound or initial-iterate setter is now consistentlyUNO_MODEL_INVALID_ARGUMENT(it was a silent success for the bounds).In C, a
static constobject is not an integer constant expression: the status codes could not be used as case labels. The integer constants are now enumerators, grouped in namedenums; the functions still take and returnuno_int. The version numbers are preprocessor macros, so that code can be written for both Uno 2.9 and 2.10 (#if UNO_VERSION_MINOR >= 10).The Python constants are cast (pybind11 cannot convert unregistered enums), the C API guard deduces its return type from the function,
wrapper_julia.jlignores the enum tags and version macros (constants still come from the prologue), andwrapper_fortran.jlreads the version from the macros.uno_set_logger_stream_callbackanduno_reset_logger_streamset a process-wide stream (and left a dangling global stream object), anduno_optimizeset the global logger level from its options for the rest of the program. The stream is now stored in the solver (uno_set_logger_stream_callback(solver, ...),uno_reset_logger_stream(solver),UNO_SOLVER_*codes), anduno_optimizeinstalls the stream and level of the solver for the duration of the optimization and restores the previous ones afterwards (RAII, also on exceptions). The logger of the core is still process-wide: concurrent optimizations in several threads remain unsupported (documented).the Jacobian callback receives
number_constraints(afternumber_variables), like the constraint, Hessian and operator callbacks.every evaluation callback receives a flag$O(n)$ per evaluation). The
new_xright afterx(as in IPOPT):trueifxdiffers from the point of the previous evaluation (of any function, during the current optimization), so that users can cache the quantities that depend only onx.UnoModelkeeps a copy of the previous point and compares it exactly (evaluate_at_xflag of the Jacobian, transposed Jacobian and Hessian operator callbacks is removed (Uno always passed true).Updated: callers in the C API, the C/Fortran examples and tests, the CUTEst driver (
new_xunused;got_j/got_h = .FALSE., as before), the Fortran abstract interfaces (prologue anduno_c.f90), the C README and the Julia C wrapper (new_xis ignored; the Julia-leveleval_Jv,eval_Jtvandeval_Hvfunctions keep their signature and receive true forevaluate_at_x).cc @amontoison