sleipnirgroup-jormungandr 0.6.7.dev147__tar.gz → 0.6.7.dev149__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.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/PKG-INFO +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/ipm.hpp +37 -154
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/newton.hpp +17 -36
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/sqp.hpp +24 -107
- sleipnirgroup_jormungandr-0.6.7.dev149/include/sleipnir/optimization/solver/util/kkt_system.hpp +476 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/src/sleipnir/__init__.py +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/optimization/solver/ipm.cpp +12 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/optimization/solver/sqp.cpp +7 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/CMakeLists.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/LICENSE.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/README.md +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/SleipnirConfig.cmake.in +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/cmake/BuildTypes.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/cmake/CompilerFlags.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/cmake/Pybind11Mkdoc.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/cmake/Pybind11MkdocPostprocess.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/cmake/SubdirList.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/cmake/aarch64-linux-gnu.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/cmake/arm-none-eabi.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/expression.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/expression_functions.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/expression_graph.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/expression_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/gradient.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/hessian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/jacobian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/slice.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/variable.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/variable_block.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/autodiff/variable_matrix.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/multistart.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/ocp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/problem.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/control_flow.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/iteration_info.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/options.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/constraint_violation.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/dense_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/filter.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/kkt_error.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/regularization_limits.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/ruiz_equilibration.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/sparse_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/optimization/solver/util/time_trace.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/assert.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/concepts.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/empty.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/force_inline.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/function_ref.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/pool.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/print.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/print_diagnostics.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/scope_exit.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/spy.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/symbol_exports.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/include/sleipnir/util/time_tracer.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/pyproject.toml +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/.clang-tidy +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/arity.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/autodiff/bind_gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/autodiff/bind_hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/autodiff/bind_variable.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/autodiff/bind_variable_block.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/autodiff/bind_variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/binders.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/docstrings.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/for_each_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/main.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/bind_ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/bind_problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/slice_tuple.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/text_wrap.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/cpp/try_cast.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/postprocess_stubs.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/src/sleipnir/autodiff/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/src/sleipnir/optimization/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/autodiff/gradient_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/autodiff/hessian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/autodiff/jacobian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/autodiff/variable_matrix_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/autodiff/variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/cart_pole_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/cart_pole_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/cart_pole_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/constraints_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/differential_drive_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/differential_drive_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/differential_drive_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/double_integrator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/flywheel_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/flywheel_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/flywheel_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/linear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/multistart_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/nonlinear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/problem_spy_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/problem_variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/quadratic_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/rk4.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/solver/exit_status_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/tolerance.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/python/test/optimization/trivial_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/autodiff/gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/autodiff/hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/autodiff/jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/autodiff/variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/optimization/ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/optimization/problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/optimization/solver/newton.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev147 → sleipnirgroup_jormungandr-0.6.7.dev149}/src/util/pool.cpp +0 -0
|
@@ -20,14 +20,13 @@
|
|
|
20
20
|
#include "sleipnir/optimization/solver/iteration_info.hpp"
|
|
21
21
|
#include "sleipnir/optimization/solver/options.hpp"
|
|
22
22
|
#include "sleipnir/optimization/solver/util/all_finite.hpp"
|
|
23
|
-
#include "sleipnir/optimization/solver/util/append_as_triplets.hpp"
|
|
24
23
|
#include "sleipnir/optimization/solver/util/constraint_violation.hpp"
|
|
25
24
|
#include "sleipnir/optimization/solver/util/feasibility_restoration.hpp"
|
|
26
25
|
#include "sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp"
|
|
27
26
|
#include "sleipnir/optimization/solver/util/filter.hpp"
|
|
28
27
|
#include "sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp"
|
|
29
28
|
#include "sleipnir/optimization/solver/util/kkt_error.hpp"
|
|
30
|
-
#include "sleipnir/optimization/solver/util/
|
|
29
|
+
#include "sleipnir/optimization/solver/util/kkt_system.hpp"
|
|
31
30
|
#include "sleipnir/optimization/solver/util/time_trace.hpp"
|
|
32
31
|
#include "sleipnir/util/assert.hpp"
|
|
33
32
|
#include "sleipnir/util/print_diagnostics.hpp"
|
|
@@ -143,65 +142,6 @@ ExitStatus ipm(
|
|
|
143
142
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
144
143
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
145
144
|
|
|
146
|
-
/// Interior-point method step direction.
|
|
147
|
-
struct Step {
|
|
148
|
-
/// Decision variable primal step.
|
|
149
|
-
DenseVector p_x;
|
|
150
|
-
/// Inequality constraint slack variable primal step.
|
|
151
|
-
DenseVector p_s;
|
|
152
|
-
/// Equality constraint dual step.
|
|
153
|
-
DenseVector p_y;
|
|
154
|
-
/// Inequality constraint dual step.
|
|
155
|
-
DenseVector p_z;
|
|
156
|
-
|
|
157
|
-
/// Returns the infinity norm of the primal step.
|
|
158
|
-
///
|
|
159
|
-
/// @return The infinity norm of the primal step.
|
|
160
|
-
Scalar primal_inf_norm() const {
|
|
161
|
-
return std::max(p_x.template lpNorm<Eigen::Infinity>(),
|
|
162
|
-
p_s.template lpNorm<Eigen::Infinity>());
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/// Returns the infinity norm of the dual step.
|
|
166
|
-
///
|
|
167
|
-
/// @return The infinity norm of the dual step.
|
|
168
|
-
Scalar dual_inf_norm() const {
|
|
169
|
-
return std::max(p_y.template lpNorm<Eigen::Infinity>(),
|
|
170
|
-
p_z.template lpNorm<Eigen::Infinity>());
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/// Returns the step size below which the primal step is negligible
|
|
174
|
-
/// relative to the iterate.
|
|
175
|
-
///
|
|
176
|
-
/// @param x The decision variables.
|
|
177
|
-
/// @param s The inequality constraint slack variables.
|
|
178
|
-
/// @return The step size below which the primal step is negligible
|
|
179
|
-
/// relative to the iterate.
|
|
180
|
-
Scalar tiny_step_size(const DenseVector& x, const DenseVector& s) const {
|
|
181
|
-
using std::max;
|
|
182
|
-
|
|
183
|
-
// A primal step α[pˣ pˢ] is negligible if
|
|
184
|
-
//
|
|
185
|
-
// max(‖αpˣ/(1 + |x|)‖_∞, ‖αpˢ/(1 + |s|)‖_∞) < 10ε
|
|
186
|
-
//
|
|
187
|
-
// where the absolute values and division are elementwise. Since α > 0,
|
|
188
|
-
// it factors out of the norms and max.
|
|
189
|
-
//
|
|
190
|
-
// α max(‖pˣ/(1 + |x|)‖_∞, ‖pˢ/(1 + |s|)‖_∞) < 10ε
|
|
191
|
-
//
|
|
192
|
-
// Dividing both sides by the max gives
|
|
193
|
-
//
|
|
194
|
-
// α < 10ε / max(‖pˣ/(1 + |x|)‖_∞, ‖pˢ/(1 + |s|)‖_∞)
|
|
195
|
-
return Scalar(10) * std::numeric_limits<Scalar>::epsilon() /
|
|
196
|
-
max((p_x.array().abs() / (Scalar(1) + x.array().abs()))
|
|
197
|
-
.matrix()
|
|
198
|
-
.template lpNorm<Eigen::Infinity>(),
|
|
199
|
-
(p_s.array().abs() / (Scalar(1) + s.array().abs()))
|
|
200
|
-
.matrix()
|
|
201
|
-
.template lpNorm<Eigen::Infinity>());
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
|
|
205
145
|
using std::isfinite;
|
|
206
146
|
|
|
207
147
|
const auto solve_start_time = std::chrono::steady_clock::now();
|
|
@@ -336,21 +276,7 @@ ExitStatus ipm(
|
|
|
336
276
|
fallback_kkt_error = std::numeric_limits<Scalar>::infinity();
|
|
337
277
|
};
|
|
338
278
|
|
|
339
|
-
|
|
340
|
-
gch::small_vector<Eigen::Triplet<Scalar>> triplets;
|
|
341
|
-
|
|
342
|
-
const int lhs_rows =
|
|
343
|
-
matrices.num_decision_variables + matrices.num_equality_constraints;
|
|
344
|
-
KKTSolver<Scalar> solver{
|
|
345
|
-
// Use sparse solver if lower triangle fills < 25% of system
|
|
346
|
-
H.nonZeros() +
|
|
347
|
-
(A_i.transpose() * A_i)
|
|
348
|
-
.template triangularView<Eigen::Lower>()
|
|
349
|
-
.eval()
|
|
350
|
-
.nonZeros() +
|
|
351
|
-
A_e.nonZeros() <
|
|
352
|
-
0.25 * lhs_rows * lhs_rows,
|
|
353
|
-
matrices.num_decision_variables, matrices.num_equality_constraints};
|
|
279
|
+
IPMKKTSystem<Scalar> kkt_system{H, A_e, A_i};
|
|
354
280
|
|
|
355
281
|
// Step size reduction factor
|
|
356
282
|
constexpr Scalar α_reduction_factor(0.5);
|
|
@@ -403,74 +329,28 @@ ExitStatus ipm(
|
|
|
403
329
|
|
|
404
330
|
phase_tracer.next(diagnostics[KKT_MATRIX_BUILD]);
|
|
405
331
|
|
|
406
|
-
|
|
407
|
-
// Z = diag(z)
|
|
408
|
-
// Σ = S⁻¹Z
|
|
409
|
-
const SparseMatrix Σ{s.cwiseInverse().asDiagonal() * z.asDiagonal()};
|
|
410
|
-
|
|
411
|
-
// lhs = [H + AᵢᵀΣAᵢ Aₑᵀ]
|
|
412
|
-
// [ Aₑ 0 ]
|
|
413
|
-
//
|
|
414
|
-
// Don't assign upper triangle because solver only uses lower triangle.
|
|
415
|
-
const SparseMatrix top_left =
|
|
416
|
-
H + (A_i.transpose() * Σ * A_i).template triangularView<Eigen::Lower>();
|
|
417
|
-
triplets.clear();
|
|
418
|
-
triplets.reserve(top_left.nonZeros() + A_e.nonZeros());
|
|
419
|
-
append_as_triplets(triplets, 0, 0, {top_left, A_e});
|
|
420
|
-
SparseMatrix lhs(
|
|
421
|
-
matrices.num_decision_variables + matrices.num_equality_constraints,
|
|
422
|
-
matrices.num_decision_variables + matrices.num_equality_constraints);
|
|
423
|
-
lhs.setFromSortedTriplets(triplets.begin(), triplets.end());
|
|
424
|
-
|
|
425
|
-
// rhs = −[∇f − Aₑᵀy − Aᵢᵀ(μS⁻¹e − Σ(cᵢ − s))]
|
|
426
|
-
// [ cₑ ]
|
|
427
|
-
DenseVector rhs{g.rows() + y.rows()};
|
|
428
|
-
DenseVector c_i_minus_s = c_i - s;
|
|
429
|
-
rhs.segment(0, g.rows()) =
|
|
430
|
-
-g + A_e.transpose() * y +
|
|
431
|
-
A_i.transpose() * (μ * s.cwiseInverse() - Σ * c_i_minus_s);
|
|
432
|
-
rhs.segment(g.rows(), y.rows()) = -c_e;
|
|
332
|
+
kkt_system.build(H, A_e, A_i, s, z);
|
|
433
333
|
|
|
434
334
|
phase_tracer.next(diagnostics[KKT_MATRIX_FACTOR]);
|
|
435
335
|
|
|
436
|
-
|
|
437
|
-
Scalar α_max(1);
|
|
438
|
-
Scalar α(1);
|
|
439
|
-
Scalar α_z(1);
|
|
440
|
-
bool call_feasibility_restoration = false;
|
|
441
|
-
|
|
442
|
-
// Solve the Newton-KKT system
|
|
443
|
-
//
|
|
444
|
-
// [H + AᵢᵀΣAᵢ Aₑᵀ][ pˣ] = −[∇f − Aₑᵀy − Aᵢᵀ(μS⁻¹e − Σ(cᵢ − s))]
|
|
445
|
-
// [ Aₑ 0 ][−pʸ] [ cₑ ]
|
|
446
|
-
if (solver.compute(lhs).info() != Eigen::Success) [[unlikely]] {
|
|
336
|
+
if (!kkt_system.factorize()) [[unlikely]] {
|
|
447
337
|
return ExitStatus::FACTORIZATION_FAILED;
|
|
448
338
|
}
|
|
449
339
|
|
|
450
340
|
phase_tracer.next(diagnostics[KKT_SYSTEM_SOLVE]);
|
|
451
341
|
|
|
452
|
-
auto
|
|
453
|
-
// p = [ pˣ]
|
|
454
|
-
// [−pʸ]
|
|
455
|
-
DenseVector p = solver.solve(rhs);
|
|
456
|
-
step.p_x = p.segment(0, x.rows());
|
|
457
|
-
step.p_y = -p.segment(x.rows(), y.rows());
|
|
458
|
-
|
|
459
|
-
// pˢ = cᵢ − s + Aᵢpˣ
|
|
460
|
-
// pᶻ = μS⁻¹e − z − Σpˢ
|
|
461
|
-
step.p_s = c_i_minus_s + A_i * step.p_x;
|
|
462
|
-
step.p_z = μ * s.cwiseInverse() - z - Σ * step.p_s;
|
|
463
|
-
};
|
|
464
|
-
compute_step(step, c_i_minus_s);
|
|
342
|
+
auto step = kkt_system.solve(g, A_e, A_i, y, s, z, μ, c_e, c_i - s);
|
|
465
343
|
|
|
466
344
|
phase_tracer.next(diagnostics[LINE_SEARCH]);
|
|
467
345
|
|
|
346
|
+
bool call_feasibility_restoration = false;
|
|
347
|
+
|
|
468
348
|
// αᵐᵃˣ = max(α ∈ (0, 1] : sₖ + αpₖˢ ≥ (1−τⱼ)sₖ)
|
|
469
|
-
α_max = fraction_to_the_boundary_rule<Scalar>(s, step.p_s, τ);
|
|
470
|
-
α = α_max;
|
|
349
|
+
Scalar α_max = fraction_to_the_boundary_rule<Scalar>(s, step.p_s, τ);
|
|
350
|
+
Scalar α = α_max;
|
|
471
351
|
|
|
472
352
|
// αₖᶻ = max(α ∈ (0, 1] : zₖ + αpₖᶻ ≥ (1−τⱼ)zₖ)
|
|
473
|
-
α_z = fraction_to_the_boundary_rule<Scalar>(z, step.p_z, τ);
|
|
353
|
+
Scalar α_z = fraction_to_the_boundary_rule<Scalar>(z, step.p_z, τ);
|
|
474
354
|
|
|
475
355
|
const FilterEntry<Scalar> current_entry{f, s, c_e, c_i, μ};
|
|
476
356
|
|
|
@@ -572,32 +452,22 @@ ExitStatus ipm(
|
|
|
572
452
|
matrices.scaling, g, A_e, trial_c_e, A_i, trial_c_i,
|
|
573
453
|
trial_s, trial_y, trial_z, Scalar(0), options.tolerance),
|
|
574
454
|
trial_f, constraint_violation(trial_c_e, trial_c_i, trial_s),
|
|
575
|
-
trial_s.dot(trial_z), μ,
|
|
576
|
-
|
|
455
|
+
trial_s.dot(trial_z), μ, kkt_system.hessian_regularization(),
|
|
456
|
+
kkt_system.constraint_jacobian_regularization(),
|
|
577
457
|
soc_step.primal_inf_norm(), soc_step.dual_inf_norm(), α_soc,
|
|
578
458
|
Scalar(1), α_reduction_factor, α_z_soc);
|
|
579
459
|
}
|
|
580
460
|
}};
|
|
581
461
|
|
|
582
|
-
//
|
|
583
|
-
//
|
|
584
|
-
// rhs = −[∇f − Aₑᵀy − Aᵢᵀ(μS⁻¹e − Σ(cᵢ − s)ˢᵒᶜ)]
|
|
585
|
-
// [ cₑˢᵒᶜ ]
|
|
586
|
-
//
|
|
587
|
-
// where
|
|
462
|
+
// Solve the Newton-KKT system with corrected constraint values
|
|
588
463
|
//
|
|
589
464
|
// cₑˢᵒᶜ = αˢᵒᶜcₑ(xₖ) + cₑ(xₖ + αˢᵒᶜpˣˢᵒᶜ)
|
|
590
465
|
// (cᵢ − s)ˢᵒᶜ =
|
|
591
466
|
// αˢᵒᶜ(cᵢ(xₖ) − sₖ) + cᵢ(xₖ + αˢᵒᶜpˣˢᵒᶜ) − (sₖ + αˢᵒᶜpˢˢᵒᶜ)
|
|
592
467
|
c_e_soc = α_soc * c_e_soc + trial_c_e;
|
|
593
468
|
c_i_minus_s_soc = α_soc * c_i_minus_s_soc + trial_c_i - trial_s;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
A_i.transpose() * (μ * s.cwiseInverse() - Σ * c_i_minus_s_soc);
|
|
597
|
-
rhs.segment(g.rows(), y.rows()) = -c_e_soc;
|
|
598
|
-
|
|
599
|
-
// Solve the Newton-KKT system
|
|
600
|
-
compute_step(soc_step, c_i_minus_s_soc);
|
|
469
|
+
soc_step = kkt_system.solve(g, A_e, A_i, y, s, z, μ, c_e_soc,
|
|
470
|
+
c_i_minus_s_soc);
|
|
601
471
|
|
|
602
472
|
// αˢᵒᶜ = max(α ∈ (0, 1] : sₖ + αpₖˢ ≥ (1−τⱼ)sₖ)
|
|
603
473
|
// αₖᶻˢᵒᶜ = max(α ∈ (0, 1] : zₖ + αpₖᶻ ≥ (1−τⱼ)zₖ)
|
|
@@ -857,15 +727,16 @@ ExitStatus ipm(
|
|
|
857
727
|
inner_iter_tracer.stop();
|
|
858
728
|
|
|
859
729
|
if (options.diagnostics) {
|
|
860
|
-
print_iterate_diagnostics(
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
730
|
+
print_iterate_diagnostics(iterations,
|
|
731
|
+
in_feasibility_restoration
|
|
732
|
+
? IterationType::FEASIBILITY_RESTORATION
|
|
733
|
+
: IterationType::NORMAL,
|
|
734
|
+
inner_iter_tracer.current_duration(), E_0, f,
|
|
735
|
+
constraint_violation(c_e, c_i, s), s.dot(z), μ,
|
|
736
|
+
kkt_system.hessian_regularization(),
|
|
737
|
+
kkt_system.constraint_jacobian_regularization(),
|
|
738
|
+
step.primal_inf_norm(), step.dual_inf_norm(), α,
|
|
739
|
+
α_max, α_reduction_factor, α_z);
|
|
869
740
|
}
|
|
870
741
|
|
|
871
742
|
++iterations;
|
|
@@ -898,4 +769,16 @@ ipm(const IPMMatrixCallbacks<double>& matrix_callbacks,
|
|
|
898
769
|
#endif
|
|
899
770
|
Eigen::VectorX<double>& x);
|
|
900
771
|
|
|
772
|
+
extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
773
|
+
ipm(const IPMMatrixCallbacks<double>& matrix_callbacks,
|
|
774
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
775
|
+
iteration_callbacks,
|
|
776
|
+
const Options<double>& options, bool in_feasibility_restoration,
|
|
777
|
+
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
778
|
+
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
779
|
+
#endif
|
|
780
|
+
Eigen::VectorX<double>& x, Eigen::VectorX<double>& s,
|
|
781
|
+
Eigen::VectorX<double>& y, Eigen::VectorX<double>& z, double& μ,
|
|
782
|
+
int& iterations);
|
|
783
|
+
|
|
901
784
|
} // namespace slp
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
#include "sleipnir/optimization/solver/util/all_finite.hpp"
|
|
22
22
|
#include "sleipnir/optimization/solver/util/filter.hpp"
|
|
23
23
|
#include "sleipnir/optimization/solver/util/kkt_error.hpp"
|
|
24
|
-
#include "sleipnir/optimization/solver/util/
|
|
24
|
+
#include "sleipnir/optimization/solver/util/kkt_system.hpp"
|
|
25
25
|
#include "sleipnir/optimization/solver/util/time_trace.hpp"
|
|
26
26
|
#include "sleipnir/util/assert.hpp"
|
|
27
27
|
#include "sleipnir/util/print_diagnostics.hpp"
|
|
@@ -109,9 +109,7 @@ ExitStatus newton(
|
|
|
109
109
|
|
|
110
110
|
Filter<Scalar> filter;
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
// Use sparse solver if lower triangle fills < 25% of system
|
|
114
|
-
H.nonZeros() < 0.25 * H.size(), matrices.num_decision_variables, 0};
|
|
112
|
+
NewtonKKTSystem<Scalar> kkt_system{H};
|
|
115
113
|
|
|
116
114
|
// Step size reduction factor
|
|
117
115
|
constexpr Scalar α_reduction_factor(0.5);
|
|
@@ -152,50 +150,33 @@ ExitStatus newton(
|
|
|
152
150
|
|
|
153
151
|
phase_tracer.next(diagnostics[KKT_MATRIX_FACTOR]);
|
|
154
152
|
|
|
155
|
-
|
|
156
|
-
//
|
|
157
|
-
// Hpˣ = −∇f
|
|
158
|
-
if (solver.compute(H).info() != Eigen::Success) [[unlikely]] {
|
|
153
|
+
if (!kkt_system.factorize(H)) [[unlikely]] {
|
|
159
154
|
return ExitStatus::FACTORIZATION_FAILED;
|
|
160
155
|
}
|
|
161
156
|
|
|
162
157
|
phase_tracer.next(diagnostics[KKT_SYSTEM_SOLVE]);
|
|
163
158
|
|
|
164
|
-
|
|
159
|
+
const auto step = kkt_system.solve(g);
|
|
165
160
|
|
|
166
161
|
phase_tracer.next(diagnostics[LINE_SEARCH]);
|
|
167
162
|
|
|
168
163
|
constexpr Scalar α_max(1);
|
|
169
164
|
Scalar α = α_max;
|
|
165
|
+
|
|
170
166
|
const FilterEntry<Scalar> current_entry{f};
|
|
171
|
-
|
|
167
|
+
|
|
168
|
+
const Scalar D_ϕ = g.transpose() * step.p_x;
|
|
172
169
|
|
|
173
170
|
const Scalar α_min = filter.min_step_size(current_entry, D_ϕ);
|
|
174
171
|
|
|
175
172
|
// α_min is zero when the search direction is a descent direction, so also
|
|
176
173
|
// end the line search when the step becomes negligible relative to the
|
|
177
174
|
// iterate. This bounds the number of step size reductions.
|
|
178
|
-
|
|
179
|
-
// A step αpˣ is negligible if
|
|
180
|
-
//
|
|
181
|
-
// ‖αpˣ/(1 + |x|)‖_∞ < 10ε
|
|
182
|
-
//
|
|
183
|
-
// where the absolute value and division are elementwise. Since α > 0, it
|
|
184
|
-
// factors out of the norm.
|
|
185
|
-
//
|
|
186
|
-
// α‖pˣ/(1 + |x|)‖_∞ < 10ε
|
|
187
|
-
//
|
|
188
|
-
// Dividing both sides by the norm gives
|
|
189
|
-
//
|
|
190
|
-
// α < 10ε / ‖pˣ/(1 + |x|)‖_∞
|
|
191
|
-
const Scalar α_tiny = Scalar(10) * std::numeric_limits<Scalar>::epsilon() /
|
|
192
|
-
(p_x.array().abs() / (Scalar(1) + x.array().abs()))
|
|
193
|
-
.matrix()
|
|
194
|
-
.template lpNorm<Eigen::Infinity>();
|
|
175
|
+
const Scalar α_tiny = step.tiny_step_size(x);
|
|
195
176
|
|
|
196
177
|
// Loop until a step is accepted
|
|
197
178
|
while (1) {
|
|
198
|
-
trial_x = x + α * p_x;
|
|
179
|
+
trial_x = x + α * step.p_x;
|
|
199
180
|
|
|
200
181
|
trial_f = matrices.f(trial_x);
|
|
201
182
|
|
|
@@ -224,7 +205,7 @@ ExitStatus newton(
|
|
|
224
205
|
if (α < α_min || α < α_tiny) {
|
|
225
206
|
Scalar current_kkt_error = kkt_error<Scalar, KKTErrorType::ONE_NORM>(g);
|
|
226
207
|
|
|
227
|
-
trial_x = x + α_max * p_x;
|
|
208
|
+
trial_x = x + α_max * step.p_x;
|
|
228
209
|
|
|
229
210
|
trial_f = matrices.f(trial_x);
|
|
230
211
|
|
|
@@ -263,13 +244,13 @@ ExitStatus newton(
|
|
|
263
244
|
inner_iter_tracer.stop();
|
|
264
245
|
|
|
265
246
|
if (options.diagnostics) {
|
|
266
|
-
print_iterate_diagnostics(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
247
|
+
print_iterate_diagnostics(iterations, IterationType::NORMAL,
|
|
248
|
+
inner_iter_tracer.current_duration(), E_0, f,
|
|
249
|
+
Scalar(0), Scalar(0), Scalar(0),
|
|
250
|
+
kkt_system.hessian_regularization(),
|
|
251
|
+
kkt_system.constraint_jacobian_regularization(),
|
|
252
|
+
step.primal_inf_norm(), Scalar(1), α, α_max,
|
|
253
|
+
α_reduction_factor, Scalar(1));
|
|
273
254
|
}
|
|
274
255
|
|
|
275
256
|
++iterations;
|
|
@@ -20,13 +20,12 @@
|
|
|
20
20
|
#include "sleipnir/optimization/solver/options.hpp"
|
|
21
21
|
#include "sleipnir/optimization/solver/sqp_matrix_callbacks.hpp"
|
|
22
22
|
#include "sleipnir/optimization/solver/util/all_finite.hpp"
|
|
23
|
-
#include "sleipnir/optimization/solver/util/append_as_triplets.hpp"
|
|
24
23
|
#include "sleipnir/optimization/solver/util/constraint_violation.hpp"
|
|
25
24
|
#include "sleipnir/optimization/solver/util/feasibility_restoration.hpp"
|
|
26
25
|
#include "sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp"
|
|
27
26
|
#include "sleipnir/optimization/solver/util/filter.hpp"
|
|
28
27
|
#include "sleipnir/optimization/solver/util/kkt_error.hpp"
|
|
29
|
-
#include "sleipnir/optimization/solver/util/
|
|
28
|
+
#include "sleipnir/optimization/solver/util/kkt_system.hpp"
|
|
30
29
|
#include "sleipnir/optimization/solver/util/time_trace.hpp"
|
|
31
30
|
#include "sleipnir/util/assert.hpp"
|
|
32
31
|
#include "sleipnir/util/print_diagnostics.hpp"
|
|
@@ -104,53 +103,6 @@ ExitStatus sqp(
|
|
|
104
103
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
105
104
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
106
105
|
|
|
107
|
-
/// SQP step direction.
|
|
108
|
-
struct Step {
|
|
109
|
-
/// Decision variable primal step.
|
|
110
|
-
DenseVector p_x;
|
|
111
|
-
/// Equality constraint dual step.
|
|
112
|
-
DenseVector p_y;
|
|
113
|
-
|
|
114
|
-
/// Returns the infinity norm of the primal step.
|
|
115
|
-
///
|
|
116
|
-
/// @return The infinity norm of the primal step.
|
|
117
|
-
Scalar primal_inf_norm() const {
|
|
118
|
-
return p_x.template lpNorm<Eigen::Infinity>();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/// Returns the infinity norm of the dual step.
|
|
122
|
-
///
|
|
123
|
-
/// @return The infinity norm of the dual step.
|
|
124
|
-
Scalar dual_inf_norm() const {
|
|
125
|
-
return p_y.template lpNorm<Eigen::Infinity>();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/// Returns the step size below which the primal step is negligible
|
|
129
|
-
/// relative to the iterate.
|
|
130
|
-
///
|
|
131
|
-
/// @param x The decision variables.
|
|
132
|
-
/// @return The step size below which the primal step is negligible
|
|
133
|
-
/// relative to the iterate.
|
|
134
|
-
Scalar tiny_step_size(const DenseVector& x) const {
|
|
135
|
-
// A primal step αpˣ is negligible if
|
|
136
|
-
//
|
|
137
|
-
// ‖αpˣ/(1 + |x|)‖_∞ < 10ε
|
|
138
|
-
//
|
|
139
|
-
// where the absolute value and division are elementwise. Since α > 0, it
|
|
140
|
-
// factors out of the norm.
|
|
141
|
-
//
|
|
142
|
-
// α‖pˣ/(1 + |x|)‖_∞ < 10ε
|
|
143
|
-
//
|
|
144
|
-
// Dividing both sides by the norm gives
|
|
145
|
-
//
|
|
146
|
-
// α < 10ε / ‖pˣ/(1 + |x|)‖_∞
|
|
147
|
-
return Scalar(10) * std::numeric_limits<Scalar>::epsilon() /
|
|
148
|
-
(p_x.array().abs() / (Scalar(1) + x.array().abs()))
|
|
149
|
-
.matrix()
|
|
150
|
-
.template lpNorm<Eigen::Infinity>();
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
106
|
using std::isfinite;
|
|
155
107
|
|
|
156
108
|
const auto solve_start_time = std::chrono::steady_clock::now();
|
|
@@ -222,15 +174,7 @@ ExitStatus sqp(
|
|
|
222
174
|
|
|
223
175
|
Filter<Scalar> filter{constraint_violation(c_e)};
|
|
224
176
|
|
|
225
|
-
|
|
226
|
-
gch::small_vector<Eigen::Triplet<Scalar>> triplets;
|
|
227
|
-
|
|
228
|
-
const int lhs_rows =
|
|
229
|
-
matrices.num_decision_variables + matrices.num_equality_constraints;
|
|
230
|
-
KKTSolver<Scalar> solver{
|
|
231
|
-
// Use sparse solver if lower triangle fills < 25% of system
|
|
232
|
-
H.nonZeros() + A_e.nonZeros() < 0.25 * lhs_rows * lhs_rows,
|
|
233
|
-
matrices.num_decision_variables, matrices.num_equality_constraints};
|
|
177
|
+
SQPKKTSystem<Scalar> kkt_system{H, A_e};
|
|
234
178
|
|
|
235
179
|
// Step size reduction factor
|
|
236
180
|
constexpr Scalar α_reduction_factor(0.5);
|
|
@@ -279,55 +223,27 @@ ExitStatus sqp(
|
|
|
279
223
|
|
|
280
224
|
phase_tracer.next(diagnostics[KKT_MATRIX_BUILD]);
|
|
281
225
|
|
|
282
|
-
|
|
283
|
-
// [Aₑ 0 ]
|
|
284
|
-
//
|
|
285
|
-
// Don't assign upper triangle because solver only uses lower triangle.
|
|
286
|
-
triplets.clear();
|
|
287
|
-
triplets.reserve(H.nonZeros() + A_e.nonZeros());
|
|
288
|
-
append_as_triplets(triplets, 0, 0, {H, A_e});
|
|
289
|
-
SparseMatrix lhs(
|
|
290
|
-
matrices.num_decision_variables + matrices.num_equality_constraints,
|
|
291
|
-
matrices.num_decision_variables + matrices.num_equality_constraints);
|
|
292
|
-
lhs.setFromSortedTriplets(triplets.begin(), triplets.end());
|
|
293
|
-
|
|
294
|
-
// rhs = −[∇f − Aₑᵀy]
|
|
295
|
-
// [ cₑ ]
|
|
296
|
-
DenseVector rhs{g.rows() + y.rows()};
|
|
297
|
-
rhs.segment(0, g.rows()) = -g + A_e.transpose() * y;
|
|
298
|
-
rhs.segment(g.rows(), y.rows()) = -c_e;
|
|
226
|
+
kkt_system.build(H, A_e);
|
|
299
227
|
|
|
300
228
|
phase_tracer.next(diagnostics[KKT_MATRIX_FACTOR]);
|
|
301
229
|
|
|
302
|
-
|
|
303
|
-
constexpr Scalar α_max(1);
|
|
304
|
-
Scalar α(1);
|
|
305
|
-
bool call_feasibility_restoration = false;
|
|
306
|
-
|
|
307
|
-
// Solve the Newton-KKT system
|
|
308
|
-
//
|
|
309
|
-
// [H Aₑᵀ][ pˣ] = −[∇f − Aₑᵀy]
|
|
310
|
-
// [Aₑ 0 ][−pʸ] [ cₑ ]
|
|
311
|
-
if (solver.compute(lhs).info() != Eigen::Success) [[unlikely]] {
|
|
230
|
+
if (!kkt_system.factorize()) [[unlikely]] {
|
|
312
231
|
return ExitStatus::FACTORIZATION_FAILED;
|
|
313
232
|
}
|
|
314
233
|
|
|
315
234
|
phase_tracer.next(diagnostics[KKT_SYSTEM_SOLVE]);
|
|
316
235
|
|
|
317
|
-
auto
|
|
318
|
-
// p = [ pˣ]
|
|
319
|
-
// [−pʸ]
|
|
320
|
-
DenseVector p = solver.solve(rhs);
|
|
321
|
-
step.p_x = p.segment(0, x.rows());
|
|
322
|
-
step.p_y = -p.segment(x.rows(), y.rows());
|
|
323
|
-
};
|
|
324
|
-
compute_step(step);
|
|
236
|
+
auto step = kkt_system.solve(g, A_e, y, c_e);
|
|
325
237
|
|
|
326
238
|
phase_tracer.next(diagnostics[LINE_SEARCH]);
|
|
327
239
|
|
|
328
|
-
|
|
240
|
+
bool call_feasibility_restoration = false;
|
|
241
|
+
|
|
242
|
+
constexpr Scalar α_max(1);
|
|
243
|
+
Scalar α = α_max;
|
|
329
244
|
|
|
330
245
|
const FilterEntry<Scalar> current_entry{f, c_e};
|
|
246
|
+
|
|
331
247
|
const Scalar D_ϕ = g.transpose() * step.p_x;
|
|
332
248
|
|
|
333
249
|
const Scalar α_min = filter.min_step_size(current_entry, D_ϕ);
|
|
@@ -397,24 +313,18 @@ ExitStatus sqp(
|
|
|
397
313
|
kkt_error<Scalar, KKTErrorType::INF_NORM_SCALED>(
|
|
398
314
|
g, A_e, trial_c_e, trial_y, options.tolerance),
|
|
399
315
|
trial_f, constraint_violation(trial_c_e), Scalar(0),
|
|
400
|
-
Scalar(0),
|
|
401
|
-
|
|
316
|
+
Scalar(0), kkt_system.hessian_regularization(),
|
|
317
|
+
kkt_system.constraint_jacobian_regularization(),
|
|
402
318
|
soc_step.primal_inf_norm(), soc_step.dual_inf_norm(), α_soc,
|
|
403
319
|
Scalar(1), α_reduction_factor, Scalar(1));
|
|
404
320
|
}
|
|
405
321
|
}};
|
|
406
322
|
|
|
407
|
-
//
|
|
408
|
-
//
|
|
409
|
-
// rhs = −[∇f − Aₑᵀy]
|
|
410
|
-
// [ cₑˢᵒᶜ ]
|
|
323
|
+
// Solve the Newton-KKT system with corrected constraint values
|
|
411
324
|
//
|
|
412
|
-
//
|
|
325
|
+
// cₑˢᵒᶜ = αc(xₖ) + c(xₖ + αpₖˣ)
|
|
413
326
|
c_e_soc = α_soc * c_e_soc + trial_c_e;
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
// Solve the Newton-KKT system
|
|
417
|
-
compute_step(soc_step);
|
|
327
|
+
soc_step = kkt_system.solve(g, A_e, y, c_e_soc);
|
|
418
328
|
|
|
419
329
|
trial_x = x + α_soc * soc_step.p_x;
|
|
420
330
|
trial_y = y + α_soc * soc_step.p_y;
|
|
@@ -605,8 +515,8 @@ ExitStatus sqp(
|
|
|
605
515
|
print_iterate_diagnostics(iterations, IterationType::NORMAL,
|
|
606
516
|
inner_iter_tracer.current_duration(), E_0, f,
|
|
607
517
|
constraint_violation(c_e), Scalar(0), Scalar(0),
|
|
608
|
-
|
|
609
|
-
|
|
518
|
+
kkt_system.hessian_regularization(),
|
|
519
|
+
kkt_system.constraint_jacobian_regularization(),
|
|
610
520
|
step.primal_inf_norm(), step.dual_inf_norm(), α,
|
|
611
521
|
α_max, α_reduction_factor, Scalar(1));
|
|
612
522
|
}
|
|
@@ -637,4 +547,11 @@ sqp(const SQPMatrixCallbacks<double>& matrix_callbacks,
|
|
|
637
547
|
iteration_callbacks,
|
|
638
548
|
const Options<double>& options, Eigen::VectorX<double>& x);
|
|
639
549
|
|
|
550
|
+
extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
551
|
+
sqp(const SQPMatrixCallbacks<double>& matrix_callbacks,
|
|
552
|
+
std::span<std::function<ControlFlow(const IterationInfo<double>& info)>>
|
|
553
|
+
iteration_callbacks,
|
|
554
|
+
const Options<double>& options, Eigen::VectorX<double>& x,
|
|
555
|
+
Eigen::VectorX<double>& y);
|
|
556
|
+
|
|
640
557
|
} // namespace slp
|