sleipnirgroup-jormungandr 0.6.7.dev132__tar.gz → 0.6.7.dev134__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/PKG-INFO +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/cmake/CompilerFlags.cmake +1 -5
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/problem.hpp +34 -31
- sleipnirgroup_jormungandr-0.6.7.dev134/include/sleipnir/optimization/solver/control_flow.hpp +17 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/ipm.hpp +30 -21
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/newton.hpp +5 -3
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/sqp.hpp +25 -16
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +12 -10
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/docstrings.hpp +5 -7
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/bind_problem.cpp +23 -5
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/src/sleipnir/__init__.py +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/problem_spy_test.py +1 -2
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/solver/exit_status_test.py +7 -4
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/optimization/solver/ipm.cpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/optimization/solver/newton.cpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/optimization/solver/sqp.cpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/CMakeLists.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/LICENSE.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/README.md +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/SleipnirConfig.cmake.in +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/cmake/BuildTypes.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/cmake/Pybind11Mkdoc.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/cmake/Pybind11MkdocPostprocess.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/cmake/SubdirList.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/cmake/aarch64-linux-gnu.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/cmake/arm-none-eabi.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/expression.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/expression_functions.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/expression_graph.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/expression_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/gradient.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/hessian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/jacobian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/slice.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/variable.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/variable_block.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/autodiff/variable_matrix.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/multistart.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/ocp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/iteration_info.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/options.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/constraint_violation.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/dense_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/filter.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/inertia.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/kkt_error.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/kkt_ordering.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/regularization_limits.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/sparse_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/optimization/solver/util/time_trace.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/assert.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/concepts.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/empty.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/force_inline.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/function_ref.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/pool.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/print.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/print_diagnostics.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/scope_exit.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/spy.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/symbol_exports.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/include/sleipnir/util/time_tracer.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/pyproject.toml +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/arity.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/autodiff/bind_gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/autodiff/bind_hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/autodiff/bind_variable.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/autodiff/bind_variable_block.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/autodiff/bind_variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/binders.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/for_each_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/main.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/bind_ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/slice_tuple.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/text_wrap.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/cpp/try_cast.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/postprocess_stubs.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/src/sleipnir/autodiff/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/src/sleipnir/optimization/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/autodiff/gradient_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/autodiff/hessian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/autodiff/jacobian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/autodiff/variable_matrix_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/autodiff/variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/cart_pole_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/cart_pole_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/cart_pole_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/constraints_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/decision_variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/differential_drive_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/differential_drive_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/differential_drive_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/double_integrator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/flywheel_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/flywheel_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/flywheel_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/linear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/multistart_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/nonlinear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/quadratic_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/rk4.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/tolerance.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/python/test/optimization/trivial_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/autodiff/gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/autodiff/hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/autodiff/jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/autodiff/variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/optimization/ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/optimization/problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/util/pool.cpp +0 -0
|
@@ -4,12 +4,8 @@ function(compiler_flags target)
|
|
|
4
4
|
|
|
5
5
|
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|
6
6
|
# Suppress the following warnings:
|
|
7
|
-
# * -Warray-bounds= (false positives)
|
|
8
7
|
# * -Wpsabi (notes about a GCC 10.1 ABI change on aarch64)
|
|
9
|
-
target_compile_options(
|
|
10
|
-
${target}
|
|
11
|
-
PRIVATE -Wno-array-bounds -Wno-psabi
|
|
12
|
-
)
|
|
8
|
+
target_compile_options(${target} PRIVATE -Wno-psabi)
|
|
13
9
|
endif()
|
|
14
10
|
else()
|
|
15
11
|
# Suppress the following warnings:
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
#include "sleipnir/autodiff/jacobian.hpp"
|
|
25
25
|
#include "sleipnir/autodiff/variable.hpp"
|
|
26
26
|
#include "sleipnir/autodiff/variable_matrix.hpp"
|
|
27
|
+
#include "sleipnir/optimization/solver/control_flow.hpp"
|
|
27
28
|
#include "sleipnir/optimization/solver/exit_status.hpp"
|
|
28
29
|
#include "sleipnir/optimization/solver/ipm.hpp"
|
|
29
30
|
#include "sleipnir/optimization/solver/ipm_matrix_callbacks.hpp"
|
|
@@ -352,19 +353,19 @@ class Problem {
|
|
|
352
353
|
[=, callback =
|
|
353
354
|
std::forward<F>(callback)](const IterationInfo<Scalar>& info) {
|
|
354
355
|
callback(info);
|
|
355
|
-
return
|
|
356
|
+
return ControlFlow::CONTINUE;
|
|
356
357
|
});
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
/// Adds a callback to be called at the beginning of each solver iteration.
|
|
360
361
|
///
|
|
361
|
-
/// The callback for this overload should return
|
|
362
|
+
/// The callback for this overload should return ControlFlow.
|
|
362
363
|
///
|
|
363
|
-
/// @param callback The callback. Returning
|
|
364
|
-
///
|
|
364
|
+
/// @param callback The callback. Returning ControlFlow::BREAK from the
|
|
365
|
+
/// callback stops solving and returns the solution so far.
|
|
365
366
|
template <typename F>
|
|
366
367
|
requires requires(F callback, const IterationInfo<Scalar>& info) {
|
|
367
|
-
{ callback(info) } -> std::same_as<
|
|
368
|
+
{ callback(info) } -> std::same_as<ControlFlow>;
|
|
368
369
|
}
|
|
369
370
|
void add_callback(F&& callback) {
|
|
370
371
|
m_iteration_callbacks.emplace_back(std::forward<F>(callback));
|
|
@@ -379,11 +380,11 @@ class Problem {
|
|
|
379
380
|
/// callbacks that shouldn't be removed by clear_callbacks(). Persistent
|
|
380
381
|
/// callbacks run after non-persistent callbacks.
|
|
381
382
|
///
|
|
382
|
-
/// @param callback The callback. Returning
|
|
383
|
-
///
|
|
383
|
+
/// @param callback The callback. Returning ControlFlow::BREAK from the
|
|
384
|
+
/// callback stops solving and returns the solution so far.
|
|
384
385
|
template <typename F>
|
|
385
386
|
requires requires(F callback, const IterationInfo<Scalar>& info) {
|
|
386
|
-
{ callback(info) } -> std::same_as<
|
|
387
|
+
{ callback(info) } -> std::same_as<ControlFlow>;
|
|
387
388
|
}
|
|
388
389
|
void add_persistent_callback(F&& callback) {
|
|
389
390
|
m_persistent_iteration_callbacks.emplace_back(std::forward<F>(callback));
|
|
@@ -406,9 +407,11 @@ class Problem {
|
|
|
406
407
|
gch::small_vector<Variable<Scalar>> m_inequality_constraints;
|
|
407
408
|
|
|
408
409
|
// The iteration callbacks
|
|
409
|
-
gch::small_vector<
|
|
410
|
+
gch::small_vector<
|
|
411
|
+
std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
410
412
|
m_iteration_callbacks;
|
|
411
|
-
gch::small_vector<
|
|
413
|
+
gch::small_vector<
|
|
414
|
+
std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
412
415
|
m_persistent_iteration_callbacks;
|
|
413
416
|
|
|
414
417
|
ExitStatus solve_newton(const Options<Scalar>& options,
|
|
@@ -424,7 +427,8 @@ class Problem {
|
|
|
424
427
|
|
|
425
428
|
int num_decision_variables = m_decision_variables.size();
|
|
426
429
|
|
|
427
|
-
gch::small_vector<
|
|
430
|
+
gch::small_vector<
|
|
431
|
+
std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
428
432
|
iteration_callbacks;
|
|
429
433
|
for (const auto& callback : m_iteration_callbacks) {
|
|
430
434
|
iteration_callbacks.emplace_back(callback);
|
|
@@ -460,11 +464,10 @@ class Problem {
|
|
|
460
464
|
H_spy = std::make_unique<Spy<Scalar>>(
|
|
461
465
|
"H.spy", "Hessian", "Decision variables", "Decision variables",
|
|
462
466
|
num_decision_variables, num_decision_variables);
|
|
463
|
-
iteration_callbacks.push_back(
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
});
|
|
467
|
+
iteration_callbacks.push_back([&](const IterationInfo<Scalar>& info) {
|
|
468
|
+
H_spy->add(info.H);
|
|
469
|
+
return ControlFlow::CONTINUE;
|
|
470
|
+
});
|
|
468
471
|
}
|
|
469
472
|
#endif
|
|
470
473
|
|
|
@@ -507,7 +510,8 @@ class Problem {
|
|
|
507
510
|
int num_decision_variables = m_decision_variables.size();
|
|
508
511
|
int num_equality_constraints = m_equality_constraints.size();
|
|
509
512
|
|
|
510
|
-
gch::small_vector<
|
|
513
|
+
gch::small_vector<
|
|
514
|
+
std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
511
515
|
iteration_callbacks;
|
|
512
516
|
for (const auto& callback : m_iteration_callbacks) {
|
|
513
517
|
iteration_callbacks.emplace_back(callback);
|
|
@@ -563,12 +567,11 @@ class Problem {
|
|
|
563
567
|
"A_e.spy", "Equality constraint Jacobian", "Constraints",
|
|
564
568
|
"Decision variables", num_equality_constraints,
|
|
565
569
|
num_decision_variables);
|
|
566
|
-
iteration_callbacks.push_back(
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
});
|
|
570
|
+
iteration_callbacks.push_back([&](const IterationInfo<Scalar>& info) {
|
|
571
|
+
H_spy->add(info.H);
|
|
572
|
+
A_e_spy->add(info.A_e);
|
|
573
|
+
return ControlFlow::CONTINUE;
|
|
574
|
+
});
|
|
572
575
|
}
|
|
573
576
|
#endif
|
|
574
577
|
|
|
@@ -628,7 +631,8 @@ class Problem {
|
|
|
628
631
|
int num_equality_constraints = m_equality_constraints.size();
|
|
629
632
|
int num_inequality_constraints = m_inequality_constraints.size();
|
|
630
633
|
|
|
631
|
-
gch::small_vector<
|
|
634
|
+
gch::small_vector<
|
|
635
|
+
std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
632
636
|
iteration_callbacks;
|
|
633
637
|
for (const auto& callback : m_iteration_callbacks) {
|
|
634
638
|
iteration_callbacks.emplace_back(callback);
|
|
@@ -696,13 +700,12 @@ class Problem {
|
|
|
696
700
|
"A_i.spy", "Inequality constraint Jacobian", "Constraints",
|
|
697
701
|
"Decision variables", num_inequality_constraints,
|
|
698
702
|
num_decision_variables);
|
|
699
|
-
iteration_callbacks.push_back(
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
});
|
|
703
|
+
iteration_callbacks.push_back([&](const IterationInfo<Scalar>& info) {
|
|
704
|
+
H_spy->add(info.H);
|
|
705
|
+
A_e_spy->add(info.A_e);
|
|
706
|
+
A_i_spy->add(info.A_i);
|
|
707
|
+
return ControlFlow::CONTINUE;
|
|
708
|
+
});
|
|
706
709
|
}
|
|
707
710
|
#endif
|
|
708
711
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) Sleipnir contributors
|
|
2
|
+
|
|
3
|
+
#pragma once
|
|
4
|
+
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
|
|
7
|
+
namespace slp {
|
|
8
|
+
|
|
9
|
+
/// Solver control flow returned by an iteration callback.
|
|
10
|
+
enum class ControlFlow : uint8_t {
|
|
11
|
+
/// Continue solving.
|
|
12
|
+
CONTINUE,
|
|
13
|
+
/// Stop solving and return the solution so far.
|
|
14
|
+
BREAK,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
} // namespace slp
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#include <Eigen/SparseCore>
|
|
15
15
|
#include <gch/small_vector.hpp>
|
|
16
16
|
|
|
17
|
+
#include "sleipnir/optimization/solver/control_flow.hpp"
|
|
17
18
|
#include "sleipnir/optimization/solver/exit_status.hpp"
|
|
18
19
|
#include "sleipnir/optimization/solver/ipm_matrix_callbacks.hpp"
|
|
19
20
|
#include "sleipnir/optimization/solver/iteration_info.hpp"
|
|
@@ -65,14 +66,15 @@ namespace slp {
|
|
|
65
66
|
/// variables.
|
|
66
67
|
/// @return The exit status.
|
|
67
68
|
template <typename Scalar>
|
|
68
|
-
ExitStatus ipm(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
ExitStatus ipm(
|
|
70
|
+
const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
71
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
72
|
+
iteration_callbacks,
|
|
73
|
+
const Options<Scalar>& options,
|
|
72
74
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
73
|
-
|
|
75
|
+
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
74
76
|
#endif
|
|
75
|
-
|
|
77
|
+
Eigen::VectorX<Scalar>& x) {
|
|
76
78
|
using DenseVector = Eigen::VectorX<Scalar>;
|
|
77
79
|
|
|
78
80
|
// If cᵢ(x) is sufficiently feasible, start the constraint with zero
|
|
@@ -127,16 +129,17 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
127
129
|
/// @param[in,out] iterations The iteration counter.
|
|
128
130
|
/// @return The exit status.
|
|
129
131
|
template <typename Scalar>
|
|
130
|
-
ExitStatus ipm(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
ExitStatus ipm(
|
|
133
|
+
const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
134
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
135
|
+
iteration_callbacks,
|
|
136
|
+
const Options<Scalar>& options, bool in_feasibility_restoration,
|
|
134
137
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
135
|
-
|
|
138
|
+
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
136
139
|
#endif
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
Eigen::VectorX<Scalar>& x, Eigen::VectorX<Scalar>& s,
|
|
141
|
+
Eigen::VectorX<Scalar>& y, Eigen::VectorX<Scalar>& z, Scalar& μ,
|
|
142
|
+
int& iterations) {
|
|
140
143
|
using DenseVector = Eigen::VectorX<Scalar>;
|
|
141
144
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
142
145
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
@@ -397,7 +400,8 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
397
400
|
|
|
398
401
|
// Call iteration callbacks
|
|
399
402
|
for (const auto& callback : iteration_callbacks) {
|
|
400
|
-
if (callback({iterations, x, s, y, z, g, H, A_e, A_i})
|
|
403
|
+
if (callback({iterations, x, s, y, z, g, H, A_e, A_i}) ==
|
|
404
|
+
ControlFlow::BREAK) {
|
|
401
405
|
return ExitStatus::CALLBACK_REQUESTED_STOP;
|
|
402
406
|
}
|
|
403
407
|
}
|
|
@@ -728,14 +732,15 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
728
732
|
feasibility_restoration_cycle_detector.is_cycling();
|
|
729
733
|
|
|
730
734
|
// Feasibility restoration phase
|
|
731
|
-
gch::small_vector<
|
|
735
|
+
gch::small_vector<
|
|
736
|
+
std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
732
737
|
callbacks;
|
|
733
738
|
for (auto& callback : iteration_callbacks) {
|
|
734
739
|
callbacks.emplace_back(callback);
|
|
735
740
|
}
|
|
736
741
|
callbacks.emplace_back([&](const IterationInfo<Scalar>& info) {
|
|
737
742
|
if (run_feasibility_restoration_to_convergence) {
|
|
738
|
-
return
|
|
743
|
+
return ControlFlow::CONTINUE;
|
|
739
744
|
}
|
|
740
745
|
|
|
741
746
|
DenseVector trial_x =
|
|
@@ -755,9 +760,13 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
755
760
|
// is accepted by the normal filter, stop feasibility restoration
|
|
756
761
|
FilterEntry trial_entry{matrices.f(trial_x), trial_s, trial_c_e,
|
|
757
762
|
trial_c_i, μ};
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
763
|
+
if (trial_entry.constraint_violation <
|
|
764
|
+
Scalar(0.9) * initial_entry.constraint_violation &&
|
|
765
|
+
filter.is_acceptable(trial_entry)) {
|
|
766
|
+
return ControlFlow::BREAK;
|
|
767
|
+
} else {
|
|
768
|
+
return ControlFlow::CONTINUE;
|
|
769
|
+
}
|
|
761
770
|
});
|
|
762
771
|
auto status =
|
|
763
772
|
feasibility_restoration<Scalar>(matrices, callbacks, options,
|
|
@@ -885,7 +894,7 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
885
894
|
|
|
886
895
|
extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
887
896
|
ipm(const IPMMatrixCallbacks<double>& matrix_callbacks,
|
|
888
|
-
std::span<std::function<
|
|
897
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
889
898
|
iteration_callbacks,
|
|
890
899
|
const Options<double>& options,
|
|
891
900
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
#include <Eigen/Core>
|
|
14
14
|
#include <Eigen/SparseCore>
|
|
15
15
|
|
|
16
|
+
#include "sleipnir/optimization/solver/control_flow.hpp"
|
|
16
17
|
#include "sleipnir/optimization/solver/exit_status.hpp"
|
|
17
18
|
#include "sleipnir/optimization/solver/iteration_info.hpp"
|
|
18
19
|
#include "sleipnir/optimization/solver/newton_matrix_callbacks.hpp"
|
|
@@ -52,7 +53,7 @@ namespace slp {
|
|
|
52
53
|
template <typename Scalar>
|
|
53
54
|
ExitStatus newton(
|
|
54
55
|
const NewtonMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
55
|
-
std::span<std::function<
|
|
56
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
56
57
|
iteration_callbacks,
|
|
57
58
|
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x) {
|
|
58
59
|
using DenseVector = Eigen::VectorX<Scalar>;
|
|
@@ -143,7 +144,8 @@ ExitStatus newton(
|
|
|
143
144
|
|
|
144
145
|
// Call iteration callbacks
|
|
145
146
|
for (const auto& callback : iteration_callbacks) {
|
|
146
|
-
if (callback({iterations, x, {}, {}, {}, g, H, {}, {}})
|
|
147
|
+
if (callback({iterations, x, {}, {}, {}, g, H, {}, {}}) ==
|
|
148
|
+
ControlFlow::BREAK) {
|
|
147
149
|
return ExitStatus::CALLBACK_REQUESTED_STOP;
|
|
148
150
|
}
|
|
149
151
|
}
|
|
@@ -290,7 +292,7 @@ ExitStatus newton(
|
|
|
290
292
|
|
|
291
293
|
extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
292
294
|
newton(const NewtonMatrixCallbacks<double>& matrix_callbacks,
|
|
293
|
-
std::span<std::function<
|
|
295
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
294
296
|
iteration_callbacks,
|
|
295
297
|
const Options<double>& options, Eigen::VectorX<double>& x);
|
|
296
298
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#include <Eigen/SparseCore>
|
|
15
15
|
#include <gch/small_vector.hpp>
|
|
16
16
|
|
|
17
|
+
#include "sleipnir/optimization/solver/control_flow.hpp"
|
|
17
18
|
#include "sleipnir/optimization/solver/exit_status.hpp"
|
|
18
19
|
#include "sleipnir/optimization/solver/iteration_info.hpp"
|
|
19
20
|
#include "sleipnir/optimization/solver/options.hpp"
|
|
@@ -58,10 +59,11 @@ namespace slp {
|
|
|
58
59
|
/// variables.
|
|
59
60
|
/// @return The exit status.
|
|
60
61
|
template <typename Scalar>
|
|
61
|
-
ExitStatus sqp(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
ExitStatus sqp(
|
|
63
|
+
const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
64
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
65
|
+
iteration_callbacks,
|
|
66
|
+
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x) {
|
|
65
67
|
using DenseVector = Eigen::VectorX<Scalar>;
|
|
66
68
|
|
|
67
69
|
DenseVector y = DenseVector::Zero(matrix_callbacks.num_equality_constraints);
|
|
@@ -92,11 +94,12 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
92
94
|
/// constraint dual variables.
|
|
93
95
|
/// @return The exit status.
|
|
94
96
|
template <typename Scalar>
|
|
95
|
-
ExitStatus sqp(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
ExitStatus sqp(
|
|
98
|
+
const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
99
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
100
|
+
iteration_callbacks,
|
|
101
|
+
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x,
|
|
102
|
+
Eigen::VectorX<Scalar>& y) {
|
|
100
103
|
using DenseVector = Eigen::VectorX<Scalar>;
|
|
101
104
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
102
105
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
@@ -268,7 +271,8 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
268
271
|
|
|
269
272
|
// Call iteration callbacks
|
|
270
273
|
for (const auto& callback : iteration_callbacks) {
|
|
271
|
-
if (callback({iterations, x, {}, y, {}, g, H, A_e, {}})
|
|
274
|
+
if (callback({iterations, x, {}, y, {}, g, H, A_e, {}}) ==
|
|
275
|
+
ControlFlow::BREAK) {
|
|
272
276
|
return ExitStatus::CALLBACK_REQUESTED_STOP;
|
|
273
277
|
}
|
|
274
278
|
}
|
|
@@ -522,14 +526,15 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
522
526
|
feasibility_restoration_cycle_detector.is_cycling();
|
|
523
527
|
|
|
524
528
|
// Feasibility restoration phase
|
|
525
|
-
gch::small_vector<
|
|
529
|
+
gch::small_vector<
|
|
530
|
+
std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
526
531
|
callbacks;
|
|
527
532
|
for (auto& callback : iteration_callbacks) {
|
|
528
533
|
callbacks.emplace_back(callback);
|
|
529
534
|
}
|
|
530
535
|
callbacks.emplace_back([&](const IterationInfo<Scalar>& info) {
|
|
531
536
|
if (run_feasibility_restoration_to_convergence) {
|
|
532
|
-
return
|
|
537
|
+
return ControlFlow::CONTINUE;
|
|
533
538
|
}
|
|
534
539
|
|
|
535
540
|
DenseVector trial_x =
|
|
@@ -541,9 +546,13 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
541
546
|
|
|
542
547
|
// If the current iterate sufficiently reduces constraint violation and
|
|
543
548
|
// is accepted by the normal filter, stop feasibility restoration
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
549
|
+
if (trial_entry.constraint_violation <
|
|
550
|
+
Scalar(0.9) * initial_entry.constraint_violation &&
|
|
551
|
+
filter.is_acceptable(trial_entry)) {
|
|
552
|
+
return ControlFlow::BREAK;
|
|
553
|
+
} else {
|
|
554
|
+
return ControlFlow::CONTINUE;
|
|
555
|
+
}
|
|
547
556
|
});
|
|
548
557
|
auto status = feasibility_restoration<Scalar>(matrices, callbacks,
|
|
549
558
|
options, x, y, iterations);
|
|
@@ -624,7 +633,7 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
624
633
|
|
|
625
634
|
extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
626
635
|
sqp(const SQPMatrixCallbacks<double>& matrix_callbacks,
|
|
627
|
-
std::span<std::function<
|
|
636
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
628
637
|
iteration_callbacks,
|
|
629
638
|
const Options<double>& options, Eigen::VectorX<double>& x);
|
|
630
639
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
#include <Eigen/SparseCore>
|
|
14
14
|
#include <gch/small_vector.hpp>
|
|
15
15
|
|
|
16
|
+
#include "sleipnir/optimization/solver/control_flow.hpp"
|
|
16
17
|
#include "sleipnir/optimization/solver/exit_status.hpp"
|
|
17
18
|
#include "sleipnir/optimization/solver/ipm_matrix_callbacks.hpp"
|
|
18
19
|
#include "sleipnir/optimization/solver/iteration_info.hpp"
|
|
@@ -25,16 +26,17 @@
|
|
|
25
26
|
namespace slp {
|
|
26
27
|
|
|
27
28
|
template <typename Scalar>
|
|
28
|
-
ExitStatus ipm(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
ExitStatus ipm(
|
|
30
|
+
const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
31
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
32
|
+
iteration_callbacks,
|
|
33
|
+
const Options<Scalar>& options, bool in_feasibility_restoration,
|
|
32
34
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
33
|
-
|
|
35
|
+
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
34
36
|
#endif
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
Eigen::VectorX<Scalar>& x, Eigen::VectorX<Scalar>& s,
|
|
38
|
+
Eigen::VectorX<Scalar>& y, Eigen::VectorX<Scalar>& z, Scalar& μ,
|
|
39
|
+
int& iterations);
|
|
38
40
|
|
|
39
41
|
/// Computes initial values for p and n in feasibility restoration.
|
|
40
42
|
///
|
|
@@ -113,7 +115,7 @@ std::tuple<Eigen::VectorX<Scalar>, Eigen::VectorX<Scalar>> compute_p_n(
|
|
|
113
115
|
template <typename Scalar>
|
|
114
116
|
ExitStatus feasibility_restoration(
|
|
115
117
|
const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
116
|
-
std::span<std::function<
|
|
118
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
117
119
|
iteration_callbacks,
|
|
118
120
|
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x,
|
|
119
121
|
Eigen::VectorX<Scalar>& y, int& iterations) {
|
|
@@ -371,7 +373,7 @@ ExitStatus feasibility_restoration(
|
|
|
371
373
|
template <typename Scalar>
|
|
372
374
|
ExitStatus feasibility_restoration(
|
|
373
375
|
const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
374
|
-
std::span<std::function<
|
|
376
|
+
std::span<std::function<ControlFlow(const IterationInfo<Scalar>& info)>>
|
|
375
377
|
iteration_callbacks,
|
|
376
378
|
const Options<Scalar>& options,
|
|
377
379
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
@@ -798,12 +798,11 @@ constexpr char mkd_doc_slp_Problem_add_callback_2[] =
|
|
|
798
798
|
R"doc(Adds a callback to be called at the beginning of each solver
|
|
799
799
|
iteration.
|
|
800
800
|
|
|
801
|
-
The callback for this overload should return
|
|
801
|
+
The callback for this overload should return ControlFlow.
|
|
802
802
|
|
|
803
803
|
Args:
|
|
804
|
-
callback: The callback. Returning
|
|
805
|
-
|
|
806
|
-
far.
|
|
804
|
+
callback: The callback. Returning ControlFlow::BREAK from the
|
|
805
|
+
callback stops solving and returns the solution so far.
|
|
807
806
|
|
|
808
807
|
)doc";
|
|
809
808
|
|
|
@@ -816,9 +815,8 @@ register callbacks that shouldn't be removed by clear_callbacks().
|
|
|
816
815
|
Persistent callbacks run after non-persistent callbacks.
|
|
817
816
|
|
|
818
817
|
Args:
|
|
819
|
-
callback: The callback. Returning
|
|
820
|
-
|
|
821
|
-
far.
|
|
818
|
+
callback: The callback. Returning ControlFlow::BREAK from the
|
|
819
|
+
callback stops solving and returns the solution so far.
|
|
822
820
|
|
|
823
821
|
)doc";
|
|
824
822
|
|
|
@@ -127,11 +127,11 @@ void bind_problem(nb::class_<Problem<double>>& cls) {
|
|
|
127
127
|
new (self) Problem<double>();
|
|
128
128
|
|
|
129
129
|
// Make Python signals (e.g., SIGINT from Ctrl-C) abort the solve
|
|
130
|
-
self->add_persistent_callback([](const IterationInfo<double>&)
|
|
130
|
+
self->add_persistent_callback([](const IterationInfo<double>&) {
|
|
131
131
|
if (PyErr_CheckSignals() != 0) {
|
|
132
132
|
throw nb::python_error();
|
|
133
133
|
}
|
|
134
|
-
return
|
|
134
|
+
return ControlFlow::CONTINUE;
|
|
135
135
|
});
|
|
136
136
|
},
|
|
137
137
|
DOC(slp, Problem, Problem));
|
|
@@ -206,10 +206,28 @@ void bind_problem(nb::class_<Problem<double>>& cls) {
|
|
|
206
206
|
cls.def(
|
|
207
207
|
"add_callback",
|
|
208
208
|
[](Problem<double>& self,
|
|
209
|
-
std::function<
|
|
210
|
-
self.add_callback(std::move(callback)
|
|
209
|
+
std::function<void(const IterationInfo<double>& info)> callback) {
|
|
210
|
+
self.add_callback([callback = std::move(callback)](
|
|
211
|
+
const IterationInfo<double>& info) {
|
|
212
|
+
try {
|
|
213
|
+
callback(info);
|
|
214
|
+
} catch (nb::python_error& e) {
|
|
215
|
+
if (e.matches(PyExc_StopIteration)) {
|
|
216
|
+
return ControlFlow::BREAK;
|
|
217
|
+
}
|
|
218
|
+
throw;
|
|
219
|
+
}
|
|
220
|
+
return ControlFlow::CONTINUE;
|
|
221
|
+
});
|
|
211
222
|
},
|
|
212
|
-
"callback"_a,
|
|
223
|
+
"callback"_a,
|
|
224
|
+
R"doc(Adds a callback to be called at the beginning of each solver
|
|
225
|
+
iteration.
|
|
226
|
+
|
|
227
|
+
Args:
|
|
228
|
+
callback: The callback. Raising StopIteration from the callback stops
|
|
229
|
+
solving and returns the solution so far.
|
|
230
|
+
)doc");
|
|
213
231
|
cls.def("clear_callbacks", &Problem<double>::clear_callbacks,
|
|
214
232
|
DOC(slp, Problem, clear_callbacks));
|
|
215
233
|
}
|
|
@@ -57,10 +57,9 @@ def test_problem_spy() -> None:
|
|
|
57
57
|
global iterations
|
|
58
58
|
iterations = 0
|
|
59
59
|
|
|
60
|
-
def callback(info: IterationInfo) ->
|
|
60
|
+
def callback(info: IterationInfo) -> None:
|
|
61
61
|
global iterations
|
|
62
62
|
iterations += 1
|
|
63
|
-
return False
|
|
64
63
|
|
|
65
64
|
problem.add_callback(callback)
|
|
66
65
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import pytest
|
|
4
4
|
from sleipnir.autodiff import ExpressionType, sqrt
|
|
5
|
-
from sleipnir.optimization import ExitStatus, Problem
|
|
5
|
+
from sleipnir.optimization import ExitStatus, IterationInfo, Problem
|
|
6
6
|
from tolerance import solution_tolerance
|
|
7
7
|
|
|
8
8
|
|
|
@@ -11,16 +11,19 @@ def test_callback_requested_stop() -> None:
|
|
|
11
11
|
x = problem.decision_variable()
|
|
12
12
|
problem.minimize(x * x)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
def stop(info: IterationInfo) -> None:
|
|
15
|
+
raise StopIteration
|
|
16
|
+
|
|
17
|
+
problem.add_callback(lambda info: None)
|
|
15
18
|
x.set_value(1)
|
|
16
19
|
assert problem.solve(diagnostics=True) == ExitStatus.SUCCESS
|
|
17
20
|
|
|
18
|
-
problem.add_callback(
|
|
21
|
+
problem.add_callback(stop)
|
|
19
22
|
x.set_value(1)
|
|
20
23
|
assert problem.solve(diagnostics=True) == ExitStatus.CALLBACK_REQUESTED_STOP
|
|
21
24
|
|
|
22
25
|
problem.clear_callbacks()
|
|
23
|
-
problem.add_callback(lambda info:
|
|
26
|
+
problem.add_callback(lambda info: None)
|
|
24
27
|
x.set_value(1)
|
|
25
28
|
assert problem.solve(diagnostics=True) == ExitStatus.SUCCESS
|
|
26
29
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
template SLEIPNIR_DLLEXPORT slp::ExitStatus slp::ipm(
|
|
8
8
|
const IPMMatrixCallbacks<double>& matrix_callbacks,
|
|
9
|
-
std::span<std::function<
|
|
9
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
10
10
|
iteration_callbacks,
|
|
11
11
|
const Options<double>& options,
|
|
12
12
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
template SLEIPNIR_DLLEXPORT slp::ExitStatus slp::newton(
|
|
8
8
|
const NewtonMatrixCallbacks<double>& matrix_callbacks,
|
|
9
|
-
std::span<std::function<
|
|
9
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
10
10
|
iteration_callbacks,
|
|
11
11
|
const Options<double>& options, Eigen::VectorX<double>& x);
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
template SLEIPNIR_DLLEXPORT slp::ExitStatus slp::sqp(
|
|
8
8
|
const SQPMatrixCallbacks<double>& matrix_callbacks,
|
|
9
|
-
std::span<std::function<
|
|
9
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
10
10
|
iteration_callbacks,
|
|
11
11
|
const slp::Options<double>& options, Eigen::VectorX<double>& x);
|
{sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/CMakeLists.txt
RENAMED
|
File without changes
|
{sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/LICENSE.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/pyproject.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sleipnirgroup_jormungandr-0.6.7.dev132 → sleipnirgroup_jormungandr-0.6.7.dev134}/src/util/pool.cpp
RENAMED
|
File without changes
|