sleipnirgroup-jormungandr 0.6.7.dev145__tar.gz → 0.6.7.dev148__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.
Files changed (138) hide show
  1. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/PKG-INFO +1 -1
  2. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/ipm.hpp +26 -154
  3. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/newton.hpp +18 -37
  4. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/sqp.hpp +19 -109
  5. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/dense_kkt_solver.hpp +1 -1
  6. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/kkt_solver.hpp +1 -1
  7. sleipnirgroup_jormungandr-0.6.7.dev148/include/sleipnir/optimization/solver/util/kkt_system.hpp +476 -0
  8. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/sparse_kkt_solver.hpp +2 -2
  9. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/time_trace.hpp +5 -5
  10. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/src/sleipnir/__init__.py +1 -1
  11. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/CMakeLists.txt +0 -0
  12. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/LICENSE.txt +0 -0
  13. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/README.md +0 -0
  14. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/SleipnirConfig.cmake.in +0 -0
  15. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/cmake/BuildTypes.cmake +0 -0
  16. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/cmake/CompilerFlags.cmake +0 -0
  17. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/cmake/Pybind11Mkdoc.cmake +0 -0
  18. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/cmake/Pybind11MkdocPostprocess.cmake +0 -0
  19. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/cmake/SubdirList.cmake +0 -0
  20. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/cmake/aarch64-linux-gnu.cmake +0 -0
  21. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/cmake/arm-none-eabi.cmake +0 -0
  22. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/expression.hpp +0 -0
  23. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/expression_functions.hpp +0 -0
  24. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/expression_graph.hpp +0 -0
  25. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/expression_type.hpp +0 -0
  26. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/gradient.hpp +0 -0
  27. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/hessian.hpp +0 -0
  28. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/jacobian.hpp +0 -0
  29. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
  30. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/slice.hpp +0 -0
  31. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/variable.hpp +0 -0
  32. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/variable_block.hpp +0 -0
  33. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/autodiff/variable_matrix.hpp +0 -0
  34. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/multistart.hpp +0 -0
  35. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
  36. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
  37. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
  38. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/ocp.hpp +0 -0
  39. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/problem.hpp +0 -0
  40. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/control_flow.hpp +0 -0
  41. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
  42. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +0 -0
  43. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/iteration_info.hpp +0 -0
  44. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +0 -0
  45. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/options.hpp +0 -0
  46. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +0 -0
  47. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
  48. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +0 -0
  49. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
  50. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/constraint_violation.hpp +0 -0
  51. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +0 -0
  52. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/feasibility_restoration_cycle_detector.hpp +0 -0
  53. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/filter.hpp +0 -0
  54. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +0 -0
  55. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/kkt_error.hpp +0 -0
  56. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +0 -0
  57. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/regularization_limits.hpp +0 -0
  58. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/ruiz_equilibration.hpp +0 -0
  59. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +0 -0
  60. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/assert.hpp +0 -0
  61. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/concepts.hpp +0 -0
  62. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/empty.hpp +0 -0
  63. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/force_inline.hpp +0 -0
  64. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/function_ref.hpp +0 -0
  65. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
  66. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/pool.hpp +0 -0
  67. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/print.hpp +0 -0
  68. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/print_diagnostics.hpp +0 -0
  69. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/scope_exit.hpp +0 -0
  70. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/spy.hpp +0 -0
  71. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/symbol_exports.hpp +0 -0
  72. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/include/sleipnir/util/time_tracer.hpp +0 -0
  73. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/pyproject.toml +0 -0
  74. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/.clang-tidy +0 -0
  75. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/arity.hpp +0 -0
  76. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
  77. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/autodiff/bind_gradient.cpp +0 -0
  78. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/autodiff/bind_hessian.cpp +0 -0
  79. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
  80. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/autodiff/bind_variable.cpp +0 -0
  81. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/autodiff/bind_variable_block.cpp +0 -0
  82. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/autodiff/bind_variable_matrix.cpp +0 -0
  83. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/binders.hpp +0 -0
  84. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/docstrings.hpp +0 -0
  85. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/for_each_type.hpp +0 -0
  86. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/main.cpp +0 -0
  87. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
  88. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
  89. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/bind_ocp.cpp +0 -0
  90. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/bind_problem.cpp +0 -0
  91. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
  92. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
  93. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
  94. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
  95. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
  96. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/slice_tuple.hpp +0 -0
  97. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/text_wrap.hpp +0 -0
  98. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/cpp/try_cast.hpp +0 -0
  99. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/postprocess_stubs.py +0 -0
  100. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/src/sleipnir/autodiff/__init__.py +0 -0
  101. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/src/sleipnir/optimization/__init__.py +0 -0
  102. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/autodiff/gradient_test.py +0 -0
  103. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/autodiff/hessian_test.py +0 -0
  104. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/autodiff/jacobian_test.py +0 -0
  105. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/autodiff/variable_matrix_test.py +0 -0
  106. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/autodiff/variable_test.py +0 -0
  107. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
  108. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/cart_pole_ocp_test.py +0 -0
  109. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/cart_pole_problem_test.py +0 -0
  110. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/cart_pole_util.py +0 -0
  111. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/constraints_test.py +0 -0
  112. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/differential_drive_ocp_test.py +0 -0
  113. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/differential_drive_problem_test.py +0 -0
  114. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/differential_drive_util.py +0 -0
  115. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/double_integrator_problem_test.py +0 -0
  116. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/flywheel_ocp_test.py +0 -0
  117. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/flywheel_problem_test.py +0 -0
  118. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/flywheel_util.py +0 -0
  119. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/linear_problem_test.py +0 -0
  120. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/multistart_test.py +0 -0
  121. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/nonlinear_problem_test.py +0 -0
  122. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/problem_spy_test.py +0 -0
  123. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/problem_variable_test.py +0 -0
  124. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/quadratic_problem_test.py +0 -0
  125. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/rk4.py +0 -0
  126. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/solver/exit_status_test.py +0 -0
  127. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/tolerance.py +0 -0
  128. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/python/test/optimization/trivial_problem_test.py +0 -0
  129. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/autodiff/gradient.cpp +0 -0
  130. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/autodiff/hessian.cpp +0 -0
  131. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/autodiff/jacobian.cpp +0 -0
  132. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/autodiff/variable_matrix.cpp +0 -0
  133. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/optimization/ocp.cpp +0 -0
  134. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/optimization/problem.cpp +0 -0
  135. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/optimization/solver/ipm.cpp +0 -0
  136. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/optimization/solver/newton.cpp +0 -0
  137. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/optimization/solver/sqp.cpp +0 -0
  138. {sleipnirgroup_jormungandr-0.6.7.dev145 → sleipnirgroup_jormungandr-0.6.7.dev148}/src/util/pool.cpp +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sleipnirgroup-jormungandr
