sleipnirgroup-jormungandr 0.6.7.dev84__tar.gz → 0.6.7.dev86__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.
Potentially problematic release.
This version of sleipnirgroup-jormungandr might be problematic. Click here for more details.
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/PKG-INFO +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/ipm.hpp +101 -29
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/newton.hpp +43 -11
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/sqp.hpp +81 -20
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +75 -55
- sleipnirgroup_jormungandr-0.6.7.dev86/include/sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp +57 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/filter.hpp +100 -21
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/src/sleipnir/__init__.py +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/CMakeLists.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/LICENSE.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/README.md +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/SleipnirConfig.cmake.in +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/cmake/BuildTypes.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/cmake/CompilerFlags.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/cmake/Pybind11Mkdoc.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/cmake/Pybind11MkdocPostprocess.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/cmake/SubdirList.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/cmake/arm-none-eabi.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/expression.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/expression_graph.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/expression_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/gradient.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/hessian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/jacobian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/slice.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/variable.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/variable_block.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/autodiff/variable_matrix.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/multistart.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/ocp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/problem.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/iteration_info.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/options.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/constraint_violation.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/dense_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/inertia.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/kkt_error.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/sparse_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/optimization/solver/util/time_trace.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/assert.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/concepts.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/empty.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/function_ref.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/pool.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/print.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/print_diagnostics.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/scope_exit.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/spy.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/symbol_exports.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/include/sleipnir/util/time_tracer.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/pyproject.toml +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/arity.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/autodiff/bind_gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/autodiff/bind_hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/autodiff/bind_variable.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/autodiff/bind_variable_block.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/autodiff/bind_variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/binders.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/docstrings.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/for_each_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/main.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/bind_ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/bind_problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/slice_tuple.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/text_wrap.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/cpp/try_cast.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/postprocess_stubs.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/src/sleipnir/autodiff/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/src/sleipnir/optimization/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/autodiff/gradient_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/autodiff/hessian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/autodiff/jacobian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/autodiff/variable_matrix_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/autodiff/variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/cart_pole_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/cart_pole_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/cart_pole_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/constraints_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/decision_variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/differential_drive_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/differential_drive_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/differential_drive_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/double_integrator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/flywheel_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/flywheel_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/linear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/multistart_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/near.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/nonlinear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/problem_spy_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/quadratic_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/rk4.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/solver/exit_status_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/python/test/optimization/trivial_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/autodiff/gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/autodiff/hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/autodiff/jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/autodiff/variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/optimization/ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/optimization/problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/optimization/solver/ipm.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/optimization/solver/newton.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/optimization/solver/sqp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev84 → sleipnirgroup_jormungandr-0.6.7.dev86}/src/util/pool.cpp +0 -0
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
#include <chrono>
|
|
7
7
|
#include <cmath>
|
|
8
8
|
#include <functional>
|
|
9
|
+
#include <limits>
|
|
9
10
|
#include <optional>
|
|
10
11
|
#include <span>
|
|
11
12
|
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
#include "sleipnir/optimization/solver/util/append_as_triplets.hpp"
|
|
22
23
|
#include "sleipnir/optimization/solver/util/constraint_violation.hpp"
|
|
23
24
|
#include "sleipnir/optimization/solver/util/feasibility_restoration.hpp"
|
|
25
|
+
#include "sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp"
|
|
24
26
|
#include "sleipnir/optimization/solver/util/filter.hpp"
|
|
25
27
|
#include "sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp"
|
|
26
28
|
#include "sleipnir/optimization/solver/util/kkt_error.hpp"
|
|
@@ -166,6 +168,37 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
166
168
|
return std::max(p_y.template lpNorm<Eigen::Infinity>(),
|
|
167
169
|
p_z.template lpNorm<Eigen::Infinity>());
|
|
168
170
|
}
|
|
171
|
+
|
|
172
|
+
/// Returns the step size below which the primal step is negligible
|
|
173
|
+
/// relative to the iterate.
|
|
174
|
+
///
|
|
175
|
+
/// @param x The decision variables.
|
|
176
|
+
/// @param s The inequality constraint slack variables.
|
|
177
|
+
/// @return The step size below which the primal step is negligible
|
|
178
|
+
/// relative to the iterate.
|
|
179
|
+
Scalar tiny_step_size(const DenseVector& x, const DenseVector& s) const {
|
|
180
|
+
using std::max;
|
|
181
|
+
|
|
182
|
+
// A primal step α[pˣ pˢ] is negligible if
|
|
183
|
+
//
|
|
184
|
+
// max(‖αpˣ/(1 + |x|)‖_∞, ‖αpˢ/(1 + |s|)‖_∞) < 10ε
|
|
185
|
+
//
|
|
186
|
+
// where the absolute values and division are elementwise. Since α > 0,
|
|
187
|
+
// it factors out of the norms and max.
|
|
188
|
+
//
|
|
189
|
+
// α max(‖pˣ/(1 + |x|)‖_∞, ‖pˢ/(1 + |s|)‖_∞) < 10ε
|
|
190
|
+
//
|
|
191
|
+
// Dividing both sides by the max gives
|
|
192
|
+
//
|
|
193
|
+
// α < 10ε / max(‖pˣ/(1 + |x|)‖_∞, ‖pˢ/(1 + |s|)‖_∞)
|
|
194
|
+
return Scalar(10) * std::numeric_limits<Scalar>::epsilon() /
|
|
195
|
+
max((p_x.array().abs() / (Scalar(1) + x.array().abs()))
|
|
196
|
+
.matrix()
|
|
197
|
+
.template lpNorm<Eigen::Infinity>(),
|
|
198
|
+
(p_s.array().abs() / (Scalar(1) + s.array().abs()))
|
|
199
|
+
.matrix()
|
|
200
|
+
.template lpNorm<Eigen::Infinity>());
|
|
201
|
+
}
|
|
169
202
|
};
|
|
170
203
|
|
|
171
204
|
using std::isfinite;
|
|
@@ -267,6 +300,12 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
267
300
|
|
|
268
301
|
Filter<Scalar> filter{constraint_violation(c_e, c_i, s)};
|
|
269
302
|
|
|
303
|
+
// The smallest KKT error of a step accepted by the KKT error reduction
|
|
304
|
+
// fallback for the current barrier parameter. Each fallback step must improve
|
|
305
|
+
// on it, so finitely many fallback steps are taken before the barrier
|
|
306
|
+
// subproblem converges.
|
|
307
|
+
Scalar fallback_kkt_error = std::numeric_limits<Scalar>::infinity();
|
|
308
|
+
|
|
270
309
|
// This should be run when the error is below a desired threshold for the
|
|
271
310
|
// current barrier parameter
|
|
272
311
|
auto update_barrier_parameter_and_reset_filter = [&] {
|
|
@@ -294,6 +333,7 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
294
333
|
|
|
295
334
|
// Reset the filter when the barrier parameter is updated
|
|
296
335
|
filter.reset();
|
|
336
|
+
fallback_kkt_error = std::numeric_limits<Scalar>::infinity();
|
|
297
337
|
};
|
|
298
338
|
|
|
299
339
|
// Kept outside the loop so its storage can be reused
|
|
@@ -315,14 +355,16 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
315
355
|
// because the equality constraint Jacobian cannot be rank-deficient
|
|
316
356
|
in_feasibility_restoration ? Scalar(0) : Scalar(1e-10)};
|
|
317
357
|
|
|
318
|
-
//
|
|
358
|
+
// Step size reduction factor
|
|
319
359
|
constexpr Scalar α_reduction_factor(0.5);
|
|
320
|
-
constexpr Scalar α_min(1e-7);
|
|
321
360
|
|
|
322
361
|
int full_step_rejected_counter = 0;
|
|
323
362
|
|
|
324
363
|
StallDetector<Scalar> stall_detector;
|
|
325
364
|
|
|
365
|
+
FeasibilityRestorationCycleDetector<Scalar>
|
|
366
|
+
feasibility_restoration_cycle_detector;
|
|
367
|
+
|
|
326
368
|
// Error
|
|
327
369
|
Scalar E_0 = unscaled_kkt_error<Scalar, KKTErrorType::INF_NORM_SCALED>(
|
|
328
370
|
matrices.scaling, g, A_e, c_e, A_i, c_i, s, y, z, Scalar(0));
|
|
@@ -427,11 +469,6 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
427
469
|
α_max = fraction_to_the_boundary_rule<Scalar>(s, step.p_s, τ);
|
|
428
470
|
α = α_max;
|
|
429
471
|
|
|
430
|
-
// If maximum step size is below minimum, invoke feasibility restoration
|
|
431
|
-
if (α < α_min) {
|
|
432
|
-
call_feasibility_restoration = true;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
472
|
// αₖᶻ = max(α ∈ (0, 1] : zₖ + αpₖᶻ ≥ (1−τⱼ)zₖ)
|
|
436
473
|
α_z = fraction_to_the_boundary_rule<Scalar>(z, step.p_z, τ);
|
|
437
474
|
|
|
@@ -447,8 +484,20 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
447
484
|
const Scalar D_ϕ =
|
|
448
485
|
g.transpose() * step.p_x - μ * s.cwiseInverse().dot(step.p_s);
|
|
449
486
|
|
|
487
|
+
const Scalar α_min = filter.min_step_size(current_entry, D_ϕ);
|
|
488
|
+
|
|
489
|
+
// If maximum step size is below minimum, invoke feasibility restoration
|
|
490
|
+
if (α < α_min) {
|
|
491
|
+
call_feasibility_restoration = true;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// α_min can be zero (e.g., when the constraint violation is zero), so also
|
|
495
|
+
// end the line search when the step becomes negligible relative to the
|
|
496
|
+
// iterate. This bounds the number of step size reductions.
|
|
497
|
+
const Scalar α_tiny = step.tiny_step_size(x, s);
|
|
498
|
+
|
|
450
499
|
// Loop until a step is accepted
|
|
451
|
-
while (
|
|
500
|
+
while (!call_feasibility_restoration) {
|
|
452
501
|
trial_x = x + α * step.p_x;
|
|
453
502
|
trial_c_i = matrices.c_i(trial_x);
|
|
454
503
|
if (options.feasible_ipm && c_i.cwiseGreater(Scalar(0)).all()) {
|
|
@@ -473,7 +522,7 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
473
522
|
// Reduce step size
|
|
474
523
|
α *= α_reduction_factor;
|
|
475
524
|
|
|
476
|
-
if (α < α_min) {
|
|
525
|
+
if (α < α_min || α < α_tiny) {
|
|
477
526
|
call_feasibility_restoration = true;
|
|
478
527
|
break;
|
|
479
528
|
}
|
|
@@ -602,24 +651,17 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
602
651
|
}
|
|
603
652
|
|
|
604
653
|
// If the full step was rejected enough times in a row, reset the filter
|
|
605
|
-
//
|
|
606
|
-
|
|
607
|
-
// See section 3.2 case I of [2].
|
|
608
|
-
if (full_step_rejected_counter >= 4 &&
|
|
609
|
-
filter.max_constraint_violation >
|
|
610
|
-
current_entry.constraint_violation / Scalar(10) &&
|
|
611
|
-
filter.last_rejection_due_to_filter()) {
|
|
612
|
-
filter.max_constraint_violation *= Scalar(0.1);
|
|
613
|
-
filter.reset();
|
|
654
|
+
// if it may be impeding progress
|
|
655
|
+
if (full_step_rejected_counter >= 4 && filter.try_reset(current_entry)) {
|
|
614
656
|
continue;
|
|
615
657
|
}
|
|
616
658
|
|
|
617
659
|
// Reduce step size
|
|
618
660
|
α *= α_reduction_factor;
|
|
619
661
|
|
|
620
|
-
// If step size hit a minimum
|
|
621
|
-
// wasn't, invoke feasibility restoration.
|
|
622
|
-
if (α < α_min) {
|
|
662
|
+
// If step size hit a minimum or the step became negligible, check if the
|
|
663
|
+
// KKT error was reduced. If it wasn't, invoke feasibility restoration.
|
|
664
|
+
if (α < α_min || α < α_tiny) {
|
|
623
665
|
Scalar current_kkt_error = kkt_error<Scalar, KKTErrorType::ONE_NORM>(
|
|
624
666
|
g, A_e, c_e, A_i, c_i, s, y, z, μ);
|
|
625
667
|
|
|
@@ -636,11 +678,14 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
636
678
|
matrices.g(trial_x), matrices.A_e(trial_x), trial_c_e,
|
|
637
679
|
matrices.A_i(trial_x), trial_c_i, trial_s, trial_y, trial_z, μ);
|
|
638
680
|
|
|
639
|
-
// If the step using αᵐᵃˣ reduced the KKT error
|
|
640
|
-
|
|
681
|
+
// If the step using αᵐᵃˣ reduced the KKT error below the current
|
|
682
|
+
// iterate's and every previous fallback step's, accept it anyway
|
|
683
|
+
if (next_kkt_error <= Scalar(0.999) * std::min(current_kkt_error,
|
|
684
|
+
fallback_kkt_error) &&
|
|
641
685
|
constraint_violation(trial_c_e, trial_c_i, trial_s) <=
|
|
642
686
|
filter.max_constraint_violation) {
|
|
643
687
|
// Accept step
|
|
688
|
+
fallback_kkt_error = next_kkt_error;
|
|
644
689
|
α = α_max;
|
|
645
690
|
break;
|
|
646
691
|
}
|
|
@@ -672,6 +717,15 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
672
717
|
|
|
673
718
|
FilterEntry initial_entry{matrices.f(x), s, c_e, c_i, μ};
|
|
674
719
|
|
|
720
|
+
// Augment the filter with the current iterate so the normal phase can't
|
|
721
|
+
// return to it
|
|
722
|
+
filter.add(initial_entry);
|
|
723
|
+
|
|
724
|
+
feasibility_restoration_cycle_detector.record_entry(
|
|
725
|
+
initial_entry.constraint_violation);
|
|
726
|
+
const bool run_feasibility_restoration_to_convergence =
|
|
727
|
+
feasibility_restoration_cycle_detector.is_cycling();
|
|
728
|
+
|
|
675
729
|
// Feasibility restoration phase
|
|
676
730
|
gch::small_vector<std::function<bool(const IterationInfo<Scalar>& info)>>
|
|
677
731
|
callbacks;
|
|
@@ -679,24 +733,30 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
679
733
|
callbacks.emplace_back(callback);
|
|
680
734
|
}
|
|
681
735
|
callbacks.emplace_back([&](const IterationInfo<Scalar>& info) {
|
|
736
|
+
if (run_feasibility_restoration_to_convergence) {
|
|
737
|
+
return false;
|
|
738
|
+
}
|
|
739
|
+
|
|
682
740
|
DenseVector trial_x =
|
|
683
741
|
info.x.segment(0, matrices.num_decision_variables);
|
|
684
|
-
DenseVector trial_s =
|
|
685
|
-
info.s.segment(0, matrices.num_inequality_constraints);
|
|
686
742
|
|
|
687
743
|
DenseVector trial_c_e = matrices.c_e(trial_x);
|
|
688
744
|
DenseVector trial_c_i = matrices.c_i(trial_x);
|
|
689
745
|
|
|
746
|
+
// Feasibility restoration re-centers the slacks when it returns, so
|
|
747
|
+
// check the iterate the normal phase will resume from
|
|
748
|
+
DenseVector trial_s =
|
|
749
|
+
(trial_c_i.array() >= Scalar(1e-2))
|
|
750
|
+
.select(trial_c_i,
|
|
751
|
+
info.s.segment(0, matrices.num_inequality_constraints));
|
|
752
|
+
|
|
690
753
|
// If the current iterate sufficiently reduces constraint violation and
|
|
691
754
|
// is accepted by the normal filter, stop feasibility restoration
|
|
692
755
|
FilterEntry trial_entry{matrices.f(trial_x), trial_s, trial_c_e,
|
|
693
756
|
trial_c_i, μ};
|
|
694
|
-
const Scalar D_ϕ_restoration = g.transpose() * (trial_x - x) -
|
|
695
|
-
μ * s.cwiseInverse().dot(trial_s - s);
|
|
696
757
|
return trial_entry.constraint_violation <
|
|
697
758
|
Scalar(0.9) * initial_entry.constraint_violation &&
|
|
698
|
-
filter.
|
|
699
|
-
Scalar(1));
|
|
759
|
+
filter.is_acceptable(trial_entry);
|
|
700
760
|
});
|
|
701
761
|
auto status =
|
|
702
762
|
feasibility_restoration<Scalar>(matrices, callbacks, options,
|
|
@@ -713,6 +773,18 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
713
773
|
f = matrices.f(x);
|
|
714
774
|
c_e = matrices.c_e(x);
|
|
715
775
|
c_i = matrices.c_i(x);
|
|
776
|
+
|
|
777
|
+
// Resuming from an iterate the filter rejects would break the filter's
|
|
778
|
+
// convergence guarantee, and continuing feasibility restoration from its
|
|
779
|
+
// converged point would return that point again, so report failure.
|
|
780
|
+
//
|
|
781
|
+
// The returned iterate can be rejected because feasibility restoration
|
|
782
|
+
// stops at its own convergence tolerance instead of driving constraint
|
|
783
|
+
// violation to zero, so the filter can still hold entries with lower cost
|
|
784
|
+
// and constraint violation.
|
|
785
|
+
if (!filter.is_acceptable(FilterEntry{f, s, c_e, c_i, μ})) {
|
|
786
|
+
return ExitStatus::FEASIBILITY_RESTORATION_FAILED;
|
|
787
|
+
}
|
|
716
788
|
} else {
|
|
717
789
|
// If full step was accepted, reset full-step rejected counter
|
|
718
790
|
if (α == α_max) {
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
#pragma once
|
|
4
4
|
|
|
5
|
+
#include <algorithm>
|
|
5
6
|
#include <chrono>
|
|
6
7
|
#include <cmath>
|
|
7
8
|
#include <functional>
|
|
9
|
+
#include <limits>
|
|
8
10
|
#include <optional>
|
|
9
11
|
#include <span>
|
|
10
12
|
|
|
@@ -110,9 +112,13 @@ ExitStatus newton(
|
|
|
110
112
|
// Use sparse solver if lower triangle fills < 25% of system
|
|
111
113
|
H.nonZeros() < 0.25 * H.size(), matrices.num_decision_variables, 0};
|
|
112
114
|
|
|
113
|
-
//
|
|
115
|
+
// Step size reduction factor
|
|
114
116
|
constexpr Scalar α_reduction_factor(0.5);
|
|
115
|
-
|
|
117
|
+
|
|
118
|
+
// The smallest KKT error of a step accepted by the KKT error reduction
|
|
119
|
+
// fallback. Each fallback step must improve on it, so finitely many fallback
|
|
120
|
+
// steps are taken before the solver converges.
|
|
121
|
+
Scalar fallback_kkt_error = std::numeric_limits<Scalar>::infinity();
|
|
116
122
|
|
|
117
123
|
// Error
|
|
118
124
|
Scalar E_0 = unscaled_kkt_error<Scalar, KKTErrorType::INF_NORM_SCALED>(
|
|
@@ -157,10 +163,33 @@ ExitStatus newton(
|
|
|
157
163
|
|
|
158
164
|
constexpr Scalar α_max(1);
|
|
159
165
|
Scalar α = α_max;
|
|
166
|
+
const FilterEntry<Scalar> current_entry{f};
|
|
160
167
|
const Scalar D_ϕ = g.transpose() * p_x;
|
|
161
168
|
|
|
162
|
-
|
|
163
|
-
|
|
169
|
+
const Scalar α_min = filter.min_step_size(current_entry, D_ϕ);
|
|
170
|
+
|
|
171
|
+
// α_min is zero when the search direction is a descent direction, so also
|
|
172
|
+
// end the line search when the step becomes negligible relative to the
|
|
173
|
+
// iterate. This bounds the number of step size reductions.
|
|
174
|
+
//
|
|
175
|
+
// A step αpˣ is negligible if
|
|
176
|
+
//
|
|
177
|
+
// ‖αpˣ/(1 + |x|)‖_∞ < 10ε
|
|
178
|
+
//
|
|
179
|
+
// where the absolute value and division are elementwise. Since α > 0, it
|
|
180
|
+
// factors out of the norm.
|
|
181
|
+
//
|
|
182
|
+
// α‖pˣ/(1 + |x|)‖_∞ < 10ε
|
|
183
|
+
//
|
|
184
|
+
// Dividing both sides by the norm gives
|
|
185
|
+
//
|
|
186
|
+
// α < 10ε / ‖pˣ/(1 + |x|)‖_∞
|
|
187
|
+
const Scalar α_tiny = Scalar(10) * std::numeric_limits<Scalar>::epsilon() /
|
|
188
|
+
(p_x.array().abs() / (Scalar(1) + x.array().abs()))
|
|
189
|
+
.matrix()
|
|
190
|
+
.template lpNorm<Eigen::Infinity>();
|
|
191
|
+
|
|
192
|
+
// Loop until a step is accepted
|
|
164
193
|
while (1) {
|
|
165
194
|
trial_x = x + α * p_x;
|
|
166
195
|
|
|
@@ -171,14 +200,14 @@ ExitStatus newton(
|
|
|
171
200
|
// Reduce step size
|
|
172
201
|
α *= α_reduction_factor;
|
|
173
202
|
|
|
174
|
-
if (α < α_min) {
|
|
203
|
+
if (α < α_min || α < α_tiny) {
|
|
175
204
|
return ExitStatus::LINE_SEARCH_FAILED;
|
|
176
205
|
}
|
|
177
206
|
continue;
|
|
178
207
|
}
|
|
179
208
|
|
|
180
209
|
// Check whether filter accepts trial iterate
|
|
181
|
-
if (filter.try_add(
|
|
210
|
+
if (filter.try_add(current_entry, FilterEntry{trial_f}, D_ϕ, α)) {
|
|
182
211
|
// Accept step
|
|
183
212
|
break;
|
|
184
213
|
}
|
|
@@ -186,9 +215,9 @@ ExitStatus newton(
|
|
|
186
215
|
// Reduce step size
|
|
187
216
|
α *= α_reduction_factor;
|
|
188
217
|
|
|
189
|
-
// If step size hit a minimum
|
|
190
|
-
// wasn't, report
|
|
191
|
-
if (α < α_min) {
|
|
218
|
+
// If step size hit a minimum or the step became negligible, check if the
|
|
219
|
+
// KKT error was reduced. If it wasn't, report line search failure.
|
|
220
|
+
if (α < α_min || α < α_tiny) {
|
|
192
221
|
Scalar current_kkt_error = kkt_error<Scalar, KKTErrorType::ONE_NORM>(g);
|
|
193
222
|
|
|
194
223
|
trial_x = x + α_max * p_x;
|
|
@@ -198,9 +227,12 @@ ExitStatus newton(
|
|
|
198
227
|
Scalar next_kkt_error =
|
|
199
228
|
kkt_error<Scalar, KKTErrorType::ONE_NORM>(matrices.g(trial_x));
|
|
200
229
|
|
|
201
|
-
// If the step using αᵐᵃˣ reduced the KKT error
|
|
202
|
-
|
|
230
|
+
// If the step using αᵐᵃˣ reduced the KKT error below the current
|
|
231
|
+
// iterate's and every previous fallback step's, accept it anyway
|
|
232
|
+
if (next_kkt_error <=
|
|
233
|
+
Scalar(0.999) * std::min(current_kkt_error, fallback_kkt_error)) {
|
|
203
234
|
// Accept step
|
|
235
|
+
fallback_kkt_error = next_kkt_error;
|
|
204
236
|
α = α_max;
|
|
205
237
|
break;
|
|
206
238
|
}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
#pragma once
|
|
4
4
|
|
|
5
|
+
#include <algorithm>
|
|
5
6
|
#include <chrono>
|
|
6
7
|
#include <cmath>
|
|
7
8
|
#include <functional>
|
|
9
|
+
#include <limits>
|
|
8
10
|
#include <optional>
|
|
9
11
|
#include <span>
|
|
10
12
|
|
|
@@ -20,6 +22,7 @@
|
|
|
20
22
|
#include "sleipnir/optimization/solver/util/append_as_triplets.hpp"
|
|
21
23
|
#include "sleipnir/optimization/solver/util/constraint_violation.hpp"
|
|
22
24
|
#include "sleipnir/optimization/solver/util/feasibility_restoration.hpp"
|
|
25
|
+
#include "sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp"
|
|
23
26
|
#include "sleipnir/optimization/solver/util/filter.hpp"
|
|
24
27
|
#include "sleipnir/optimization/solver/util/kkt_error.hpp"
|
|
25
28
|
#include "sleipnir/optimization/solver/util/kkt_solver.hpp"
|
|
@@ -119,6 +122,31 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
119
122
|
Scalar dual_inf_norm() const {
|
|
120
123
|
return p_y.template lpNorm<Eigen::Infinity>();
|
|
121
124
|
}
|
|
125
|
+
|
|
126
|
+
/// Returns the step size below which the primal step is negligible
|
|
127
|
+
/// relative to the iterate.
|
|
128
|
+
///
|
|
129
|
+
/// @param x The decision variables.
|
|
130
|
+
/// @return The step size below which the primal step is negligible
|
|
131
|
+
/// relative to the iterate.
|
|
132
|
+
Scalar tiny_step_size(const DenseVector& x) const {
|
|
133
|
+
// A primal step αpˣ is negligible if
|
|
134
|
+
//
|
|
135
|
+
// ‖αpˣ/(1 + |x|)‖_∞ < 10ε
|
|
136
|
+
//
|
|
137
|
+
// where the absolute value and division are elementwise. Since α > 0, it
|
|
138
|
+
// factors out of the norm.
|
|
139
|
+
//
|
|
140
|
+
// α‖pˣ/(1 + |x|)‖_∞ < 10ε
|
|
141
|
+
//
|
|
142
|
+
// Dividing both sides by the norm gives
|
|
143
|
+
//
|
|
144
|
+
// α < 10ε / ‖pˣ/(1 + |x|)‖_∞
|
|
145
|
+
return Scalar(10) * std::numeric_limits<Scalar>::epsilon() /
|
|
146
|
+
(p_x.array().abs() / (Scalar(1) + x.array().abs()))
|
|
147
|
+
.matrix()
|
|
148
|
+
.template lpNorm<Eigen::Infinity>();
|
|
149
|
+
}
|
|
122
150
|
};
|
|
123
151
|
|
|
124
152
|
using std::isfinite;
|
|
@@ -202,14 +230,21 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
202
230
|
H.nonZeros() + A_e.nonZeros() < 0.25 * lhs_rows * lhs_rows,
|
|
203
231
|
matrices.num_decision_variables, matrices.num_equality_constraints};
|
|
204
232
|
|
|
205
|
-
//
|
|
233
|
+
// Step size reduction factor
|
|
206
234
|
constexpr Scalar α_reduction_factor(0.5);
|
|
207
|
-
constexpr Scalar α_min(1e-7);
|
|
208
235
|
|
|
209
236
|
int full_step_rejected_counter = 0;
|
|
210
237
|
|
|
238
|
+
// The smallest KKT error of a step accepted by the KKT error reduction
|
|
239
|
+
// fallback. Each fallback step must improve on it, so finitely many fallback
|
|
240
|
+
// steps are taken before the solver converges.
|
|
241
|
+
Scalar fallback_kkt_error = std::numeric_limits<Scalar>::infinity();
|
|
242
|
+
|
|
211
243
|
StallDetector<Scalar> stall_detector;
|
|
212
244
|
|
|
245
|
+
FeasibilityRestorationCycleDetector<Scalar>
|
|
246
|
+
feasibility_restoration_cycle_detector;
|
|
247
|
+
|
|
213
248
|
// Error
|
|
214
249
|
Scalar E_0 = unscaled_kkt_error<Scalar, KKTErrorType::INF_NORM_SCALED>(
|
|
215
250
|
matrices.scaling, g, A_e, c_e, y);
|
|
@@ -292,6 +327,13 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
292
327
|
const FilterEntry<Scalar> current_entry{f, c_e};
|
|
293
328
|
const Scalar D_ϕ = g.transpose() * step.p_x;
|
|
294
329
|
|
|
330
|
+
const Scalar α_min = filter.min_step_size(current_entry, D_ϕ);
|
|
331
|
+
|
|
332
|
+
// α_min can be zero (e.g., when the constraint violation is zero), so also
|
|
333
|
+
// end the line search when the step becomes negligible relative to the
|
|
334
|
+
// iterate. This bounds the number of step size reductions.
|
|
335
|
+
const Scalar α_tiny = step.tiny_step_size(x);
|
|
336
|
+
|
|
295
337
|
// Loop until a step is accepted
|
|
296
338
|
while (1) {
|
|
297
339
|
trial_x = x + α * step.p_x;
|
|
@@ -306,7 +348,7 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
306
348
|
// Reduce step size
|
|
307
349
|
α *= α_reduction_factor;
|
|
308
350
|
|
|
309
|
-
if (α < α_min) {
|
|
351
|
+
if (α < α_min || α < α_tiny) {
|
|
310
352
|
call_feasibility_restoration = true;
|
|
311
353
|
break;
|
|
312
354
|
}
|
|
@@ -413,24 +455,17 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
413
455
|
}
|
|
414
456
|
|
|
415
457
|
// If the full step was rejected enough times in a row, reset the filter
|
|
416
|
-
//
|
|
417
|
-
|
|
418
|
-
// See section 3.2 case I of [2].
|
|
419
|
-
if (full_step_rejected_counter >= 4 &&
|
|
420
|
-
filter.max_constraint_violation >
|
|
421
|
-
current_entry.constraint_violation / Scalar(10) &&
|
|
422
|
-
filter.last_rejection_due_to_filter()) {
|
|
423
|
-
filter.max_constraint_violation *= Scalar(0.1);
|
|
424
|
-
filter.reset();
|
|
458
|
+
// if it may be impeding progress
|
|
459
|
+
if (full_step_rejected_counter >= 4 && filter.try_reset(current_entry)) {
|
|
425
460
|
continue;
|
|
426
461
|
}
|
|
427
462
|
|
|
428
463
|
// Reduce step size
|
|
429
464
|
α *= α_reduction_factor;
|
|
430
465
|
|
|
431
|
-
// If step size hit a minimum
|
|
432
|
-
// wasn't, invoke feasibility restoration.
|
|
433
|
-
if (α < α_min) {
|
|
466
|
+
// If step size hit a minimum or the step became negligible, check if the
|
|
467
|
+
// KKT error was reduced. If it wasn't, invoke feasibility restoration.
|
|
468
|
+
if (α < α_min || α < α_tiny) {
|
|
434
469
|
Scalar current_kkt_error =
|
|
435
470
|
kkt_error<Scalar, KKTErrorType::ONE_NORM>(g, A_e, c_e, y);
|
|
436
471
|
|
|
@@ -443,11 +478,14 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
443
478
|
Scalar next_kkt_error = kkt_error<Scalar, KKTErrorType::ONE_NORM>(
|
|
444
479
|
matrices.g(trial_x), matrices.A_e(trial_x), trial_c_e, trial_y);
|
|
445
480
|
|
|
446
|
-
// If the step using αᵐᵃˣ reduced the KKT error
|
|
447
|
-
|
|
481
|
+
// If the step using αᵐᵃˣ reduced the KKT error below the current
|
|
482
|
+
// iterate's and every previous fallback step's, accept it anyway
|
|
483
|
+
if (next_kkt_error <= Scalar(0.999) * std::min(current_kkt_error,
|
|
484
|
+
fallback_kkt_error) &&
|
|
448
485
|
constraint_violation(trial_c_e) <=
|
|
449
486
|
filter.max_constraint_violation) {
|
|
450
487
|
// Accept step
|
|
488
|
+
fallback_kkt_error = next_kkt_error;
|
|
451
489
|
α = α_max;
|
|
452
490
|
break;
|
|
453
491
|
}
|
|
@@ -474,6 +512,15 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
474
512
|
|
|
475
513
|
FilterEntry initial_entry{matrices.f(x), c_e};
|
|
476
514
|
|
|
515
|
+
// Augment the filter with the current iterate so the normal phase can't
|
|
516
|
+
// return to it
|
|
517
|
+
filter.add(initial_entry);
|
|
518
|
+
|
|
519
|
+
feasibility_restoration_cycle_detector.record_entry(
|
|
520
|
+
initial_entry.constraint_violation);
|
|
521
|
+
const bool run_feasibility_restoration_to_convergence =
|
|
522
|
+
feasibility_restoration_cycle_detector.is_cycling();
|
|
523
|
+
|
|
477
524
|
// Feasibility restoration phase
|
|
478
525
|
gch::small_vector<std::function<bool(const IterationInfo<Scalar>& info)>>
|
|
479
526
|
callbacks;
|
|
@@ -481,20 +528,22 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
481
528
|
callbacks.emplace_back(callback);
|
|
482
529
|
}
|
|
483
530
|
callbacks.emplace_back([&](const IterationInfo<Scalar>& info) {
|
|
531
|
+
if (run_feasibility_restoration_to_convergence) {
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
|
|
484
535
|
DenseVector trial_x =
|
|
485
536
|
info.x.segment(0, matrices.num_decision_variables);
|
|
486
537
|
|
|
487
538
|
DenseVector trial_c_e = matrices.c_e(trial_x);
|
|
488
539
|
|
|
489
540
|
FilterEntry trial_entry{matrices.f(trial_x), trial_c_e};
|
|
490
|
-
const Scalar D_ϕ_restoration = g.transpose() * (trial_x - x);
|
|
491
541
|
|
|
492
542
|
// If the current iterate sufficiently reduces constraint violation and
|
|
493
543
|
// is accepted by the normal filter, stop feasibility restoration
|
|
494
544
|
return trial_entry.constraint_violation <
|
|
495
545
|
Scalar(0.9) * initial_entry.constraint_violation &&
|
|
496
|
-
filter.
|
|
497
|
-
Scalar(1));
|
|
546
|
+
filter.is_acceptable(trial_entry);
|
|
498
547
|
});
|
|
499
548
|
auto status = feasibility_restoration<Scalar>(matrices, callbacks,
|
|
500
549
|
options, x, y, iterations);
|
|
@@ -506,6 +555,18 @@ ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
506
555
|
|
|
507
556
|
f = matrices.f(x);
|
|
508
557
|
c_e = matrices.c_e(x);
|
|
558
|
+
|
|
559
|
+
// Resuming from an iterate the filter rejects would break the filter's
|
|
560
|
+
// convergence guarantee, and continuing feasibility restoration from its
|
|
561
|
+
// converged point would return that point again, so report failure.
|
|
562
|
+
//
|
|
563
|
+
// The returned iterate can be rejected because feasibility restoration
|
|
564
|
+
// stops at its own convergence tolerance instead of driving constraint
|
|
565
|
+
// violation to zero, so the filter can still hold entries with lower cost
|
|
566
|
+
// and constraint violation.
|
|
567
|
+
if (!filter.is_acceptable(FilterEntry{f, c_e})) {
|
|
568
|
+
return ExitStatus::FEASIBILITY_RESTORATION_FAILED;
|
|
569
|
+
}
|
|
509
570
|
} else {
|
|
510
571
|
// If full step was accepted, reset full-step rejected counter
|
|
511
572
|
if (α == α_max) {
|