sleipnirgroup-jormungandr 0.6.7.dev60__tar.gz → 0.6.7.dev62__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.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/CMakeLists.txt +13 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/PKG-INFO +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/pyproject.toml +2 -0
- sleipnirgroup_jormungandr-0.6.7.dev62/python/cpp/arity.hpp +42 -0
- sleipnirgroup_jormungandr-0.6.7.dev62/python/cpp/optimization/bind_problem.cpp +216 -0
- sleipnirgroup_jormungandr-0.6.7.dev62/python/cpp/text_wrap.hpp +84 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/src/sleipnir/__init__.py +1 -1
- sleipnirgroup_jormungandr-0.6.7.dev60/python/cpp/optimization/bind_problem.cpp +0 -156
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/LICENSE.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/README.md +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/SleipnirConfig.cmake.in +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/cmake/BuildTypes.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/cmake/CompilerFlags.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/cmake/Pybind11Mkdoc.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/cmake/Pybind11MkdocPostprocess.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/cmake/SubdirList.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/cmake/arm-none-eabi.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/expression.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/expression_graph.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/expression_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/gradient.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/hessian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/jacobian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/slice.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/variable.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/variable_block.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/autodiff/variable_matrix.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/multistart.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/ocp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/problem.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/ipm.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/iteration_info.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/newton.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/options.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/sqp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/dense_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/filter.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/inertia.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/kkt_error.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/optimization/solver/util/sparse_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/assert.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/concepts.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/empty.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/function_ref.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/pool.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/print.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/print_diagnostics.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/profiler.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/scope_exit.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/spy.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/include/sleipnir/util/symbol_exports.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/autodiff/bind_gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/autodiff/bind_hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/autodiff/bind_variable.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/autodiff/bind_variable_block.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/autodiff/bind_variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/binders.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/docstrings.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/for_each_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/main.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/bind_ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/slice_tuple.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/try_cast.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/postprocess_stubs.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/src/sleipnir/autodiff/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/src/sleipnir/optimization/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/autodiff/gradient_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/autodiff/hessian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/autodiff/jacobian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/autodiff/variable_matrix_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/autodiff/variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/cart_pole_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/cart_pole_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/cart_pole_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/constraints_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/decision_variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/differential_drive_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/differential_drive_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/differential_drive_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/double_integrator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/flywheel_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/flywheel_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/linear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/multistart_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/near.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/nonlinear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/problem_spy_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/quadratic_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/rk4.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/solver/exit_status_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/test/optimization/trivial_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/autodiff/gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/autodiff/hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/autodiff/jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/autodiff/variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/optimization/ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/optimization/problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/optimization/solver/ipm.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/optimization/solver/newton.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/optimization/solver/sqp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/util/pool.cpp +0 -0
{sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/CMakeLists.txt
RENAMED
|
@@ -345,6 +345,19 @@ if(SLEIPNIR_BUILD_PYTHON)
|
|
|
345
345
|
LIBRARY DESTINATION ${PY_DEST}
|
|
346
346
|
)
|
|
347
347
|
|
|
348
|
+
# py-build-cmake copies the pure Python sources into the wheel itself.
|
|
349
|
+
# Install them for plain CMake installs as well.
|
|
350
|
+
if(NOT DEFINED PY_BUILD_CMAKE_MODULE_NAME)
|
|
351
|
+
install(
|
|
352
|
+
DIRECTORY python/src/sleipnir/
|
|
353
|
+
DESTINATION ${PY_DEST}
|
|
354
|
+
COMPONENT python_modules
|
|
355
|
+
FILES_MATCHING
|
|
356
|
+
PATTERN "*.py"
|
|
357
|
+
PATTERN "__pycache__" EXCLUDE
|
|
358
|
+
)
|
|
359
|
+
endif()
|
|
360
|
+
|
|
348
361
|
# Generate stubs at install time because only the install tree has the
|
|
349
362
|
# sleipnir/ package layout needed to import the module by its fully
|
|
350
363
|
# qualified name `sleipnir._sleipnir`.
|
{sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/pyproject.toml
RENAMED
|
@@ -88,9 +88,11 @@ cache-keys = [
|
|
|
88
88
|
{ file = "include/**" },
|
|
89
89
|
{ file = "pyproject.toml" },
|
|
90
90
|
{ file = "python/cpp/**/*.cpp" },
|
|
91
|
+
{ file = "python/cpp/arity.hpp" },
|
|
91
92
|
{ file = "python/cpp/binders.hpp" },
|
|
92
93
|
{ file = "python/cpp/for_each_type.hpp" },
|
|
93
94
|
{ file = "python/cpp/slice_tuple.hpp" },
|
|
95
|
+
{ file = "python/cpp/text_wrap.hpp" },
|
|
94
96
|
{ file = "python/cpp/try_cast.hpp" },
|
|
95
97
|
{ file = "python/src/**" },
|
|
96
98
|
{ file = "src/**" },
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright (c) Sleipnir contributors
|
|
2
|
+
|
|
3
|
+
#pragma once
|
|
4
|
+
|
|
5
|
+
#include <cstddef>
|
|
6
|
+
#include <type_traits>
|
|
7
|
+
|
|
8
|
+
namespace slp {
|
|
9
|
+
|
|
10
|
+
/// Type implicitly convertible to any type. Used for counting aggregate
|
|
11
|
+
/// members.
|
|
12
|
+
struct AnyType {
|
|
13
|
+
template <typename T>
|
|
14
|
+
// NOLINTNEXTLINE (google-explicit-constructor)
|
|
15
|
+
operator T() const;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/// Returns the number of members in aggregate type T.
|
|
19
|
+
///
|
|
20
|
+
/// @tparam T Aggregate type.
|
|
21
|
+
/// @tparam Args Initializers for the members counted so far.
|
|
22
|
+
template <typename T, typename... Args>
|
|
23
|
+
requires std::is_aggregate_v<T>
|
|
24
|
+
consteval size_t member_count() {
|
|
25
|
+
if constexpr (requires { T{Args{}..., AnyType{}}; }) {
|
|
26
|
+
return member_count<T, Args..., AnyType>();
|
|
27
|
+
} else {
|
|
28
|
+
return sizeof...(Args);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/// Returns the number of parameters of a lambda.
|
|
33
|
+
///
|
|
34
|
+
/// @tparam F Lambda type.
|
|
35
|
+
template <typename F>
|
|
36
|
+
consteval size_t lambda_param_count() {
|
|
37
|
+
return []<typename R, typename C, typename... Args>(R (C::*)(Args...) const) {
|
|
38
|
+
return sizeof...(Args);
|
|
39
|
+
}(&F::operator());
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
} // namespace slp
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// Copyright (c) Sleipnir contributors
|
|
2
|
+
|
|
3
|
+
#include <nanobind/nanobind.h>
|
|
4
|
+
#include <nanobind/stl/function.h>
|
|
5
|
+
|
|
6
|
+
#include <algorithm>
|
|
7
|
+
#include <array>
|
|
8
|
+
#include <chrono>
|
|
9
|
+
#include <cstddef>
|
|
10
|
+
#include <functional>
|
|
11
|
+
#include <ranges>
|
|
12
|
+
#include <stdexcept>
|
|
13
|
+
#include <string>
|
|
14
|
+
#include <string_view>
|
|
15
|
+
#include <utility>
|
|
16
|
+
|
|
17
|
+
#include <sleipnir/autodiff/variable.hpp>
|
|
18
|
+
#include <sleipnir/autodiff/variable_matrix.hpp>
|
|
19
|
+
#include <sleipnir/optimization/problem.hpp>
|
|
20
|
+
#include <sleipnir/optimization/solver/iteration_info.hpp>
|
|
21
|
+
#include <sleipnir/optimization/solver/options.hpp>
|
|
22
|
+
|
|
23
|
+
#include "arity.hpp"
|
|
24
|
+
#include "docstrings.hpp"
|
|
25
|
+
#include "for_each_type.hpp"
|
|
26
|
+
#include "text_wrap.hpp"
|
|
27
|
+
|
|
28
|
+
namespace nb = nanobind;
|
|
29
|
+
|
|
30
|
+
namespace slp {
|
|
31
|
+
|
|
32
|
+
namespace {
|
|
33
|
+
|
|
34
|
+
/// Name and docs of an Options member.
|
|
35
|
+
struct OptionDoc {
|
|
36
|
+
/// Member name, which is also the solve() binding's keyword argument name.
|
|
37
|
+
const char* name;
|
|
38
|
+
|
|
39
|
+
/// Member docs.
|
|
40
|
+
const char* doc;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/// Name and docs of each Options member in declaration order.
|
|
44
|
+
///
|
|
45
|
+
/// See include/sleipnir/optimization/solver/options.hpp.
|
|
46
|
+
constexpr OptionDoc option_docs[] = {
|
|
47
|
+
{"tolerance", DOC(slp, Options, tolerance)},
|
|
48
|
+
{"max_iterations", DOC(slp, Options, max_iterations)},
|
|
49
|
+
{"timeout", DOC(slp, Options, timeout)},
|
|
50
|
+
{"feasible_ipm", DOC(slp, Options, feasible_ipm)},
|
|
51
|
+
{"diagnostics", DOC(slp, Options, diagnostics)}};
|
|
52
|
+
static_assert(member_count<Options>() == std::size(option_docs),
|
|
53
|
+
"Every Options member must be documented here and be a "
|
|
54
|
+
"keyword argument of the solve() binding");
|
|
55
|
+
|
|
56
|
+
/// Returns the Python docstring for Problem.solve().
|
|
57
|
+
///
|
|
58
|
+
/// C++'s Problem<double>::solve() takes an Options object instead of keyword
|
|
59
|
+
/// arguments, so its generated docstring documents a single `options` argument.
|
|
60
|
+
/// This replaces that entry with the docs for each Options member.
|
|
61
|
+
consteval const char* solve_doc() {
|
|
62
|
+
static constexpr auto doc = [] {
|
|
63
|
+
constexpr auto make_doc = [] {
|
|
64
|
+
std::string args;
|
|
65
|
+
for (const auto& [name, option_doc] : option_docs) {
|
|
66
|
+
// The Options member docs were wrapped without the " name: " prefix,
|
|
67
|
+
// so they need to be rewrapped. pybind11_mkdoc's default docstring
|
|
68
|
+
// width is 70.
|
|
69
|
+
args += wrap(std::string{" "} + std::string{name} + ": ", option_doc,
|
|
70
|
+
70);
|
|
71
|
+
args += '\n';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Find the start of the `options` entry
|
|
75
|
+
std::string result = DOC(slp, Problem, solve);
|
|
76
|
+
constexpr std::string_view options_entry = " options: ";
|
|
77
|
+
auto begin = result.find(options_entry);
|
|
78
|
+
if (begin == std::string::npos) {
|
|
79
|
+
throw std::logic_error{
|
|
80
|
+
"Problem::solve() docs have no options argument"};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Find the end of the `options` entry's last line. Each following line
|
|
84
|
+
// indented past the argument names is a continuation of the entry, as are
|
|
85
|
+
// any blank lines before it.
|
|
86
|
+
std::string_view rest = std::string_view{result}.substr(begin);
|
|
87
|
+
auto lines = rest | std::views::split('\n');
|
|
88
|
+
auto entry_end = std::ranges::end(lines.front());
|
|
89
|
+
for (auto line :
|
|
90
|
+
lines | std::views::drop(1) | std::views::take_while([](auto line) {
|
|
91
|
+
return line.empty() || std::string_view{line}.starts_with(" ");
|
|
92
|
+
})) {
|
|
93
|
+
if (!line.empty()) {
|
|
94
|
+
entry_end = line.end();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Include the entry's trailing newline if it has one
|
|
99
|
+
size_t end = entry_end - rest.begin();
|
|
100
|
+
if (entry_end != rest.end()) {
|
|
101
|
+
++end;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Replace the `options` entry with the Options member entries
|
|
105
|
+
result.replace(begin, end, args);
|
|
106
|
+
|
|
107
|
+
return result;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
std::array<char, make_doc().size() + 1> doc;
|
|
111
|
+
std::ranges::copy(make_doc(), doc.begin());
|
|
112
|
+
doc.back() = '\0';
|
|
113
|
+
return doc;
|
|
114
|
+
}();
|
|
115
|
+
|
|
116
|
+
return doc.data();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
} // namespace
|
|
120
|
+
|
|
121
|
+
void bind_problem(nb::class_<Problem<double>>& cls) {
|
|
122
|
+
using namespace nb::literals;
|
|
123
|
+
|
|
124
|
+
cls.def(
|
|
125
|
+
"__init__",
|
|
126
|
+
[](Problem<double>* self) {
|
|
127
|
+
new (self) Problem<double>();
|
|
128
|
+
|
|
129
|
+
// Make Python signals (e.g., SIGINT from Ctrl-C) abort the solve
|
|
130
|
+
self->add_persistent_callback([](const IterationInfo<double>&) -> bool {
|
|
131
|
+
if (PyErr_CheckSignals() != 0) {
|
|
132
|
+
throw nb::python_error();
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
DOC(slp, Problem, Problem));
|
|
138
|
+
cls.def("decision_variable",
|
|
139
|
+
nb::overload_cast<>(&Problem<double>::decision_variable),
|
|
140
|
+
DOC(slp, Problem, decision_variable));
|
|
141
|
+
cls.def("decision_variable",
|
|
142
|
+
nb::overload_cast<int, int>(&Problem<double>::decision_variable),
|
|
143
|
+
"rows"_a, "cols"_a = 1, DOC(slp, Problem, decision_variable, 2));
|
|
144
|
+
cls.def("symmetric_decision_variable",
|
|
145
|
+
&Problem<double>::symmetric_decision_variable, "rows"_a,
|
|
146
|
+
DOC(slp, Problem, symmetric_decision_variable));
|
|
147
|
+
for_each_type<double, const Variable<double>&, const VariableMatrix<double>&>(
|
|
148
|
+
[&]<typename T> {
|
|
149
|
+
cls.def(
|
|
150
|
+
"minimize",
|
|
151
|
+
[](Problem<double>& self, T cost) { self.minimize(cost); },
|
|
152
|
+
"cost"_a, DOC(slp, Problem, minimize));
|
|
153
|
+
cls.def(
|
|
154
|
+
"maximize",
|
|
155
|
+
[](Problem<double>& self, T objective) {
|
|
156
|
+
self.maximize(objective);
|
|
157
|
+
},
|
|
158
|
+
"objective"_a, DOC(slp, Problem, maximize));
|
|
159
|
+
});
|
|
160
|
+
cls.def("subject_to",
|
|
161
|
+
nb::overload_cast<const EqualityConstraints<double>&>(
|
|
162
|
+
&Problem<double>::subject_to),
|
|
163
|
+
"constraint"_a, DOC(slp, Problem, subject_to));
|
|
164
|
+
cls.def("subject_to",
|
|
165
|
+
nb::overload_cast<const InequalityConstraints<double>&>(
|
|
166
|
+
&Problem<double>::subject_to),
|
|
167
|
+
"constraint"_a, DOC(slp, Problem, subject_to, 3));
|
|
168
|
+
cls.def("cost_function_type", &Problem<double>::cost_function_type,
|
|
169
|
+
DOC(slp, Problem, cost_function_type));
|
|
170
|
+
cls.def("equality_constraint_type",
|
|
171
|
+
&Problem<double>::equality_constraint_type,
|
|
172
|
+
DOC(slp, Problem, equality_constraint_type));
|
|
173
|
+
cls.def("inequality_constraint_type",
|
|
174
|
+
&Problem<double>::inequality_constraint_type,
|
|
175
|
+
DOC(slp, Problem, inequality_constraint_type));
|
|
176
|
+
|
|
177
|
+
// Maps Python's Problem.solve(**kwargs) to
|
|
178
|
+
// C++'s Problem::solve(Options, bool)
|
|
179
|
+
constexpr auto solve = [](Problem<double>& self, double tolerance,
|
|
180
|
+
int max_iterations, double timeout,
|
|
181
|
+
bool feasible_ipm, bool diagnostics, bool spy) {
|
|
182
|
+
return self.solve({.tolerance = tolerance,
|
|
183
|
+
.max_iterations = max_iterations,
|
|
184
|
+
.timeout = std::chrono::duration<double>{timeout},
|
|
185
|
+
.feasible_ipm = feasible_ipm,
|
|
186
|
+
.diagnostics = diagnostics},
|
|
187
|
+
spy);
|
|
188
|
+
};
|
|
189
|
+
static_assert(
|
|
190
|
+
lambda_param_count<decltype(solve)>() == 1 + member_count<Options>() + 1,
|
|
191
|
+
"Every Options member must be a keyword argument of the solve() binding");
|
|
192
|
+
|
|
193
|
+
cls.def("solve", solve, nb::kw_only(),
|
|
194
|
+
nb::arg(option_docs[0].name) = Options{}.tolerance,
|
|
195
|
+
nb::arg(option_docs[1].name) = Options{}.max_iterations,
|
|
196
|
+
// nanobind renders defaults in signatures and stubs via repr(), and
|
|
197
|
+
// repr(float("inf")) is "inf", which isn't valid Python. Override the
|
|
198
|
+
// displayed default with sig().
|
|
199
|
+
nb::arg(option_docs[2].name).sig("float('inf')") =
|
|
200
|
+
Options{}.timeout.count(),
|
|
201
|
+
nb::arg(option_docs[3].name) = Options{}.feasible_ipm,
|
|
202
|
+
nb::arg(option_docs[4].name) = Options{}.diagnostics, "spy"_a = false,
|
|
203
|
+
solve_doc());
|
|
204
|
+
|
|
205
|
+
cls.def(
|
|
206
|
+
"add_callback",
|
|
207
|
+
[](Problem<double>& self,
|
|
208
|
+
std::function<bool(const IterationInfo<double>& info)> callback) {
|
|
209
|
+
self.add_callback(std::move(callback));
|
|
210
|
+
},
|
|
211
|
+
"callback"_a, DOC(slp, Problem, add_callback, 2));
|
|
212
|
+
cls.def("clear_callbacks", &Problem<double>::clear_callbacks,
|
|
213
|
+
DOC(slp, Problem, clear_callbacks));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
} // namespace slp
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright (c) Sleipnir contributors
|
|
2
|
+
|
|
3
|
+
#pragma once
|
|
4
|
+
|
|
5
|
+
#include <algorithm>
|
|
6
|
+
#include <cstddef>
|
|
7
|
+
#include <string>
|
|
8
|
+
#include <string_view>
|
|
9
|
+
|
|
10
|
+
namespace slp {
|
|
11
|
+
|
|
12
|
+
/// Returns the number of columns a UTF-8 string occupies.
|
|
13
|
+
///
|
|
14
|
+
/// @param text UTF-8 string.
|
|
15
|
+
constexpr size_t display_width(std::string_view text) {
|
|
16
|
+
// Count bytes that aren't continuation bytes, since each code point has
|
|
17
|
+
// exactly one. We assume a code point is one column wide. See
|
|
18
|
+
// https://www.rfc-editor.org/rfc/rfc3629#section-3.
|
|
19
|
+
//
|
|
20
|
+
// A continuation byte's top two bits are 0b10, so keep only those bits and
|
|
21
|
+
// count the bytes where they're something else.
|
|
22
|
+
return static_cast<size_t>(std::ranges::count_if(
|
|
23
|
+
text, [](char c) { return (c & 0b11000000) != 0b10000000; }));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// Word wraps text to the given width.
|
|
27
|
+
///
|
|
28
|
+
/// Paragraphs are separated by blank lines, and the line breaks within each
|
|
29
|
+
/// paragraph are replaced. Continuation lines are indented by the prefix's
|
|
30
|
+
/// width so they align with the text after the prefix, like a Google-style
|
|
31
|
+
/// docstring argument entry. Words longer than the width aren't split.
|
|
32
|
+
///
|
|
33
|
+
/// @param prefix String placed before the first line.
|
|
34
|
+
/// @param text UTF-8 text to wrap.
|
|
35
|
+
/// @param width Maximum line width in columns, including the indentation.
|
|
36
|
+
/// @return Wrapped text without a trailing newline.
|
|
37
|
+
constexpr std::string wrap(std::string_view prefix, std::string_view text,
|
|
38
|
+
size_t width) {
|
|
39
|
+
constexpr std::string_view whitespace = " \n";
|
|
40
|
+
const size_t indent = display_width(prefix);
|
|
41
|
+
|
|
42
|
+
std::string wrapped{prefix};
|
|
43
|
+
size_t column = indent;
|
|
44
|
+
|
|
45
|
+
// Greedily fill lines. Append each word to the current line if it fits, or
|
|
46
|
+
// start a new line indented to align with the text after the prefix.
|
|
47
|
+
size_t end = 0;
|
|
48
|
+
for (size_t begin = text.find_first_not_of(whitespace);
|
|
49
|
+
begin != std::string_view::npos;
|
|
50
|
+
begin = text.find_first_not_of(whitespace, end)) {
|
|
51
|
+
// Find the whitespace since the previous word
|
|
52
|
+
std::string_view gap = text.substr(end, begin - end);
|
|
53
|
+
|
|
54
|
+
// Find the current word
|
|
55
|
+
end = std::min(text.find_first_of(whitespace, begin), text.size());
|
|
56
|
+
std::string_view word = text.substr(begin, end - begin);
|
|
57
|
+
const size_t word_width = display_width(word);
|
|
58
|
+
|
|
59
|
+
if (wrapped.size() == prefix.size()) {
|
|
60
|
+
// Put the first word right after the prefix without a leading space
|
|
61
|
+
} else if (gap.contains("\n\n")) {
|
|
62
|
+
// Separate paragraphs with a blank line
|
|
63
|
+
wrapped += "\n\n";
|
|
64
|
+
wrapped.append(indent, ' ');
|
|
65
|
+
column = indent;
|
|
66
|
+
} else if (column + 1 + word_width > width) {
|
|
67
|
+
// The space and word would overflow, so put the word on the next line
|
|
68
|
+
wrapped += '\n';
|
|
69
|
+
wrapped.append(indent, ' ');
|
|
70
|
+
column = indent;
|
|
71
|
+
} else {
|
|
72
|
+
// The space and word fit, so put the word on the current line
|
|
73
|
+
wrapped += ' ';
|
|
74
|
+
++column;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
wrapped += word;
|
|
78
|
+
column += word_width;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return wrapped;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
} // namespace slp
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Sleipnir contributors
|
|
2
|
-
|
|
3
|
-
#include <nanobind/nanobind.h>
|
|
4
|
-
#include <nanobind/stl/function.h>
|
|
5
|
-
|
|
6
|
-
#include <chrono>
|
|
7
|
-
#include <format>
|
|
8
|
-
#include <functional>
|
|
9
|
-
#include <string>
|
|
10
|
-
#include <utility>
|
|
11
|
-
|
|
12
|
-
#include <sleipnir/autodiff/variable.hpp>
|
|
13
|
-
#include <sleipnir/autodiff/variable_matrix.hpp>
|
|
14
|
-
#include <sleipnir/optimization/problem.hpp>
|
|
15
|
-
#include <sleipnir/optimization/solver/iteration_info.hpp>
|
|
16
|
-
#include <sleipnir/optimization/solver/options.hpp>
|
|
17
|
-
|
|
18
|
-
#include "docstrings.hpp"
|
|
19
|
-
#include "for_each_type.hpp"
|
|
20
|
-
|
|
21
|
-
namespace nb = nanobind;
|
|
22
|
-
|
|
23
|
-
namespace slp {
|
|
24
|
-
|
|
25
|
-
void bind_problem(nb::class_<Problem<double>>& cls) {
|
|
26
|
-
using namespace nb::literals;
|
|
27
|
-
|
|
28
|
-
cls.def(
|
|
29
|
-
"__init__",
|
|
30
|
-
[](Problem<double>* self) {
|
|
31
|
-
new (self) Problem<double>();
|
|
32
|
-
|
|
33
|
-
// Make Python signals (e.g., SIGINT from Ctrl-C) abort the solve
|
|
34
|
-
self->add_persistent_callback([](const IterationInfo<double>&) -> bool {
|
|
35
|
-
if (PyErr_CheckSignals() != 0) {
|
|
36
|
-
throw nb::python_error();
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
DOC(slp, Problem, Problem));
|
|
42
|
-
cls.def("decision_variable",
|
|
43
|
-
nb::overload_cast<>(&Problem<double>::decision_variable),
|
|
44
|
-
DOC(slp, Problem, decision_variable));
|
|
45
|
-
cls.def("decision_variable",
|
|
46
|
-
nb::overload_cast<int, int>(&Problem<double>::decision_variable),
|
|
47
|
-
"rows"_a, "cols"_a = 1, DOC(slp, Problem, decision_variable, 2));
|
|
48
|
-
cls.def("symmetric_decision_variable",
|
|
49
|
-
&Problem<double>::symmetric_decision_variable, "rows"_a,
|
|
50
|
-
DOC(slp, Problem, symmetric_decision_variable));
|
|
51
|
-
for_each_type<double, const Variable<double>&, const VariableMatrix<double>&>(
|
|
52
|
-
[&]<typename T> {
|
|
53
|
-
cls.def(
|
|
54
|
-
"minimize",
|
|
55
|
-
[](Problem<double>& self, T cost) { self.minimize(cost); },
|
|
56
|
-
"cost"_a, DOC(slp, Problem, minimize));
|
|
57
|
-
cls.def(
|
|
58
|
-
"maximize",
|
|
59
|
-
[](Problem<double>& self, T objective) {
|
|
60
|
-
self.maximize(objective);
|
|
61
|
-
},
|
|
62
|
-
"objective"_a, DOC(slp, Problem, maximize));
|
|
63
|
-
});
|
|
64
|
-
cls.def("subject_to",
|
|
65
|
-
nb::overload_cast<const EqualityConstraints<double>&>(
|
|
66
|
-
&Problem<double>::subject_to),
|
|
67
|
-
"constraint"_a, DOC(slp, Problem, subject_to));
|
|
68
|
-
cls.def("subject_to",
|
|
69
|
-
nb::overload_cast<const InequalityConstraints<double>&>(
|
|
70
|
-
&Problem<double>::subject_to),
|
|
71
|
-
"constraint"_a, DOC(slp, Problem, subject_to, 3));
|
|
72
|
-
cls.def("cost_function_type", &Problem<double>::cost_function_type,
|
|
73
|
-
DOC(slp, Problem, cost_function_type));
|
|
74
|
-
cls.def("equality_constraint_type",
|
|
75
|
-
&Problem<double>::equality_constraint_type,
|
|
76
|
-
DOC(slp, Problem, equality_constraint_type));
|
|
77
|
-
cls.def("inequality_constraint_type",
|
|
78
|
-
&Problem<double>::inequality_constraint_type,
|
|
79
|
-
DOC(slp, Problem, inequality_constraint_type));
|
|
80
|
-
cls.def(
|
|
81
|
-
"solve",
|
|
82
|
-
[](Problem<double>& self, const nb::kwargs& kwargs) {
|
|
83
|
-
Options options;
|
|
84
|
-
bool spy = false;
|
|
85
|
-
|
|
86
|
-
for (auto [key, value] : kwargs) {
|
|
87
|
-
// XXX: The keyword arguments are manually copied from the struct
|
|
88
|
-
// members in include/sleipnir/optimization/solver/options.hpp.
|
|
89
|
-
//
|
|
90
|
-
// C++'s Problem<double>::solve() takes an Options object instead of
|
|
91
|
-
// keyword arguments, so there's no compile-time checking that the
|
|
92
|
-
// arguments match.
|
|
93
|
-
auto key_str = nb::cast<std::string>(key);
|
|
94
|
-
if (key_str == "tolerance") {
|
|
95
|
-
options.tolerance = nb::cast<double>(value);
|
|
96
|
-
} else if (key_str == "max_iterations") {
|
|
97
|
-
options.max_iterations = nb::cast<int>(value);
|
|
98
|
-
} else if (key_str == "timeout") {
|
|
99
|
-
options.timeout =
|
|
100
|
-
std::chrono::duration<double>{nb::cast<double>(value)};
|
|
101
|
-
} else if (key_str == "feasible_ipm") {
|
|
102
|
-
options.feasible_ipm = nb::cast<bool>(value);
|
|
103
|
-
} else if (key_str == "diagnostics") {
|
|
104
|
-
options.diagnostics = nb::cast<bool>(value);
|
|
105
|
-
} else if (key_str == "spy") {
|
|
106
|
-
spy = nb::cast<bool>(value);
|
|
107
|
-
} else {
|
|
108
|
-
throw nb::key_error(
|
|
109
|
-
std::format("Invalid keyword argument: {}", key_str).c_str());
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return self.solve(options, spy);
|
|
114
|
-
},
|
|
115
|
-
// XXX: The keyword argument docs are manually copied from the struct
|
|
116
|
-
// member docs in include/sleipnir/optimization/solver/options.hpp.
|
|
117
|
-
//
|
|
118
|
-
// C++'s Problem<double>::solve() takes an Options object instead of
|
|
119
|
-
// keyword arguments, so pybind11_mkdoc generates the wrong docs.
|
|
120
|
-
R"doc(Solves the optimization problem. The solution will be stored in the
|
|
121
|
-
original variables used to construct the problem.
|
|
122
|
-
|
|
123
|
-
Args:
|
|
124
|
-
tolerance: The solver will stop once the error is below this tolerance.
|
|
125
|
-
(default: 1e-8)
|
|
126
|
-
max_iterations: The maximum number of solver iterations before returning a
|
|
127
|
-
solution. (default: 5000)
|
|
128
|
-
timeout: The maximum elapsed wall clock time before returning a solution.
|
|
129
|
-
(default: infinity)
|
|
130
|
-
feasible_ipm: Enables the feasible interior-point method.
|
|
131
|
-
|
|
132
|
-
When the inequality constraints are all feasible, step sizes are reduced
|
|
133
|
-
when necessary to prevent them becoming infeasible again. This is useful
|
|
134
|
-
when parts of the problem are ill-conditioned in infeasible regions
|
|
135
|
-
(e.g., square root of a negative value). This can slow or prevent
|
|
136
|
-
progress toward a solution though, so only enable it if necessary.
|
|
137
|
-
(default: False)
|
|
138
|
-
diagnostics: Enables diagnostic output.
|
|
139
|
-
|
|
140
|
-
See https://sleipnirgroup.github.io/Sleipnir/md_usage.html#output for
|
|
141
|
-
more information. (default: False)
|
|
142
|
-
spy: Enables writing sparsity patterns of H, Aₑ, and Aᵢ to files named
|
|
143
|
-
H.spy, A_e.spy, and A_i.spy respectively during solve. Use tools/spy.py
|
|
144
|
-
to plot them. (default: False))doc");
|
|
145
|
-
cls.def(
|
|
146
|
-
"add_callback",
|
|
147
|
-
[](Problem<double>& self,
|
|
148
|
-
std::function<bool(const IterationInfo<double>& info)> callback) {
|
|
149
|
-
self.add_callback(std::move(callback));
|
|
150
|
-
},
|
|
151
|
-
"callback"_a, DOC(slp, Problem, add_callback, 2));
|
|
152
|
-
cls.def("clear_callbacks", &Problem<double>::clear_callbacks,
|
|
153
|
-
DOC(slp, Problem, clear_callbacks));
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
} // namespace slp
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/python/cpp/main.cpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sleipnirgroup_jormungandr-0.6.7.dev60 → sleipnirgroup_jormungandr-0.6.7.dev62}/src/util/pool.cpp
RENAMED
|
File without changes
|