3
- Version: 0.6.7.dev145
3
+ Version: 0.6.7.dev148
4
4
  Summary: Reverse mode autodiff library and NLP solver DSL
5
5
  License-Expression: BSD-3-Clause
6
6
  License-File: LICENSE.txt
@@ -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/kkt_solver.hpp"
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
- // Kept outside the loop so its storage can be reused
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,73 +329,28 @@ ExitStatus ipm(
403
329
 
404
330
  phase_tracer.next(diagnostics[KKT_MATRIX_BUILD]);
405
331
 
406
- // S = diag(s)
407
- // Z = diag(z)
408
- // Σ = S⁻¹Z
409
- const SparseMatrix Σ{s.cwiseInverse().asDiagonal() * z.asDiagonal()};
332
+ kkt_system.build(H, A_e, A_i, s, z);
410
333
 
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ᵢᵀ(−Σcᵢ + μS⁻¹e + z)]
426
- // [ cₑ ]
427
- DenseVector rhs{x.rows() + y.rows()};
428
- rhs.segment(0, x.rows()) =
429
- -g + A_e.transpose() * y +
430
- A_i.transpose() * (-Σ * c_i + μ * s.cwiseInverse() + z);
431
- rhs.segment(x.rows(), y.rows()) = -c_e;
432
-
433
- phase_tracer.next(diagnostics[KKT_MATRIX_DECOMP]);
434
-
435
- Step step;
436
- Scalar α_max(1);
437
- Scalar α(1);
438
- Scalar α_z(1);
439
- bool call_feasibility_restoration = false;
334
+ phase_tracer.next(diagnostics[KKT_MATRIX_FACTOR]);
440
335
 
