sleipnirgroup-jormungandr 0.6.7.dev14__tar.gz → 0.6.7.dev16__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.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/CMakeLists.txt +3 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/PKG-INFO +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/expression.hpp +95 -67
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/variable.hpp +25 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/docstrings.hpp +19 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/src/sleipnir/__init__.py +1 -1
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/LICENSE.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/README.md +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/SleipnirConfig.cmake.in +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/cmake/BuildTypes.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/cmake/CompilerFlags.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/cmake/Pybind11Mkdoc.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/cmake/SubdirList.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/cmake/arm-none-eabi.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/expression_graph.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/expression_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/gradient.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/hessian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/jacobian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/slice.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/variable_block.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/autodiff/variable_matrix.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/multistart.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/ocp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/problem.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/ipm.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/iteration_info.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/newton.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/options.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/sqp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/dense_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/filter.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/inertia.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/kkt_error.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/lagrange_multiplier_estimate.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/optimization/solver/util/sparse_kkt_solver.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/assert.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/concepts.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/empty.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/function_ref.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/pool.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/print.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/print_diagnostics.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/profiler.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/scope_exit.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/spy.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/include/sleipnir/util/symbol_exports.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/pyproject.toml +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/autodiff/bind_gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/autodiff/bind_hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/autodiff/bind_variable.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/autodiff/bind_variable_block.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/autodiff/bind_variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/binders.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/for_each_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/main.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/bind_ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/bind_problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/cpp/try_cast.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/src/sleipnir/autodiff/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/src/sleipnir/optimization/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/autodiff/gradient_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/autodiff/hessian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/autodiff/jacobian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/autodiff/variable_matrix_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/autodiff/variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/cart_pole_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/cart_pole_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/cart_pole_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/constraints_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/decision_variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/differential_drive_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/differential_drive_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/differential_drive_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/double_integrator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/flywheel_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/flywheel_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/linear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/multistart_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/nonlinear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/problem_spy_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/quadratic_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/rk4.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/solver/exit_status_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/python/test/optimization/trivial_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/autodiff/gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/autodiff/hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/autodiff/jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/autodiff/variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/optimization/ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/optimization/problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/optimization/solver/ipm.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/optimization/solver/newton.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/optimization/solver/sqp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/util/pool.cpp +0 -0
{sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/CMakeLists.txt
RENAMED
|
@@ -111,6 +111,9 @@ if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING AND NOT CMAKE_CROSSCOMPILING)
|
|
|
111
111
|
SYSTEM
|
|
112
112
|
)
|
|
113
113
|
FetchContent_MakeAvailable(Catch2)
|
|
114
|
+
|
|
115
|
+
# Enable StringMaker<std::string_view>
|
|
116
|
+
target_compile_features(Catch2 PRIVATE cxx_std_23)
|
|
114
117
|
endif()
|
|
115
118
|
|
|
116
119
|
install(
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#include <memory>
|
|
10
10
|
#include <numbers>
|
|
11
11
|
#include <string_view>
|
|
12
|
+
#include <type_traits>
|
|
12
13
|
#include <utility>
|
|
13
14
|
|
|
14
15
|
#include <gch/small_vector.hpp>
|
|
@@ -1559,86 +1560,117 @@ ExpressionPtr<Scalar> hypot(const ExpressionPtr<Scalar>& x,
|
|
|
1559
1560
|
return make_expression_ptr<Hypot3Expression<Scalar>>(x, y, z);
|
|
1560
1561
|
}
|
|
1561
1562
|
|
|
1562
|
-
/// Derived expression type for
|
|
1563
|
+
/// Derived expression type for if_else().
|
|
1564
|
+
///
|
|
1565
|
+
/// Returns t if cond(a, b) is true, otherwise f.
|
|
1563
1566
|
///
|
|
1564
1567
|
/// @tparam Scalar Scalar type.
|
|
1565
1568
|
template <typename Scalar>
|
|
1566
|
-
struct
|
|
1567
|
-
///
|
|
1568
|
-
|
|
1569
|
+
struct IfElseExpression final : Expression<Scalar> {
|
|
1570
|
+
/// Condition evaluated on a and b.
|
|
1571
|
+
bool (*cond)(Scalar a, Scalar b);
|
|
1569
1572
|
|
|
1570
|
-
///
|
|
1573
|
+
/// The condition's first argument.
|
|
1574
|
+
ExpressionPtr<Scalar> a;
|
|
1575
|
+
|
|
1576
|
+
/// The condition's second argument.
|
|
1577
|
+
ExpressionPtr<Scalar> b;
|
|
1578
|
+
|
|
1579
|
+
/// Value selected when cond(a, b) is true.
|
|
1580
|
+
ExpressionPtr<Scalar> t;
|
|
1581
|
+
|
|
1582
|
+
/// Value selected when cond(a, b) is false.
|
|
1583
|
+
ExpressionPtr<Scalar> f;
|
|
1584
|
+
|
|
1585
|
+
/// Constructs an if-else expression.
|
|
1571
1586
|
///
|
|
1572
|
-
/// @param
|
|
1573
|
-
|
|
1574
|
-
|
|
1587
|
+
/// @param cond Condition evaluated on a and b.
|
|
1588
|
+
/// @param a The condition's first argument.
|
|
1589
|
+
/// @param b The condition's second argument.
|
|
1590
|
+
/// @param t Value selected when cond(a, b) is true.
|
|
1591
|
+
/// @param f Value selected when cond(a, b) is false.
|
|
1592
|
+
constexpr IfElseExpression(bool (*cond)(Scalar a, Scalar b),
|
|
1593
|
+
ExpressionPtr<Scalar> a, ExpressionPtr<Scalar> b,
|
|
1594
|
+
ExpressionPtr<Scalar> t, ExpressionPtr<Scalar> f)
|
|
1595
|
+
: cond{cond},
|
|
1596
|
+
a{std::move(a)},
|
|
1597
|
+
b{std::move(b)},
|
|
1598
|
+
t{std::move(t)},
|
|
1599
|
+
f{std::move(f)} {}
|
|
1575
1600
|
|
|
1576
1601
|
void visit_args(
|
|
1577
1602
|
function_ref<void(Expression<Scalar>* arg)> func) const override {
|
|
1578
|
-
func(
|
|
1603
|
+
func(a.get());
|
|
1604
|
+
func(b.get());
|
|
1605
|
+
func(t.get());
|
|
1606
|
+
func(f.get());
|
|
1579
1607
|
}
|
|
1580
1608
|
|
|
1581
1609
|
Scalar value() const override {
|
|
1582
|
-
return
|
|
1610
|
+
return cond(a->val, b->val) ? t->val : f->val;
|
|
1583
1611
|
}
|
|
1584
1612
|
|
|
1585
1613
|
ExpressionType type() const override { return ExpressionType::NONLINEAR; }
|
|
1586
1614
|
|
|
1587
|
-
std::string_view name() const override { return "
|
|
1588
|
-
};
|
|
1615
|
+
std::string_view name() const override { return "if-else"; }
|
|
1589
1616
|
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
return constant_ptr(x->val >= Scalar(0) ? Scalar(1) : Scalar(0));
|
|
1617
|
+
// a and b have zero gradient, so only t and f accumulate adjoints
|
|
1618
|
+
void accumulate_adjoints() const override {
|
|
1619
|
+
if (cond(a->val, b->val)) {
|
|
1620
|
+
t->adj += this->adj;
|
|
1621
|
+
} else {
|
|
1622
|
+
f->adj += this->adj;
|
|
1623
|
+
}
|
|
1598
1624
|
}
|
|
1599
1625
|
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
/// Derived expression type for is_positive().
|
|
1604
|
-
///
|
|
1605
|
-
/// @tparam Scalar Scalar type.
|
|
1606
|
-
template <typename Scalar>
|
|
1607
|
-
struct IsPositiveExpression final : Expression<Scalar> {
|
|
1608
|
-
/// Unary operator's operand.
|
|
1609
|
-
ExpressionPtr<Scalar> x;
|
|
1610
|
-
|
|
1611
|
-
/// Constructs an unary expression (an operator with one argument).
|
|
1612
|
-
///
|
|
1613
|
-
/// @param x Unary operator's operand.
|
|
1614
|
-
explicit constexpr IsPositiveExpression(ExpressionPtr<Scalar> x)
|
|
1615
|
-
: x{std::move(x)} {}
|
|
1616
|
-
|
|
1617
|
-
void visit_args(
|
|
1618
|
-
function_ref<void(Expression<Scalar>* arg)> func) const override {
|
|
1619
|
-
func(x.get());
|
|
1626
|
+
void accumulate_adjoints_expr() const override {
|
|
1627
|
+
t->adj_expr += grad_expr_t();
|
|
1628
|
+
f->adj_expr += grad_expr_f();
|
|
1620
1629
|
}
|
|
1621
1630
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1631
|
+
private:
|
|
1632
|
+
ExpressionPtr<Scalar> grad_expr_t() const {
|
|
1633
|
+
// adjoint if cond(a, b), otherwise 0
|
|
1634
|
+
return if_else(cond, a, b, this->adj_expr, constant_ptr(Scalar(0)));
|
|
1624
1635
|
}
|
|
1625
1636
|
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1637
|
+
ExpressionPtr<Scalar> grad_expr_f() const {
|
|
1638
|
+
// 0 if cond(a, b), otherwise adjoint
|
|
1639
|
+
return if_else(cond, a, b, constant_ptr(Scalar(0)), this->adj_expr);
|
|
1640
|
+
}
|
|
1629
1641
|
};
|
|
1630
1642
|
|
|
1631
|
-
/// Returns
|
|
1643
|
+
/// Returns t if cond(a, b) is true, otherwise f.
|
|
1632
1644
|
///
|
|
1633
1645
|
/// @tparam Scalar Scalar type.
|
|
1634
|
-
/// @param
|
|
1646
|
+
/// @param cond Condition evaluated on a and b.
|
|
1647
|
+
/// @param a The condition's first argument.
|
|
1648
|
+
/// @param b The condition's second argument.
|
|
1649
|
+
/// @param t Value selected when cond(a, b) is true.
|
|
1650
|
+
/// @param f Value selected when cond(a, b) is false.
|
|
1635
1651
|
template <typename Scalar>
|
|
1636
|
-
ExpressionPtr<Scalar>
|
|
1637
|
-
|
|
1638
|
-
|
|
1652
|
+
ExpressionPtr<Scalar> if_else(
|
|
1653
|
+
std::type_identity_t<bool (*)(Scalar a, Scalar b)> cond,
|
|
1654
|
+
const ExpressionPtr<Scalar>& a, const ExpressionPtr<Scalar>& b,
|
|
1655
|
+
const ExpressionPtr<Scalar>& t, const ExpressionPtr<Scalar>& f) {
|
|
1656
|
+
using enum ExpressionType;
|
|
1657
|
+
|
|
1658
|
+
// Prune expression
|
|
1659
|
+
if (t == f) {
|
|
1660
|
+
// Return t, which both branches currently are
|
|
1661
|
+
return t;
|
|
1662
|
+
} else if (t->type() == CONSTANT && f->type() == CONSTANT &&
|
|
1663
|
+
t->val == f->val) {
|
|
1664
|
+
// Return t, which both branches currently equal
|
|
1665
|
+
return t;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
// Evaluate constant condition
|
|
1669
|
+
if (a->type() == CONSTANT && b->type() == CONSTANT) {
|
|
1670
|
+
return cond(a->val, b->val) ? t : f;
|
|
1639
1671
|
}
|
|
1640
1672
|
|
|
1641
|
-
return make_expression_ptr<
|
|
1673
|
+
return make_expression_ptr<IfElseExpression<Scalar>>(cond, a, b, t, f);
|
|
1642
1674
|
}
|
|
1643
1675
|
|
|
1644
1676
|
/// Derived expression type for log().
|
|
@@ -1821,17 +1853,15 @@ struct MaxExpression final : Expression<Scalar> {
|
|
|
1821
1853
|
Scalar grad_r() const { return a->val >= b->val ? Scalar(0) : this->adj; }
|
|
1822
1854
|
|
|
1823
1855
|
ExpressionPtr<Scalar> grad_expr_l() const {
|
|
1824
|
-
// adjoint
|
|
1825
|
-
|
|
1826
|
-
|
|
1856
|
+
// adjoint if a >= b, otherwise 0
|
|
1857
|
+
return if_else([](Scalar a, Scalar b) { return a >= b; }, a, b,
|
|
1858
|
+
this->adj_expr, constant_ptr(Scalar(0)));
|
|
1827
1859
|
}
|
|
1828
1860
|
|
|
1829
1861
|
ExpressionPtr<Scalar> grad_expr_r() const {
|
|
1830
|
-
//
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
// adjoint * (b - a > 0)
|
|
1834
|
-
return this->adj_expr * is_positive(b - a);
|
|
1862
|
+
// 0 if a >= b, otherwise adjoint
|
|
1863
|
+
return if_else([](Scalar a, Scalar b) { return a >= b; }, a, b,
|
|
1864
|
+
constant_ptr(Scalar(0)), this->adj_expr);
|
|
1835
1865
|
}
|
|
1836
1866
|
};
|
|
1837
1867
|
|
|
@@ -1905,17 +1935,15 @@ struct MinExpression final : Expression<Scalar> {
|
|
|
1905
1935
|
Scalar grad_r() const { return a->val <= b->val ? Scalar(0) : this->adj; }
|
|
1906
1936
|
|
|
1907
1937
|
ExpressionPtr<Scalar> grad_expr_l() const {
|
|
1908
|
-
// adjoint
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
return this->adj_expr * is_nonnegative(b - a);
|
|
1938
|
+
// adjoint if a <= b, otherwise 0
|
|
1939
|
+
return if_else([](Scalar a, Scalar b) { return a <= b; }, a, b,
|
|
1940
|
+
this->adj_expr, constant_ptr(Scalar(0)));
|
|
1912
1941
|
}
|
|
1913
1942
|
|
|
1914
1943
|
ExpressionPtr<Scalar> grad_expr_r() const {
|
|
1915
|
-
//
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
return this->adj_expr * is_positive(a - b);
|
|
1944
|
+
// 0 if a <= b, otherwise adjoint
|
|
1945
|
+
return if_else([](Scalar a, Scalar b) { return a <= b; }, a, b,
|
|
1946
|
+
constant_ptr(Scalar(0)), this->adj_expr);
|
|
1919
1947
|
}
|
|
1920
1948
|
};
|
|
1921
1949
|
|
|
@@ -313,6 +313,11 @@ class Variable : public SleipnirBase {
|
|
|
313
313
|
friend Variable<Scalar> hypot(const Variable<Scalar>& x,
|
|
314
314
|
const Variable<Scalar>& y);
|
|
315
315
|
template <typename Scalar>
|
|
316
|
+
friend Variable<Scalar> if_else(
|
|
317
|
+
std::type_identity_t<bool (*)(Scalar a, Scalar b)> cond,
|
|
318
|
+
const Variable<Scalar>& a, const Variable<Scalar>& b,
|
|
319
|
+
const Variable<Scalar>& t, const Variable<Scalar>& f);
|
|
320
|
+
template <typename Scalar>
|
|
316
321
|
friend Variable<Scalar> log(const Variable<Scalar>& x);
|
|
317
322
|
template <typename Scalar>
|
|
318
323
|
friend Variable<Scalar> log10(const Variable<Scalar>& x);
|
|
@@ -522,6 +527,26 @@ Variable<Scalar> hypot(const Variable<Scalar>& x, const Variable<Scalar>& y) {
|
|
|
522
527
|
return Variable{detail::hypot(x.expr, y.expr)};
|
|
523
528
|
}
|
|
524
529
|
|
|
530
|
+
/// if_else() for Variables.
|
|
531
|
+
///
|
|
532
|
+
/// Returns t if cond(a, b) is true, otherwise f. The condition is evaluated on
|
|
533
|
+
/// the values of a and b each time the result is evaluated, and the gradient
|
|
534
|
+
/// only flows through the selected branch.
|
|
535
|
+
///
|
|
536
|
+
/// @tparam Scalar Scalar type.
|
|
537
|
+
/// @param cond Condition evaluated on a and b.
|
|
538
|
+
/// @param a The condition's first argument.
|
|
539
|
+
/// @param b The condition's second argument.
|
|
540
|
+
/// @param t Value selected when cond(a, b) is true.
|
|
541
|
+
/// @param f Value selected when cond(a, b) is false.
|
|
542
|
+
template <typename Scalar>
|
|
543
|
+
Variable<Scalar> if_else(
|
|
544
|
+
std::type_identity_t<bool (*)(Scalar a, Scalar b)> cond,
|
|
545
|
+
const Variable<Scalar>& a, const Variable<Scalar>& b,
|
|
546
|
+
const Variable<Scalar>& t, const Variable<Scalar>& f) {
|
|
547
|
+
return Variable{detail::if_else(cond, a.expr, b.expr, t.expr, f.expr)};
|
|
548
|
+
}
|
|
549
|
+
|
|
525
550
|
/// log() for Variables.
|
|
526
551
|
///
|
|
527
552
|
/// @tparam Scalar Scalar type.
|
|
@@ -2811,6 +2811,25 @@ Template Args:
|
|
|
2811
2811
|
|
|
2812
2812
|
)doc";
|
|
2813
2813
|
|
|
2814
|
+
static const char *mkd_doc_slp_if_else =
|
|
2815
|
+
R"doc(if_else() for Variables.
|
|
2816
|
+
|
|
2817
|
+
Returns t if cond(a, b) is true, otherwise f. The condition is
|
|
2818
|
+
evaluated on the values of a and b each time the result is evaluated,
|
|
2819
|
+
and the gradient only flows through the selected branch.
|
|
2820
|
+
|
|
2821
|
+
Args:
|
|
2822
|
+
cond: Condition evaluated on a and b.
|
|
2823
|
+
a: The condition's first argument.
|
|
2824
|
+
b: The condition's second argument.
|
|
2825
|
+
t: Value selected when cond(a, b) is true.
|
|
2826
|
+
f: Value selected when cond(a, b) is false.
|
|
2827
|
+
|
|
2828
|
+
Template Args:
|
|
2829
|
+
Scalar: Scalar type.
|
|
2830
|
+
|
|
2831
|
+
)doc";
|
|
2832
|
+
|
|
2814
2833
|
static const char *mkd_doc_slp_log =
|
|
2815
2834
|
R"doc(log() for Variables.
|
|
2816
2835
|
|
|
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.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/pyproject.toml
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
|
{sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/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
|
{sleipnirgroup_jormungandr-0.6.7.dev14 → sleipnirgroup_jormungandr-0.6.7.dev16}/src/util/pool.cpp
RENAMED
|
File without changes
|