sleipnirgroup-jormungandr 0.6.7.dev114__tar.gz → 0.6.7.dev116__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.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/PKG-INFO +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/variable_block.hpp +2 -3
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/variable_matrix.hpp +6 -11
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/problem.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/ipm.hpp +6 -8
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/iteration_info.hpp +4 -4
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/newton.hpp +7 -7
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/sqp.hpp +6 -8
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/constraint_violation.hpp +4 -4
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/dense_kkt_solver.hpp +83 -55
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +12 -17
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/filter.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +3 -3
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/inertia.hpp +0 -41
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/kkt_error.hpp +27 -31
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/kkt_solver.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +2 -2
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/sparse_kkt_solver.hpp +35 -10
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/print_diagnostics.hpp +5 -6
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/autodiff/bind_variable_block.cpp +2 -3
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/autodiff/bind_variable_matrix.cpp +4 -4
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/try_cast.hpp +1 -2
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/src/sleipnir/__init__.py +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/optimization/solver/ipm.cpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/optimization/solver/newton.cpp +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/optimization/solver/sqp.cpp +1 -2
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/CMakeLists.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/LICENSE.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/README.md +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/SleipnirConfig.cmake.in +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/cmake/BuildTypes.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/cmake/CompilerFlags.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/cmake/Pybind11Mkdoc.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/cmake/Pybind11MkdocPostprocess.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/cmake/SubdirList.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/cmake/aarch64-linux-gnu.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/cmake/arm-none-eabi.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/expression.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/expression_functions.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/expression_graph.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/expression_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/gradient.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/hessian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/jacobian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/slice.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/autodiff/variable.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/multistart.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/ocp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/options.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/optimization/solver/util/time_trace.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/assert.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/concepts.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/empty.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/force_inline.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/function_ref.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/pool.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/print.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/scope_exit.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/spy.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/symbol_exports.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/include/sleipnir/util/time_tracer.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/pyproject.toml +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/arity.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/autodiff/bind_gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/autodiff/bind_hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/autodiff/bind_variable.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/binders.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/docstrings.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/for_each_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/main.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/bind_ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/bind_problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/slice_tuple.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/cpp/text_wrap.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/postprocess_stubs.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/src/sleipnir/autodiff/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/src/sleipnir/optimization/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/autodiff/gradient_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/autodiff/hessian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/autodiff/jacobian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/autodiff/variable_matrix_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/autodiff/variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/cart_pole_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/cart_pole_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/cart_pole_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/constraints_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/decision_variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/differential_drive_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/differential_drive_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/differential_drive_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/double_integrator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/flywheel_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/flywheel_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/flywheel_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/linear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/multistart_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/nonlinear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/problem_spy_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/quadratic_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/rk4.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/solver/exit_status_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/python/test/optimization/trivial_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/autodiff/gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/autodiff/hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/autodiff/jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/autodiff/variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/optimization/ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/optimization/problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev114 → sleipnirgroup_jormungandr-0.6.7.dev116}/src/util/pool.cpp +0 -0
|
@@ -593,9 +593,8 @@ class VariableBlock : public SleipnirBase {
|
|
|
593
593
|
/// Returns the contents of the variable matrix.
|
|
594
594
|
///
|
|
595
595
|
/// @return The contents of the variable matrix.
|
|
596
|
-
Eigen::
|
|
597
|
-
Eigen::
|
|
598
|
-
cols()};
|
|
596
|
+
Eigen::MatrixX<Scalar> value() {
|
|
597
|
+
Eigen::MatrixX<Scalar> result{rows(), cols()};
|
|
599
598
|
|
|
600
599
|
for (int row = 0; row < rows(); ++row) {
|
|
601
600
|
for (int col = 0; col < cols(); ++col) {
|
|
@@ -990,9 +990,8 @@ class VariableMatrix : public SleipnirBase {
|
|
|
990
990
|
/// Returns the contents of the variable matrix.
|
|
991
991
|
///
|
|
992
992
|
/// @return The contents of the variable matrix.
|
|
993
|
-
Eigen::
|
|
994
|
-
Eigen::
|
|
995
|
-
cols()};
|
|
993
|
+
Eigen::MatrixX<Scalar> value() {
|
|
994
|
+
Eigen::MatrixX<Scalar> result{rows(), cols()};
|
|
996
995
|
|
|
997
996
|
for (int row = 0; row < rows(); ++row) {
|
|
998
997
|
for (int col = 0; col < cols(); ++col) {
|
|
@@ -1006,10 +1005,8 @@ class VariableMatrix : public SleipnirBase {
|
|
|
1006
1005
|
/// Converts the VariableMatrix to an Eigen matrix.
|
|
1007
1006
|
///
|
|
1008
1007
|
/// @return Eigen matrix.
|
|
1009
|
-
Eigen::
|
|
1010
|
-
|
|
1011
|
-
Eigen::Matrix<Variable<Scalar>, Eigen::Dynamic, Eigen::Dynamic> result{
|
|
1012
|
-
rows(), cols()};
|
|
1008
|
+
Eigen::MatrixX<Variable<Scalar>> to_eigen() const {
|
|
1009
|
+
Eigen::MatrixX<Variable<Scalar>> result{rows(), cols()};
|
|
1013
1010
|
|
|
1014
1011
|
for (int row = 0; row < rows(); ++row) {
|
|
1015
1012
|
for (int col = 0; col < cols(); ++col) {
|
|
@@ -1104,11 +1101,9 @@ class VariableMatrix : public SleipnirBase {
|
|
|
1104
1101
|
// Q = Σ qₖAᵏ
|
|
1105
1102
|
// k=0
|
|
1106
1103
|
VariableMatrix<Scalar> P{
|
|
1107
|
-
Eigen::
|
|
1108
|
-
.asDiagonal()};
|
|
1104
|
+
Eigen::VectorX<Scalar>::Constant(rows(), p[0]).asDiagonal()};
|
|
1109
1105
|
VariableMatrix<Scalar> Q{
|
|
1110
|
-
Eigen::
|
|
1111
|
-
.asDiagonal()};
|
|
1106
|
+
Eigen::VectorX<Scalar>::Constant(rows(), q[0]).asDiagonal()};
|
|
1112
1107
|
auto A_pow = *this;
|
|
1113
1108
|
size_t k = 1;
|
|
1114
1109
|
while (true) {
|
|
@@ -71,8 +71,8 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
71
71
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
72
72
|
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
73
73
|
#endif
|
|
74
|
-
Eigen::
|
|
75
|
-
using DenseVector = Eigen::
|
|
74
|
+
Eigen::VectorX<Scalar>& x) {
|
|
75
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
76
76
|
|
|
77
77
|
// If cᵢ(x) is sufficiently feasible, start the constraint with zero
|
|
78
78
|
// violation. Otherwise, make Σ = S⁻¹Z ≈ I.
|
|
@@ -133,12 +133,10 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
133
133
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
134
134
|
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
135
135
|
#endif
|
|
136
|
-
Eigen::
|
|
137
|
-
Eigen::
|
|
138
|
-
Eigen::Vector<Scalar, Eigen::Dynamic>& y,
|
|
139
|
-
Eigen::Vector<Scalar, Eigen::Dynamic>& z, Scalar& μ,
|
|
136
|
+
Eigen::VectorX<Scalar>& x, Eigen::VectorX<Scalar>& s,
|
|
137
|
+
Eigen::VectorX<Scalar>& y, Eigen::VectorX<Scalar>& z, Scalar& μ,
|
|
140
138
|
int& iterations) {
|
|
141
|
-
using DenseVector = Eigen::
|
|
139
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
142
140
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
143
141
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
144
142
|
|
|
@@ -888,6 +886,6 @@ ipm(const IPMMatrixCallbacks<double>& matrix_callbacks,
|
|
|
888
886
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
889
887
|
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
890
888
|
#endif
|
|
891
|
-
Eigen::
|
|
889
|
+
Eigen::VectorX<double>& x);
|
|
892
890
|
|
|
893
891
|
} // namespace slp
|
|
@@ -17,7 +17,7 @@ namespace slp {
|
|
|
17
17
|
template <typename Scalar>
|
|
18
18
|
struct IPMMatrixCallbacks {
|
|
19
19
|
/// Type alias for dense vector.
|
|
20
|
-
using DenseVector = Eigen::
|
|
20
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
21
21
|
/// Type alias for sparse matrix.
|
|
22
22
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
23
23
|
/// Type alias for sparse vector.
|
|
@@ -16,16 +16,16 @@ struct IterationInfo {
|
|
|
16
16
|
int iteration;
|
|
17
17
|
|
|
18
18
|
/// The decision variables.
|
|
19
|
-
const Eigen::
|
|
19
|
+
const Eigen::VectorX<Scalar>& x;
|
|
20
20
|
|
|
21
21
|
/// The inequality constraint slack variables.
|
|
22
|
-
const Eigen::
|
|
22
|
+
const Eigen::VectorX<Scalar>& s;
|
|
23
23
|
|
|
24
24
|
/// The equality constraint dual variables.
|
|
25
|
-
const Eigen::
|
|
25
|
+
const Eigen::VectorX<Scalar>& y;
|
|
26
26
|
|
|
27
27
|
/// The inequality constraint dual variables.
|
|
28
|
-
const Eigen::
|
|
28
|
+
const Eigen::VectorX<Scalar>& z;
|
|
29
29
|
|
|
30
30
|
/// The gradient of the cost function.
|
|
31
31
|
const Eigen::SparseVector<Scalar>& g;
|
|
@@ -54,8 +54,8 @@ ExitStatus newton(
|
|
|
54
54
|
const NewtonMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
55
55
|
std::span<std::function<bool(const IterationInfo<Scalar>& info)>>
|
|
56
56
|
iteration_callbacks,
|
|
57
|
-
const Options<Scalar>& options, Eigen::
|
|
58
|
-
using DenseVector = Eigen::
|
|
57
|
+
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x) {
|
|
58
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
59
59
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
60
60
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
61
61
|
|
|
@@ -288,10 +288,10 @@ ExitStatus newton(
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
292
|
+
newton(const NewtonMatrixCallbacks<double>& matrix_callbacks,
|
|
293
|
+
std::span<std::function<bool(const IterationInfo<double>& info)>>
|
|
294
|
+
iteration_callbacks,
|
|
295
|
+
const Options<double>& options, Eigen::VectorX<double>& x);
|
|
296
296
|
|
|
297
297
|
} // namespace slp
|
|
@@ -17,7 +17,7 @@ namespace slp {
|
|
|
17
17
|
template <typename Scalar>
|
|
18
18
|
struct NewtonMatrixCallbacks {
|
|
19
19
|
/// Type alias for dense vector.
|
|
20
|
-
using DenseVector = Eigen::
|
|
20
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
21
21
|
/// Type alias for sparse matrix.
|
|
22
22
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
23
23
|
/// Type alias for sparse vector.
|
|
@@ -61,9 +61,8 @@ template <typename Scalar>
|
|
|
61
61
|
ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
62
62
|
std::span<std::function<bool(const IterationInfo<Scalar>& info)>>
|
|
63
63
|
iteration_callbacks,
|
|
64
|
-
const Options<Scalar>& options,
|
|
65
|
-
|
|
66
|
-
using DenseVector = Eigen::Vector<Scalar, Eigen::Dynamic>;
|
|
64
|
+
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x) {
|
|
65
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
67
66
|
|
|
68
67
|
DenseVector y = DenseVector::Zero(matrix_callbacks.num_equality_constraints);
|
|
69
68
|
|
|
@@ -96,10 +95,9 @@ template <typename Scalar>
|
|
|
96
95
|
ExitStatus sqp(const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
97
96
|
std::span<std::function<bool(const IterationInfo<Scalar>& info)>>
|
|
98
97
|
iteration_callbacks,
|
|
99
|
-
const Options<Scalar>& options,
|
|
100
|
-
Eigen::
|
|
101
|
-
|
|
102
|
-
using DenseVector = Eigen::Vector<Scalar, Eigen::Dynamic>;
|
|
98
|
+
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x,
|
|
99
|
+
Eigen::VectorX<Scalar>& y) {
|
|
100
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
103
101
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
104
102
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
105
103
|
|
|
@@ -627,6 +625,6 @@ extern template SLEIPNIR_DLLEXPORT ExitStatus
|
|
|
627
625
|
sqp(const SQPMatrixCallbacks<double>& matrix_callbacks,
|
|
628
626
|
std::span<std::function<bool(const IterationInfo<double>& info)>>
|
|
629
627
|
iteration_callbacks,
|
|
630
|
-
const Options<double>& options, Eigen::
|
|
628
|
+
const Options<double>& options, Eigen::VectorX<double>& x);
|
|
631
629
|
|
|
632
630
|
} // namespace slp
|
|
@@ -17,7 +17,7 @@ namespace slp {
|
|
|
17
17
|
template <typename Scalar>
|
|
18
18
|
struct SQPMatrixCallbacks {
|
|
19
19
|
/// Type alias for dense vector.
|
|
20
|
-
using DenseVector = Eigen::
|
|
20
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
21
21
|
/// Type alias for sparse matrix.
|
|
22
22
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
23
23
|
/// Type alias for sparse vector.
|
|
@@ -57,7 +57,7 @@ void append_as_triplets(
|
|
|
57
57
|
template <typename Scalar>
|
|
58
58
|
void append_diagonal_as_triplets(
|
|
59
59
|
gch::small_vector<Eigen::Triplet<Scalar>>& triplets, int row_offset,
|
|
60
|
-
int col_offset, const Eigen::
|
|
60
|
+
int col_offset, const Eigen::VectorX<Scalar>& diag) {
|
|
61
61
|
for (int row = 0; row < diag.rows(); ++row) {
|
|
62
62
|
triplets.emplace_back(row_offset + row, col_offset + row, diag[row]);
|
|
63
63
|
}
|
|
@@ -13,7 +13,7 @@ namespace slp {
|
|
|
13
13
|
/// @param c_e The equality constraint values (nonzero means violation).
|
|
14
14
|
/// @return The constraint violation.
|
|
15
15
|
template <typename Scalar>
|
|
16
|
-
Scalar constraint_violation(const Eigen::
|
|
16
|
+
Scalar constraint_violation(const Eigen::VectorX<Scalar>& c_e) {
|
|
17
17
|
return c_e.template lpNorm<1>();
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -25,9 +25,9 @@ Scalar constraint_violation(const Eigen::Vector<Scalar, Eigen::Dynamic>& c_e) {
|
|
|
25
25
|
/// @param s The inequality constraint slack variables.
|
|
26
26
|
/// @return The constraint violation.
|
|
27
27
|
template <typename Scalar>
|
|
28
|
-
Scalar constraint_violation(const Eigen::
|
|
29
|
-
const Eigen::
|
|
30
|
-
const Eigen::
|
|
28
|
+
Scalar constraint_violation(const Eigen::VectorX<Scalar>& c_e,
|
|
29
|
+
const Eigen::VectorX<Scalar>& c_i,
|
|
30
|
+
const Eigen::VectorX<Scalar>& s) {
|
|
31
31
|
return c_e.template lpNorm<1>() + (c_i - s).template lpNorm<1>();
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
#pragma once
|
|
4
4
|
|
|
5
5
|
#include <algorithm>
|
|
6
|
+
#include <cmath>
|
|
7
|
+
#include <limits>
|
|
6
8
|
|
|
7
9
|
#include <Eigen/Cholesky>
|
|
8
10
|
#include <Eigen/Core>
|
|
@@ -20,9 +22,9 @@ template <typename Scalar>
|
|
|
20
22
|
class DenseKKTSolver {
|
|
21
23
|
public:
|
|
22
24
|
/// Type alias for dense matrix.
|
|
23
|
-
using DenseMatrix = Eigen::
|
|
25
|
+
using DenseMatrix = Eigen::MatrixX<Scalar>;
|
|
24
26
|
/// Type alias for dense vector.
|
|
25
|
-
using DenseVector = Eigen::
|
|
27
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
26
28
|
|
|
27
29
|
/// Constructs a DenseKKTSolver instance.
|
|
28
30
|
///
|
|
@@ -57,25 +59,14 @@ class DenseKKTSolver {
|
|
|
57
59
|
/// @param lhs Left-hand side of the system.
|
|
58
60
|
/// @return The factorization.
|
|
59
61
|
DenseKKTSolver& compute(const DenseMatrix& lhs) {
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
auto D = m_solver.vectorD();
|
|
69
|
-
|
|
70
|
-
// If the inertia is ideal and D from LDLT is sufficiently far from
|
|
71
|
-
// zero, don't regularize the system
|
|
72
|
-
if (Inertia{D} == ideal_inertia &&
|
|
73
|
-
(D.cwiseAbs().array() >= Scalar(1e-4)).all()) {
|
|
74
|
-
m_prev_δ = Scalar(0);
|
|
75
|
-
m_prev_γ = Scalar(0);
|
|
76
|
-
return *this;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
62
|
+
// Bunch-Kaufman pivoting is backward stable for indefinite matrices, so the
|
|
63
|
+
// unregularized system is accepted whenever its inertia is ideal
|
|
64
|
+
m_lhs = lhs;
|
|
65
|
+
m_info = m_solver.compute(m_lhs).info();
|
|
66
|
+
if (m_info == Eigen::Success && inertia() == ideal_inertia) {
|
|
67
|
+
m_prev_δ = Scalar(0);
|
|
68
|
+
m_prev_γ = Scalar(0);
|
|
69
|
+
return *this;
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
// We'll give lhs the correct inertia by adding [δI, 0; 0, −γI] where δ and
|
|
@@ -88,11 +79,17 @@ class DenseKKTSolver {
|
|
|
88
79
|
// constraint Jacobian more than they help a rank-deficient one.
|
|
89
80
|
constexpr Scalar γ_max(1e-8);
|
|
90
81
|
|
|
82
|
+
// The initial nonzero constraint regularization
|
|
83
|
+
constexpr Scalar γ_initial(1e-10);
|
|
84
|
+
|
|
91
85
|
// If the previous δ was zero, attempt a small value. Otherwise, attempt a
|
|
92
86
|
// smaller value than the previous δ so δ trends downward. δ has a floor
|
|
93
|
-
// because
|
|
94
|
-
//
|
|
95
|
-
//
|
|
87
|
+
// because when regularization is needed, δ is the only curvature in some
|
|
88
|
+
// directions, so the KKT matrix's smallest eigenvalues shrink with δ. Too
|
|
89
|
+
// small a δ makes the matrix ill-conditioned, which amplifies the
|
|
90
|
+
// factorization's rounding error in the solution, and eventually puts those
|
|
91
|
+
// eigenvalues within ε of zero, where the inertia check counts them as
|
|
92
|
+
// zero.
|
|
96
93
|
Scalar δ = m_prev_δ == Scalar(0) ? Scalar(1e-4)
|
|
97
94
|
: std::max(m_prev_δ / Scalar(2), δ_min);
|
|
98
95
|
|
|
@@ -105,7 +102,7 @@ class DenseKKTSolver {
|
|
|
105
102
|
m_info = m_solver.compute(m_lhs).info();
|
|
106
103
|
|
|
107
104
|
if (m_info == Eigen::Success) {
|
|
108
|
-
Inertia inertia
|
|
105
|
+
Inertia inertia = this->inertia();
|
|
109
106
|
|
|
110
107
|
if (inertia == ideal_inertia) {
|
|
111
108
|
// If the inertia is ideal, report success
|
|
@@ -116,7 +113,7 @@ class DenseKKTSolver {
|
|
|
116
113
|
if (γ == Scalar(0)) {
|
|
117
114
|
// If there's zero eigenvalues and γ = 0, increase γ to potentially
|
|
118
115
|
// compensate for a rank-deficient equality constraint Jacobian
|
|
119
|
-
γ =
|
|
116
|
+
γ = γ_initial;
|
|
120
117
|
} else {
|
|
121
118
|
// If there's zero eigenvalues and γ > 0, increase δ and γ to drive
|
|
122
119
|
// all eigenvalues away from zero
|
|
@@ -128,26 +125,23 @@ class DenseKKTSolver {
|
|
|
128
125
|
// positive eigenvalues
|
|
129
126
|
δ *= Scalar(10);
|
|
130
127
|
} else if (inertia.positive > ideal_inertia.positive) {
|
|
131
|
-
//
|
|
132
|
-
//
|
|
133
|
-
//
|
|
128
|
+
// The KKT matrix has at least as many negative eigenvalues as
|
|
129
|
+
// equality constraints if γ > 0 (from the −γI block) or if the
|
|
130
|
+
// equality constraint Jacobian has full row rank (as in feasibility
|
|
131
|
+
// restoration, where γ = 0). Too many positive eigenvalues can then
|
|
132
|
+
// only come from rounding error, so increase δ and γ to drive all
|
|
133
|
+
// eigenvalues away from zero.
|
|
134
134
|
//
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (γ < γ_max && !smallest_pivot_is_hessian()) {
|
|
140
|
-
γ = γ == Scalar(0) ? Scalar(1e-10)
|
|
141
|
-
: std::min(γ * Scalar(10), γ_max);
|
|
142
|
-
} else {
|
|
143
|
-
δ *= Scalar(10);
|
|
144
|
-
}
|
|
135
|
+
// Unlike LDLT, Bunch-Kaufman pivoting avoids small pivots, so
|
|
136
|
+
// there's no need to find which block the error came from.
|
|
137
|
+
δ *= Scalar(10);
|
|
138
|
+
γ = std::min(γ * Scalar(10), γ_max);
|
|
145
139
|
}
|
|
146
140
|
} else {
|
|
147
141
|
// If the decomposition failed, increase δ and γ to drive all
|
|
148
142
|
// eigenvalues away from zero
|
|
149
143
|
δ *= Scalar(10);
|
|
150
|
-
γ = γ == Scalar(0) ?
|
|
144
|
+
γ = γ == Scalar(0) ? γ_initial : std::min(γ * Scalar(10), γ_max);
|
|
151
145
|
}
|
|
152
146
|
|
|
153
147
|
// If the lhs perturbation is too high, report failure. This can be caused
|
|
@@ -169,9 +163,9 @@ class DenseKKTSolver {
|
|
|
169
163
|
DenseVector solve(const Eigen::MatrixBase<Rhs>& rhs) const {
|
|
170
164
|
DenseVector x = m_solver.solve(rhs);
|
|
171
165
|
|
|
172
|
-
//
|
|
173
|
-
//
|
|
174
|
-
//
|
|
166
|
+
// The factorization is backward stable, but the matrix's conditioning
|
|
167
|
+
// amplifies its rounding error in the solution, so apply iterative
|
|
168
|
+
// refinement with the same factorization
|
|
175
169
|
constexpr int max_refinement_steps = 3;
|
|
176
170
|
for (int i = 0; i < max_refinement_steps; ++i) {
|
|
177
171
|
DenseVector r = rhs - m_lhs.template selfadjointView<Eigen::Lower>() * x;
|
|
@@ -204,7 +198,7 @@ class DenseKKTSolver {
|
|
|
204
198
|
Scalar constraint_jacobian_regularization() const { return m_prev_γ; }
|
|
205
199
|
|
|
206
200
|
private:
|
|
207
|
-
using Solver = Eigen::
|
|
201
|
+
using Solver = Eigen::BunchKaufman<DenseMatrix>;
|
|
208
202
|
|
|
209
203
|
Solver m_solver;
|
|
210
204
|
|
|
@@ -232,18 +226,52 @@ class DenseKKTSolver {
|
|
|
232
226
|
/// The value of γ from the previous run of compute().
|
|
233
227
|
Scalar m_prev_γ{0};
|
|
234
228
|
|
|
235
|
-
/// Returns
|
|
236
|
-
///
|
|
229
|
+
/// Returns the inertia of the most recently factorized KKT matrix.
|
|
230
|
+
///
|
|
231
|
+
/// D from the Bunch-Kaufman factorization has 1x1 and 2x2 diagonal blocks.
|
|
232
|
+
/// By Sylvester's law of inertia, the KKT matrix's inertia is the inertia of
|
|
233
|
+
/// D, which is the inertia of the blocks' eigenvalues. Eigenvalues within ε
|
|
234
|
+
/// of zero are counted as zero.
|
|
237
235
|
///
|
|
238
|
-
/// @return
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
236
|
+
/// @return The inertia of the most recently factorized KKT matrix.
|
|
237
|
+
Inertia inertia() const {
|
|
238
|
+
using std::abs;
|
|
239
|
+
using std::hypot;
|
|
240
|
+
|
|
241
|
+
constexpr Scalar ε = std::numeric_limits<Scalar>::epsilon();
|
|
242
|
+
|
|
243
|
+
const auto D = m_solver.vectorD();
|
|
244
|
+
const auto& D_sub = m_solver.subDiagonal();
|
|
245
|
+
|
|
246
|
+
Inertia inertia;
|
|
247
|
+
auto count = [&](Scalar λ) {
|
|
248
|
+
if (λ > ε) {
|
|
249
|
+
++inertia.positive;
|
|
250
|
+
} else if (λ < -ε) {
|
|
251
|
+
++inertia.negative;
|
|
252
|
+
} else {
|
|
253
|
+
++inertia.zero;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
for (int k = 0; k < D.size(); ++k) {
|
|
258
|
+
if (k + 1 < D.size() && D_sub[k] != Scalar(0)) {
|
|
259
|
+
// The 2x2 block [a b; b c] has eigenvalues (a + c)/2 ± r where
|
|
260
|
+
// r = √(((a − c)/2)² + b²)
|
|
261
|
+
const Scalar a = D[k];
|
|
262
|
+
const Scalar b = D_sub[k];
|
|
263
|
+
const Scalar c = D[k + 1];
|
|
264
|
+
const Scalar mid = (a + c) / Scalar(2);
|
|
265
|
+
const Scalar r = hypot((a - c) / Scalar(2), abs(b));
|
|
266
|
+
count(mid + r);
|
|
267
|
+
count(mid - r);
|
|
268
|
+
++k;
|
|
269
|
+
} else {
|
|
270
|
+
count(D[k]);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return inertia;
|
|
247
275
|
}
|
|
248
276
|
|
|
249
277
|
/// Returns regularization matrix.
|
|
@@ -32,10 +32,8 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
32
32
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
33
33
|
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
34
34
|
#endif
|
|
35
|
-
Eigen::
|
|
36
|
-
Eigen::
|
|
37
|
-
Eigen::Vector<Scalar, Eigen::Dynamic>& y,
|
|
38
|
-
Eigen::Vector<Scalar, Eigen::Dynamic>& z, Scalar& μ,
|
|
35
|
+
Eigen::VectorX<Scalar>& x, Eigen::VectorX<Scalar>& s,
|
|
36
|
+
Eigen::VectorX<Scalar>& y, Eigen::VectorX<Scalar>& z, Scalar& μ,
|
|
39
37
|
int& iterations);
|
|
40
38
|
|
|
41
39
|
/// Computes initial values for p and n in feasibility restoration.
|
|
@@ -47,10 +45,8 @@ ExitStatus ipm(const IPMMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
|
47
45
|
/// @return Tuple of positive and negative constraint relaxation slack variables
|
|
48
46
|
/// respectively.
|
|
49
47
|
template <typename Scalar>
|
|
50
|
-
std::tuple<Eigen::
|
|
51
|
-
|
|
52
|
-
compute_p_n(const Eigen::Vector<Scalar, Eigen::Dynamic>& c, Scalar ρ,
|
|
53
|
-
Scalar μ) {
|
|
48
|
+
std::tuple<Eigen::VectorX<Scalar>, Eigen::VectorX<Scalar>> compute_p_n(
|
|
49
|
+
const Eigen::VectorX<Scalar>& c, Scalar ρ, Scalar μ) {
|
|
54
50
|
// From equation (33) of [2]:
|
|
55
51
|
// ______________________
|
|
56
52
|
// μ − ρ c(x) /(μ − ρ c(x))² μ c(x)
|
|
@@ -81,7 +77,7 @@ compute_p_n(const Eigen::Vector<Scalar, Eigen::Dynamic>& c, Scalar ρ,
|
|
|
81
77
|
//
|
|
82
78
|
// p = c(x) + n (6)
|
|
83
79
|
|
|
84
|
-
using DenseVector = Eigen::
|
|
80
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
85
81
|
|
|
86
82
|
using std::sqrt;
|
|
87
83
|
|
|
@@ -119,8 +115,8 @@ ExitStatus feasibility_restoration(
|
|
|
119
115
|
const SQPMatrixCallbacks<Scalar>& matrix_callbacks,
|
|
120
116
|
std::span<std::function<bool(const IterationInfo<Scalar>& info)>>
|
|
121
117
|
iteration_callbacks,
|
|
122
|
-
const Options<Scalar>& options, Eigen::
|
|
123
|
-
Eigen::
|
|
118
|
+
const Options<Scalar>& options, Eigen::VectorX<Scalar>& x,
|
|
119
|
+
Eigen::VectorX<Scalar>& y, int& iterations) {
|
|
124
120
|
// Feasibility restoration
|
|
125
121
|
//
|
|
126
122
|
// min ρ Σ (pₑ + nₑ) + ζ/2 (x - xᵣ)ᵀDᵣ(x - xᵣ)
|
|
@@ -137,7 +133,7 @@ ExitStatus feasibility_restoration(
|
|
|
137
133
|
//
|
|
138
134
|
// Dᵣ = diag(min(1, 1/xᵣ[i]²) for i in x.rows())
|
|
139
135
|
|
|
140
|
-
using DenseVector = Eigen::
|
|
136
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
141
137
|
using DiagonalMatrix = Eigen::DiagonalMatrix<Scalar, Eigen::Dynamic>;
|
|
142
138
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
143
139
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
@@ -381,10 +377,9 @@ ExitStatus feasibility_restoration(
|
|
|
381
377
|
#ifdef SLEIPNIR_ENABLE_BOUND_PROJECTION
|
|
382
378
|
const Eigen::ArrayX<bool>& bound_constraint_mask,
|
|
383
379
|
#endif
|
|
384
|
-
Eigen::
|
|
385
|
-
Eigen::
|
|
386
|
-
|
|
387
|
-
Eigen::Vector<Scalar, Eigen::Dynamic>& z, Scalar μ, int& iterations) {
|
|
380
|
+
Eigen::VectorX<Scalar>& x, Eigen::VectorX<Scalar>& s,
|
|
381
|
+
Eigen::VectorX<Scalar>& y, Eigen::VectorX<Scalar>& z, Scalar μ,
|
|
382
|
+
int& iterations) {
|
|
388
383
|
// Feasibility restoration
|
|
389
384
|
//
|
|
390
385
|
// min ρ Σ (pₑ + nₑ + pᵢ + nᵢ) + ζ/2 (x - xᵣ)ᵀDᵣ(x - xᵣ)
|
|
@@ -405,7 +400,7 @@ ExitStatus feasibility_restoration(
|
|
|
405
400
|
//
|
|
406
401
|
// Dᵣ = diag(min(1, 1/xᵣ[i]²) for i in x.rows())
|
|
407
402
|
|
|
408
|
-
using DenseVector = Eigen::
|
|
403
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
409
404
|
using DiagonalMatrix = Eigen::DiagonalMatrix<Scalar, Eigen::Dynamic>;
|
|
410
405
|
using SparseMatrix = Eigen::SparseMatrix<Scalar>;
|
|
411
406
|
using SparseVector = Eigen::SparseVector<Scalar>;
|
|
@@ -20,7 +20,7 @@ namespace slp {
|
|
|
20
20
|
template <typename Scalar>
|
|
21
21
|
struct FilterEntry {
|
|
22
22
|
/// Type alias for dense vector.
|
|
23
|
-
using DenseVector = Eigen::
|
|
23
|
+
using DenseVector = Eigen::VectorX<Scalar>;
|
|
24
24
|
|
|
25
25
|
/// The cost function's value
|
|
26
26
|
Scalar cost{0};
|
|
@@ -17,9 +17,9 @@ namespace slp {
|
|
|
17
17
|
/// @param τ Fraction-to-the-boundary rule scaling factor within (0, 1].
|
|
18
18
|
/// @return Fraction of the iterate step size within (0, 1].
|
|
19
19
|
template <typename Scalar>
|
|
20
|
-
Scalar fraction_to_the_boundary_rule(
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
Scalar fraction_to_the_boundary_rule(const Eigen::VectorX<Scalar>& x,
|
|
21
|
+
const Eigen::VectorX<Scalar>& p,
|
|
22
|
+
Scalar τ) {
|
|
23
23
|
// The fraction-to-the-boundary rule is defined as:
|
|
24
24
|
//
|
|
25
25
|
// α = max(α ∈ (0, 1] : x + αp ≥ (1 − τ)x) (1)
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
#pragma once
|
|
4
4
|
|
|
5
5
|
#include <format>
|
|
6
|
-
#include <limits>
|
|
7
|
-
|
|
8
|
-
#include <Eigen/Core>
|
|
9
6
|
|
|
10
7
|
namespace slp {
|
|
11
8
|
|
|
@@ -31,44 +28,6 @@ class Inertia {
|
|
|
31
28
|
constexpr Inertia(int positive, int negative, int zero)
|
|
32
29
|
: positive{positive}, negative{negative}, zero{zero} {}
|
|
33
30
|
|
|
34
|
-
/// Constructs Inertia from the D matrix of an LDLT decomposition
|
|
35
|
-
/// (see https://en.wikipedia.org/wiki/Sylvester's_law_of_inertia).
|
|
36
|
-
///
|
|
37
|
-
/// @tparam Scalar Scalar type.
|
|
38
|
-
/// @param D The D matrix of an LDLT decomposition in vector form.
|
|
39
|
-
template <typename Scalar>
|
|
40
|
-
explicit Inertia(const Eigen::Vector<Scalar, Eigen::Dynamic>& D) {
|
|
41
|
-
for (const auto& elem : D) {
|
|
42
|
-
if (elem > std::numeric_limits<Scalar>::epsilon()) {
|
|
43
|
-
++positive;
|
|
44
|
-
} else if (elem < -std::numeric_limits<Scalar>::epsilon()) {
|
|
45
|
-
++negative;
|
|
46
|
-
} else {
|
|
47
|
-
++zero;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/// Constructs Inertia from the D matrix of an LDLT decomposition
|
|
53
|
-
/// (see https://en.wikipedia.org/wiki/Sylvester's_law_of_inertia).
|
|
54
|
-
///
|
|
55
|
-
/// @tparam Scalar Scalar type.
|
|
56
|
-
/// @param D The D matrix of an LDLT decomposition in vector form.
|
|
57
|
-
template <typename Scalar>
|
|
58
|
-
explicit Inertia(
|
|
59
|
-
const Eigen::Diagonal<
|
|
60
|
-
const Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>>& D) {
|
|
61
|
-
for (const auto& elem : D) {
|
|
62
|
-
if (elem > std::numeric_limits<Scalar>::epsilon()) {
|
|
63
|
-
++positive;
|
|
64
|
-
} else if (elem < -std::numeric_limits<Scalar>::epsilon()) {
|
|
65
|
-
++negative;
|
|
66
|
-
} else {
|
|
67
|
-
++zero;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
31
|
/// Inertia equality operator.
|
|
73
32
|
///
|
|
74
33
|
/// @return True if Inertia is equal.
|