441
- // Solve the Newton-KKT system
442
- //
443
- // [H + AᵢᵀΣAᵢ Aₑᵀ][ pˣ] = −[∇f − Aₑᵀy − Aᵢᵀ(−Σcᵢ + μS⁻¹e + z)]
444
- // [ Aₑ 0 ][−pʸ] [ cₑ ]
445
- if (solver.compute(lhs).info() != Eigen::Success) [[unlikely]] {
336
+ if (!kkt_system.factorize()) [[unlikely]] {
446
337
  return ExitStatus::FACTORIZATION_FAILED;
447
338
  }
448
339
 
449
340
  phase_tracer.next(diagnostics[KKT_SYSTEM_SOLVE]);
450
341
 
451
- auto compute_step = [&](Step& step, const DenseVector& c_i_minus_s) {
452
- // p = [ pˣ]
453
- // [−pʸ]
454
- DenseVector p = solver.solve(rhs);
455
- step.p_x = p.segment(0, x.rows());
456
- step.p_y = -p.segment(x.rows(), y.rows());
457
-
458
- // pˢ = cᵢ − s + Aᵢpˣ
459
- // pᶻ = μS⁻¹e − z − Σpˢ
460
- step.p_s = c_i_minus_s + A_i * step.p_x;
461
- step.p_z = μ * s.cwiseInverse() - z - Σ * step.p_s;
462
- };
463
- compute_step(step, c_i - s);
342
+ auto step = kkt_system.solve(g, A_e, A_i, y, s, z, μ, c_e, c_i - s);
464
343
 
465
344
  phase_tracer.next(diagnostics[LINE_SEARCH]);
466
345
 
346
+ bool call_feasibility_restoration = false;
347
+
467
348
  // αᵐᵃˣ = max(α ∈ (0, 1] : sₖ + αpₖˢ ≥ (1−τⱼ)sₖ)
468
- α_max = fraction_to_the_boundary_rule<Scalar>(s, step.p_s, τ);
469
- α = α_max;
349
+ Scalar α_max = fraction_to_the_boundary_rule<Scalar>(s, step.p_s, τ);
350
+ Scalar α = α_max;
470
351
 
471
352
  // αₖᶻ = max(α ∈ (0, 1] : zₖ + αpₖᶻ ≥ (1−τⱼ)zₖ)
472
- α_z = fraction_to_the_boundary_rule<Scalar>(z, step.p_z, τ);
353
+ Scalar α_z = fraction_to_the_boundary_rule<Scalar>(z, step.p_z, τ);
473
354
 
474
355
  const FilterEntry<Scalar> current_entry{f, s, c_e, c_i, μ};
475
356
 
@@ -571,32 +452,22 @@ ExitStatus ipm(
571
452
  matrices.scaling, g, A_e, trial_c_e, A_i, trial_c_i,
572
453
  trial_s, trial_y, trial_z, Scalar(0), options.tolerance),
573
454
  trial_f, constraint_violation(trial_c_e, trial_c_i, trial_s),
574
- trial_s.dot(trial_z), μ, solver.hessian_regularization(),
575
- solver.constraint_jacobian_regularization(),
455
+ trial_s.dot(trial_z), μ, kkt_system.hessian_regularization(),
456
+ kkt_system.constraint_jacobian_regularization(),
576
457
  soc_step.primal_inf_norm(), soc_step.dual_inf_norm(), α_soc,
577
458
  Scalar(1), α_reduction_factor, α_z_soc);
578
459
  }
579
460
  }};
580
461
 
581
- // Rebuild Newton-KKT rhs with updated constraint values.
582
- //
583
- // rhs = −[∇f − Aₑᵀy − Aᵢᵀ(μS⁻¹e − Σ(cᵢ − s)ˢᵒᶜ)]
584
- // [ cₑˢᵒᶜ ]
585
- //
586
- // where
462
+ // Solve the Newton-KKT system with corrected constraint values
587
463
  //
588
464
  // cₑˢᵒᶜ = αˢᵒᶜcₑ(xₖ) + cₑ(xₖ + αˢᵒᶜpˣˢᵒᶜ)
589
465
  // (cᵢ − s)ˢᵒᶜ =
590
466
  // αˢᵒᶜ(cᵢ(xₖ) − sₖ) + cᵢ(xₖ + αˢᵒᶜpˣˢᵒᶜ) − (sₖ + αˢᵒᶜpˢˢᵒᶜ)
591
467
  c_e_soc = α_soc * c_e_soc + trial_c_e;
592
468
  c_i_minus_s_soc = α_soc * c_i_minus_s_soc + trial_c_i - trial_s;
593
- rhs.segment(0, x.rows()) =
594
- -g + A_e.transpose() * y +
595
- A_i.transpose() * (μ * s.cwiseInverse() - Σ * c_i_minus_s_soc);
596
- rhs.segment(x.rows(), y.rows()) = -c_e_soc;
597
-
598
- // Solve the Newton-KKT system
599
- 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);
600
471
 
601
472
  // αˢᵒᶜ = max(α ∈ (0, 1] : sₖ + αpₖˢ ≥ (1−τⱼ)sₖ)
602
473
  // αₖᶻˢᵒᶜ = max(α ∈ (0, 1] : zₖ + αpₖᶻ ≥ (1−τⱼ)zₖ)
@@ -856,15 +727,16 @@ ExitStatus ipm(
856
727
  inner_iter_tracer.stop();
857
728
 
858
729
  if (options.diagnostics) {
859
- print_iterate_diagnostics(
860
- iterations,
861
- in_feasibility_restoration ? IterationType::FEASIBILITY_RESTORATION
862
- : IterationType::NORMAL,
863
- inner_iter_tracer.current_duration(), E_0, f,
864
- constraint_violation(c_e, c_i, s), s.dot(z), μ,
865
- solver.hessian_regularization(),
866
- solver.constraint_jacobian_regularization(), step.primal_inf_norm(),
867
- step.dual_inf_norm(), α, α_max, α_reduction_factor, α_z);
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);
868
740
  }
869
741
 
870
742
  ++iterations;
@@ -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/kkt_solver.hpp"
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
- KKTSolver<Scalar> solver{
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);
@@ -150,52 +148,35 @@ ExitStatus newton(
150
148
  }
151
149
  }
152
150
 
153
- phase_tracer.next(diagnostics[KKT_MATRIX_DECOMP]);
151
+ phase_tracer.next(diagnostics[KKT_MATRIX_FACTOR]);
154
152
 
155
- // Solve the Newton-KKT system
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
- DenseVector p_x = solver.solve(-g);
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
- const Scalar D_ϕ = g.transpose() * p_x;
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
- iterations, IterationType::NORMAL,
268
- inner_iter_tracer.current_duration(), E_0, f, Scalar(0), Scalar(0),
269
- Scalar(0), solver.hessian_regularization(),
270
- solver.constraint_jacobian_regularization(),
271
- p_x.template lpNorm<Eigen::Infinity>(), Scalar(1), α, α_max,
272
- α_reduction_factor, Scalar(1));
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/kkt_solver.hpp"
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
- // Kept outside the loop so its storage can be reused
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
- // lhs = [H Aₑᵀ]
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{x.rows() + y.rows()};
297
- rhs.segment(0, x.rows()) = -g + A_e.transpose() * y;
298
- rhs.segment(x.rows(), y.rows()) = -c_e;
299
-
300
- phase_tracer.next(diagnostics[KKT_MATRIX_DECOMP]);
301
-
302
- Step step;
303
- constexpr Scalar α_max(1);
304
- Scalar α(1);
305
- bool call_feasibility_restoration = false;
226
+ kkt_system.build(H, A_e);
306
227
 
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]] {
228
+ phase_tracer.next(diagnostics[KKT_MATRIX_FACTOR]);
229
+
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 compute_step = [&](Step& step) {
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
- α = α_max;
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), solver.hessian_regularization(),
401
- solver.constraint_jacobian_regularization(),
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
- // Rebuild Newton-KKT rhs with updated constraint values.
323
+ // Solve the Newton-KKT system with corrected constraint values
408
324
  //
409
- // rhs = −[∇f − Aₑᵀy]
410
- // [ cₑˢᵒᶜ ]
411
- //
412
- // where cₑˢᵒᶜ = αc(xₖ) + c(xₖ + αpₖˣ)
325
+ // cₑˢᵒᶜ = αc(xₖ) + c(xₖ + αpₖˣ)
413
326
  c_e_soc = α_soc * c_e_soc + trial_c_e;
414
- rhs.bottomRows(y.rows()) = -c_e_soc;
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
- solver.hessian_regularization(),
609
- solver.constraint_jacobian_regularization(),
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
  }
@@ -119,7 +119,7 @@ class DenseKKTSolver {
119
119
  return *this;
120
120
  }
121
121
  } else {
122
- // If the decomposition failed, increase δ and γ to drive all
122
+ // If the factorization failed, increase δ and γ to drive all
123
123
  // eigenvalues away from zero
124
124
  δ *= Scalar(10);
125
125
  γ = γ == Scalar(0) ? γ_initial : std::min(γ * Scalar(10), γ_max);
@@ -49,7 +49,7 @@ class KKTSolver {
49
49
 
50
50
  /// Computes the factorization of the KKT matrix.
51
51
  ///
52
- /// In sparse mode, the matrix's symbolic decomposition is reused in
52
+ /// In sparse mode, the matrix's symbolic factorization is reused in
53
53
  /// subsequent calls, so subsequent calls must be given a matrix with the same
54
54
  /// sparsity pattern.
55
55
  ///