sleipnirgroup-jormungandr 0.6.6.dev33__tar.gz → 0.6.7.dev1__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.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/CMakeLists.txt +2 -2
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/PKG-INFO +1 -1
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/expression.hpp +75 -78
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/expression_graph.hpp +6 -6
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/variable_matrix.hpp +6 -6
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/src/sleipnir/__init__.py +1 -1
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/LICENSE.txt +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/README.md +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/SleipnirConfig.cmake.in +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/cmake/BuildTypes.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/cmake/CompilerFlags.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/cmake/Pybind11Mkdoc.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/cmake/SubdirList.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/cmake/arm-none-eabi.cmake +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/expression_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/gradient.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/hessian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/jacobian.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/sleipnir_base.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/slice.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/variable.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/autodiff/variable_block.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/multistart.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/ocp/dynamics_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/ocp/timestep_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/ocp/transcription_method.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/ocp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/problem.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/exit_status.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/ipm.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/ipm_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/iteration_info.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/newton.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/newton_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/options.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/sqp.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/sqp_matrix_callbacks.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/all_finite.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/append_as_triplets.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/bounds.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/dense_regularized_ldlt.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/feasibility_restoration.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/filter.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/fraction_to_the_boundary_rule.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/inertia.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/kkt_error.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/lagrange_multiplier_estimate.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/problem_scaling.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/regularized_ldlt.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/sparse_inf_norms.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/optimization/solver/util/sparse_regularized_ldlt.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/assert.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/concepts.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/empty.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/function_ref.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/intrusive_shared_ptr.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/pool.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/print.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/print_diagnostics.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/profiler.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/scope_exit.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/spy.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/include/sleipnir/util/symbol_exports.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/pyproject.toml +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/autodiff/bind_expression_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/autodiff/bind_gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/autodiff/bind_hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/autodiff/bind_jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/autodiff/bind_variable.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/autodiff/bind_variable_block.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/autodiff/bind_variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/binders.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/docstrings.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/for_each_type.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/main.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/bind_equality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/bind_inequality_constraints.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/bind_ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/bind_problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/ocp/bind_dynamics_type.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/ocp/bind_timestep_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/ocp/bind_transcription_method.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/solver/bind_exit_status.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/optimization/solver/bind_iteration_info.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/cpp/try_cast.hpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/src/sleipnir/autodiff/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/src/sleipnir/optimization/__init__.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/autodiff/gradient_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/autodiff/hessian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/autodiff/jacobian_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/autodiff/variable_matrix_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/autodiff/variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/arm_on_elevator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/cart_pole_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/cart_pole_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/cart_pole_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/constraints_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/decision_variable_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/differential_drive_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/differential_drive_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/differential_drive_util.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/double_integrator_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/flywheel_ocp_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/flywheel_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/linear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/multistart_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/nonlinear_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/problem_spy_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/quadratic_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/rk4.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/solver/exit_status_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/python/test/optimization/trivial_problem_test.py +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/autodiff/gradient.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/autodiff/hessian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/autodiff/jacobian.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/autodiff/variable_matrix.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/optimization/ocp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/optimization/problem.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/optimization/solver/ipm.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/optimization/solver/newton.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/optimization/solver/sqp.cpp +0 -0
- {sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/util/pool.cpp +0 -0
{sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/CMakeLists.txt
RENAMED
|
@@ -77,8 +77,8 @@ if(NOT SLEIPNIR_USE_SYSTEM_EIGEN)
|
|
|
77
77
|
FetchContent_Declare(
|
|
78
78
|
Eigen3
|
|
79
79
|
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
|
|
80
|
-
# master on 2026-
|
|
81
|
-
GIT_TAG
|
|
80
|
+
# master on 2026-09-05
|
|
81
|
+
GIT_TAG 406f412fa43706c60c678b04ed30338e6c93503d
|
|
82
82
|
SYSTEM
|
|
83
83
|
)
|
|
84
84
|
FetchContent_MakeAvailable(Eigen3)
|
|
@@ -94,11 +94,11 @@ struct Expression {
|
|
|
94
94
|
Scalar val{0};
|
|
95
95
|
|
|
96
96
|
/// The adjoint of the expression node, used during autodiff.
|
|
97
|
-
Scalar
|
|
97
|
+
Scalar adj{0};
|
|
98
98
|
|
|
99
99
|
/// The adjoint of the expression node, used during gradient expression tree
|
|
100
100
|
/// generation.
|
|
101
|
-
ExpressionPtr<Scalar>
|
|
101
|
+
ExpressionPtr<Scalar> adj_expr;
|
|
102
102
|
|
|
103
103
|
/// Expression arguments.
|
|
104
104
|
std::array<ExpressionPtr<Scalar>, 2> args{nullptr, nullptr};
|
|
@@ -456,20 +456,20 @@ struct BinaryMinusExpression final : Expression<Scalar> {
|
|
|
456
456
|
|
|
457
457
|
std::string_view name() const override { return "binary minus"; }
|
|
458
458
|
|
|
459
|
-
Scalar grad_l(Scalar, Scalar) const override { return this->
|
|
459
|
+
Scalar grad_l(Scalar, Scalar) const override { return this->adj; }
|
|
460
460
|
|
|
461
|
-
Scalar grad_r(Scalar, Scalar) const override { return -this->
|
|
461
|
+
Scalar grad_r(Scalar, Scalar) const override { return -this->adj; }
|
|
462
462
|
|
|
463
463
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
464
464
|
const ExpressionPtr<Scalar>&,
|
|
465
465
|
const ExpressionPtr<Scalar>&) const override {
|
|
466
|
-
return this->
|
|
466
|
+
return this->adj_expr;
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
470
470
|
const ExpressionPtr<Scalar>&,
|
|
471
471
|
const ExpressionPtr<Scalar>&) const override {
|
|
472
|
-
return -this->
|
|
472
|
+
return -this->adj_expr;
|
|
473
473
|
}
|
|
474
474
|
};
|
|
475
475
|
|
|
@@ -493,20 +493,20 @@ struct BinaryPlusExpression final : Expression<Scalar> {
|
|
|
493
493
|
|
|
494
494
|
std::string_view name() const override { return "binary plus"; }
|
|
495
495
|
|
|
496
|
-
Scalar grad_l(Scalar, Scalar) const override { return this->
|
|
496
|
+
Scalar grad_l(Scalar, Scalar) const override { return this->adj; }
|
|
497
497
|
|
|
498
|
-
Scalar grad_r(Scalar, Scalar) const override { return this->
|
|
498
|
+
Scalar grad_r(Scalar, Scalar) const override { return this->adj; }
|
|
499
499
|
|
|
500
500
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
501
501
|
const ExpressionPtr<Scalar>&,
|
|
502
502
|
const ExpressionPtr<Scalar>&) const override {
|
|
503
|
-
return this->
|
|
503
|
+
return this->adj_expr;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
507
507
|
const ExpressionPtr<Scalar>&,
|
|
508
508
|
const ExpressionPtr<Scalar>&) const override {
|
|
509
|
-
return this->
|
|
509
|
+
return this->adj_expr;
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
512
|
|
|
@@ -534,14 +534,14 @@ struct CbrtExpression final : Expression<Scalar> {
|
|
|
534
534
|
using std::cbrt;
|
|
535
535
|
|
|
536
536
|
Scalar c = cbrt(x);
|
|
537
|
-
return this->
|
|
537
|
+
return this->adj / (Scalar(3) * c * c);
|
|
538
538
|
}
|
|
539
539
|
|
|
540
540
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
541
541
|
const ExpressionPtr<Scalar>& x,
|
|
542
542
|
const ExpressionPtr<Scalar>&) const override {
|
|
543
543
|
auto c = cbrt(x);
|
|
544
|
-
return this->
|
|
544
|
+
return this->adj_expr / (constant_ptr(Scalar(3)) * c * c);
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
547
|
|
|
@@ -627,24 +627,22 @@ struct DivExpression final : Expression<Scalar> {
|
|
|
627
627
|
|
|
628
628
|
std::string_view name() const override { return "division"; }
|
|
629
629
|
|
|
630
|
-
Scalar grad_l(Scalar, Scalar rhs) const override {
|
|
631
|
-
return this->adjoint / rhs;
|
|
632
|
-
};
|
|
630
|
+
Scalar grad_l(Scalar, Scalar rhs) const override { return this->adj / rhs; };
|
|
633
631
|
|
|
634
632
|
Scalar grad_r(Scalar lhs, Scalar rhs) const override {
|
|
635
|
-
return this->
|
|
633
|
+
return this->adj * -lhs / (rhs * rhs);
|
|
636
634
|
}
|
|
637
635
|
|
|
638
636
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
639
637
|
const ExpressionPtr<Scalar>&,
|
|
640
638
|
const ExpressionPtr<Scalar>& rhs) const override {
|
|
641
|
-
return this->
|
|
639
|
+
return this->adj_expr / rhs;
|
|
642
640
|
}
|
|
643
641
|
|
|
644
642
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
645
643
|
const ExpressionPtr<Scalar>& lhs,
|
|
646
644
|
const ExpressionPtr<Scalar>& rhs) const override {
|
|
647
|
-
return this->
|
|
645
|
+
return this->adj_expr * -lhs / (rhs * rhs);
|
|
648
646
|
}
|
|
649
647
|
};
|
|
650
648
|
|
|
@@ -668,23 +666,23 @@ struct MultExpression final : Expression<Scalar> {
|
|
|
668
666
|
std::string_view name() const override { return "multiplication"; }
|
|
669
667
|
|
|
670
668
|
Scalar grad_l([[maybe_unused]] Scalar lhs, Scalar rhs) const override {
|
|
671
|
-
return this->
|
|
669
|
+
return this->adj * rhs;
|
|
672
670
|
}
|
|
673
671
|
|
|
674
672
|
Scalar grad_r(Scalar lhs, [[maybe_unused]] Scalar rhs) const override {
|
|
675
|
-
return this->
|
|
673
|
+
return this->adj * lhs;
|
|
676
674
|
}
|
|
677
675
|
|
|
678
676
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
679
677
|
[[maybe_unused]] const ExpressionPtr<Scalar>& lhs,
|
|
680
678
|
const ExpressionPtr<Scalar>& rhs) const override {
|
|
681
|
-
return this->
|
|
679
|
+
return this->adj_expr * rhs;
|
|
682
680
|
}
|
|
683
681
|
|
|
684
682
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
685
683
|
const ExpressionPtr<Scalar>& lhs,
|
|
686
684
|
[[maybe_unused]] const ExpressionPtr<Scalar>& rhs) const override {
|
|
687
|
-
return this->
|
|
685
|
+
return this->adj_expr * lhs;
|
|
688
686
|
}
|
|
689
687
|
};
|
|
690
688
|
|
|
@@ -706,12 +704,12 @@ struct UnaryMinusExpression final : Expression<Scalar> {
|
|
|
706
704
|
|
|
707
705
|
std::string_view name() const override { return "unary minus"; }
|
|
708
706
|
|
|
709
|
-
Scalar grad_l(Scalar, Scalar) const override { return -this->
|
|
707
|
+
Scalar grad_l(Scalar, Scalar) const override { return -this->adj; }
|
|
710
708
|
|
|
711
709
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
712
710
|
const ExpressionPtr<Scalar>&,
|
|
713
711
|
const ExpressionPtr<Scalar>&) const override {
|
|
714
|
-
return -this->
|
|
712
|
+
return -this->adj_expr;
|
|
715
713
|
}
|
|
716
714
|
};
|
|
717
715
|
|
|
@@ -744,8 +742,8 @@ constexpr void dec_ref_count(Expression<Scalar>* expr) {
|
|
|
744
742
|
// Decrement the current node's refcount. If it reaches zero, deallocate the
|
|
745
743
|
// node and enqueue its children so their refcounts are decremented too.
|
|
746
744
|
if (--elem->ref_count == 0) {
|
|
747
|
-
if (elem->
|
|
748
|
-
stack.emplace_back(elem->
|
|
745
|
+
if (elem->adj_expr != nullptr) {
|
|
746
|
+
stack.emplace_back(elem->adj_expr.get());
|
|
749
747
|
}
|
|
750
748
|
for (auto& arg : elem->args) {
|
|
751
749
|
if (arg != nullptr) {
|
|
@@ -788,9 +786,9 @@ struct AbsExpression final : Expression<Scalar> {
|
|
|
788
786
|
|
|
789
787
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
790
788
|
if (x < Scalar(0)) {
|
|
791
|
-
return -this->
|
|
789
|
+
return -this->adj;
|
|
792
790
|
} else if (x > Scalar(0)) {
|
|
793
|
-
return this->
|
|
791
|
+
return this->adj;
|
|
794
792
|
} else {
|
|
795
793
|
return Scalar(0);
|
|
796
794
|
}
|
|
@@ -799,7 +797,7 @@ struct AbsExpression final : Expression<Scalar> {
|
|
|
799
797
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
800
798
|
const ExpressionPtr<Scalar>& x,
|
|
801
799
|
const ExpressionPtr<Scalar>&) const override {
|
|
802
|
-
return this->
|
|
800
|
+
return this->adj_expr * sign(x);
|
|
803
801
|
}
|
|
804
802
|
};
|
|
805
803
|
|
|
@@ -848,13 +846,13 @@ struct AcosExpression final : Expression<Scalar> {
|
|
|
848
846
|
|
|
849
847
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
850
848
|
using std::sqrt;
|
|
851
|
-
return -this->
|
|
849
|
+
return -this->adj / sqrt(Scalar(1) - x * x);
|
|
852
850
|
}
|
|
853
851
|
|
|
854
852
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
855
853
|
const ExpressionPtr<Scalar>& x,
|
|
856
854
|
const ExpressionPtr<Scalar>&) const override {
|
|
857
|
-
return -this->
|
|
855
|
+
return -this->adj_expr / sqrt(constant_ptr(Scalar(1)) - x * x);
|
|
858
856
|
}
|
|
859
857
|
};
|
|
860
858
|
|
|
@@ -902,13 +900,13 @@ struct AsinExpression final : Expression<Scalar> {
|
|
|
902
900
|
|
|
903
901
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
904
902
|
using std::sqrt;
|
|
905
|
-
return this->
|
|
903
|
+
return this->adj / sqrt(Scalar(1) - x * x);
|
|
906
904
|
}
|
|
907
905
|
|
|
908
906
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
909
907
|
const ExpressionPtr<Scalar>& x,
|
|
910
908
|
const ExpressionPtr<Scalar>&) const override {
|
|
911
|
-
return this->
|
|
909
|
+
return this->adj_expr / sqrt(constant_ptr(Scalar(1)) - x * x);
|
|
912
910
|
}
|
|
913
911
|
};
|
|
914
912
|
|
|
@@ -956,13 +954,13 @@ struct AtanExpression final : Expression<Scalar> {
|
|
|
956
954
|
std::string_view name() const override { return "atan"; }
|
|
957
955
|
|
|
958
956
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
959
|
-
return this->
|
|
957
|
+
return this->adj / (Scalar(1) + x * x);
|
|
960
958
|
}
|
|
961
959
|
|
|
962
960
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
963
961
|
const ExpressionPtr<Scalar>& x,
|
|
964
962
|
const ExpressionPtr<Scalar>&) const override {
|
|
965
|
-
return this->
|
|
963
|
+
return this->adj_expr / (constant_ptr(Scalar(1)) + x * x);
|
|
966
964
|
}
|
|
967
965
|
};
|
|
968
966
|
|
|
@@ -1012,23 +1010,23 @@ struct Atan2Expression final : Expression<Scalar> {
|
|
|
1012
1010
|
std::string_view name() const override { return "atan2"; }
|
|
1013
1011
|
|
|
1014
1012
|
Scalar grad_l(Scalar y, Scalar x) const override {
|
|
1015
|
-
return this->
|
|
1013
|
+
return this->adj * x / (y * y + x * x);
|
|
1016
1014
|
}
|
|
1017
1015
|
|
|
1018
1016
|
Scalar grad_r(Scalar y, Scalar x) const override {
|
|
1019
|
-
return this->
|
|
1017
|
+
return this->adj * -y / (y * y + x * x);
|
|
1020
1018
|
}
|
|
1021
1019
|
|
|
1022
1020
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1023
1021
|
const ExpressionPtr<Scalar>& y,
|
|
1024
1022
|
const ExpressionPtr<Scalar>& x) const override {
|
|
1025
|
-
return this->
|
|
1023
|
+
return this->adj_expr * x / (y * y + x * x);
|
|
1026
1024
|
}
|
|
1027
1025
|
|
|
1028
1026
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
1029
1027
|
const ExpressionPtr<Scalar>& y,
|
|
1030
1028
|
const ExpressionPtr<Scalar>& x) const override {
|
|
1031
|
-
return this->
|
|
1029
|
+
return this->adj_expr * -y / (y * y + x * x);
|
|
1032
1030
|
}
|
|
1033
1031
|
};
|
|
1034
1032
|
|
|
@@ -1073,13 +1071,13 @@ struct CosExpression final : Expression<Scalar> {
|
|
|
1073
1071
|
|
|
1074
1072
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1075
1073
|
using std::sin;
|
|
1076
|
-
return this->
|
|
1074
|
+
return this->adj * -sin(x);
|
|
1077
1075
|
}
|
|
1078
1076
|
|
|
1079
1077
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1080
1078
|
const ExpressionPtr<Scalar>& x,
|
|
1081
1079
|
const ExpressionPtr<Scalar>&) const override {
|
|
1082
|
-
return this->
|
|
1080
|
+
return this->adj_expr * -sin(x);
|
|
1083
1081
|
}
|
|
1084
1082
|
};
|
|
1085
1083
|
|
|
@@ -1127,13 +1125,13 @@ struct CoshExpression final : Expression<Scalar> {
|
|
|
1127
1125
|
|
|
1128
1126
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1129
1127
|
using std::sinh;
|
|
1130
|
-
return this->
|
|
1128
|
+
return this->adj * sinh(x);
|
|
1131
1129
|
}
|
|
1132
1130
|
|
|
1133
1131
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1134
1132
|
const ExpressionPtr<Scalar>& x,
|
|
1135
1133
|
const ExpressionPtr<Scalar>&) const override {
|
|
1136
|
-
return this->
|
|
1134
|
+
return this->adj_expr * sinh(x);
|
|
1137
1135
|
}
|
|
1138
1136
|
};
|
|
1139
1137
|
|
|
@@ -1181,13 +1179,13 @@ struct ErfExpression final : Expression<Scalar> {
|
|
|
1181
1179
|
|
|
1182
1180
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1183
1181
|
using std::exp;
|
|
1184
|
-
return this->
|
|
1182
|
+
return this->adj * Scalar(2.0 * std::numbers::inv_sqrtpi) * exp(-x * x);
|
|
1185
1183
|
}
|
|
1186
1184
|
|
|
1187
1185
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1188
1186
|
const ExpressionPtr<Scalar>& x,
|
|
1189
1187
|
const ExpressionPtr<Scalar>&) const override {
|
|
1190
|
-
return this->
|
|
1188
|
+
return this->adj_expr *
|
|
1191
1189
|
constant_ptr(Scalar(2.0 * std::numbers::inv_sqrtpi)) * exp(-x * x);
|
|
1192
1190
|
}
|
|
1193
1191
|
};
|
|
@@ -1237,13 +1235,13 @@ struct ExpExpression final : Expression<Scalar> {
|
|
|
1237
1235
|
|
|
1238
1236
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1239
1237
|
using std::exp;
|
|
1240
|
-
return this->
|
|
1238
|
+
return this->adj * exp(x);
|
|
1241
1239
|
}
|
|
1242
1240
|
|
|
1243
1241
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1244
1242
|
const ExpressionPtr<Scalar>& x,
|
|
1245
1243
|
const ExpressionPtr<Scalar>&) const override {
|
|
1246
|
-
return this->
|
|
1244
|
+
return this->adj_expr * exp(x);
|
|
1247
1245
|
}
|
|
1248
1246
|
};
|
|
1249
1247
|
|
|
@@ -1297,24 +1295,24 @@ struct HypotExpression final : Expression<Scalar> {
|
|
|
1297
1295
|
|
|
1298
1296
|
Scalar grad_l(Scalar x, Scalar y) const override {
|
|
1299
1297
|
using std::hypot;
|
|
1300
|
-
return this->
|
|
1298
|
+
return this->adj * x / hypot(x, y);
|
|
1301
1299
|
}
|
|
1302
1300
|
|
|
1303
1301
|
Scalar grad_r(Scalar x, Scalar y) const override {
|
|
1304
1302
|
using std::hypot;
|
|
1305
|
-
return this->
|
|
1303
|
+
return this->adj * y / hypot(x, y);
|
|
1306
1304
|
}
|
|
1307
1305
|
|
|
1308
1306
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1309
1307
|
const ExpressionPtr<Scalar>& x,
|
|
1310
1308
|
const ExpressionPtr<Scalar>& y) const override {
|
|
1311
|
-
return this->
|
|
1309
|
+
return this->adj_expr * x / hypot(x, y);
|
|
1312
1310
|
}
|
|
1313
1311
|
|
|
1314
1312
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
1315
1313
|
const ExpressionPtr<Scalar>& x,
|
|
1316
1314
|
const ExpressionPtr<Scalar>& y) const override {
|
|
1317
|
-
return this->
|
|
1315
|
+
return this->adj_expr * y / hypot(x, y);
|
|
1318
1316
|
}
|
|
1319
1317
|
};
|
|
1320
1318
|
|
|
@@ -1430,12 +1428,12 @@ struct LogExpression final : Expression<Scalar> {
|
|
|
1430
1428
|
|
|
1431
1429
|
std::string_view name() const override { return "log"; }
|
|
1432
1430
|
|
|
1433
|
-
Scalar grad_l(Scalar x, Scalar) const override { return this->
|
|
1431
|
+
Scalar grad_l(Scalar x, Scalar) const override { return this->adj / x; }
|
|
1434
1432
|
|
|
1435
1433
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1436
1434
|
const ExpressionPtr<Scalar>& x,
|
|
1437
1435
|
const ExpressionPtr<Scalar>&) const override {
|
|
1438
|
-
return this->
|
|
1436
|
+
return this->adj_expr / x;
|
|
1439
1437
|
}
|
|
1440
1438
|
};
|
|
1441
1439
|
|
|
@@ -1483,13 +1481,13 @@ struct Log10Expression final : Expression<Scalar> {
|
|
|
1483
1481
|
std::string_view name() const override { return "log10"; }
|
|
1484
1482
|
|
|
1485
1483
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1486
|
-
return this->
|
|
1484
|
+
return this->adj / (Scalar(std::numbers::ln10) * x);
|
|
1487
1485
|
}
|
|
1488
1486
|
|
|
1489
1487
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1490
1488
|
const ExpressionPtr<Scalar>& x,
|
|
1491
1489
|
const ExpressionPtr<Scalar>&) const override {
|
|
1492
|
-
return this->
|
|
1490
|
+
return this->adj_expr / (constant_ptr(Scalar(std::numbers::ln10)) * x);
|
|
1493
1491
|
}
|
|
1494
1492
|
};
|
|
1495
1493
|
|
|
@@ -1540,11 +1538,11 @@ struct MaxExpression final : Expression<Scalar> {
|
|
|
1540
1538
|
std::string_view name() const override { return "max"; }
|
|
1541
1539
|
|
|
1542
1540
|
Scalar grad_l(Scalar a, Scalar b) const override {
|
|
1543
|
-
return a >= b ? this->
|
|
1541
|
+
return a >= b ? this->adj : Scalar(0);
|
|
1544
1542
|
}
|
|
1545
1543
|
|
|
1546
1544
|
Scalar grad_r(Scalar a, Scalar b) const override {
|
|
1547
|
-
return a >= b ? Scalar(0) : this->
|
|
1545
|
+
return a >= b ? Scalar(0) : this->adj;
|
|
1548
1546
|
}
|
|
1549
1547
|
|
|
1550
1548
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
@@ -1552,7 +1550,7 @@ struct MaxExpression final : Expression<Scalar> {
|
|
|
1552
1550
|
const ExpressionPtr<Scalar>& b) const override {
|
|
1553
1551
|
// adjoint * (a >= b)
|
|
1554
1552
|
// adjoint * (a - b >= 0)
|
|
1555
|
-
return this->
|
|
1553
|
+
return this->adj_expr * is_nonnegative(a - b);
|
|
1556
1554
|
}
|
|
1557
1555
|
|
|
1558
1556
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
@@ -1562,7 +1560,7 @@ struct MaxExpression final : Expression<Scalar> {
|
|
|
1562
1560
|
// adjoint * (a < b)
|
|
1563
1561
|
// adjoint * (b > a)
|
|
1564
1562
|
// adjoint * (b - a > 0)
|
|
1565
|
-
return this->
|
|
1563
|
+
return this->adj_expr * is_positive(b - a);
|
|
1566
1564
|
}
|
|
1567
1565
|
};
|
|
1568
1566
|
|
|
@@ -1609,12 +1607,12 @@ struct MinExpression final : Expression<Scalar> {
|
|
|
1609
1607
|
std::string_view name() const override { return "min"; }
|
|
1610
1608
|
|
|
1611
1609
|
Scalar grad_l(Scalar a, Scalar b) const override {
|
|
1612
|
-
return a <= b ? this->
|
|
1610
|
+
return a <= b ? this->adj : Scalar(0);
|
|
1613
1611
|
}
|
|
1614
1612
|
|
|
1615
1613
|
Scalar grad_r([[maybe_unused]] Scalar a,
|
|
1616
1614
|
[[maybe_unused]] Scalar b) const override {
|
|
1617
|
-
return a <= b ? Scalar(0) : this->
|
|
1615
|
+
return a <= b ? Scalar(0) : this->adj;
|
|
1618
1616
|
}
|
|
1619
1617
|
|
|
1620
1618
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
@@ -1623,7 +1621,7 @@ struct MinExpression final : Expression<Scalar> {
|
|
|
1623
1621
|
// adjoint * (a <= b)
|
|
1624
1622
|
// adjoint * (b >= a)
|
|
1625
1623
|
// adjoint * (b - a >= 0)
|
|
1626
|
-
return this->
|
|
1624
|
+
return this->adj_expr * is_nonnegative(b - a);
|
|
1627
1625
|
}
|
|
1628
1626
|
|
|
1629
1627
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
@@ -1632,7 +1630,7 @@ struct MinExpression final : Expression<Scalar> {
|
|
|
1632
1630
|
// adjoint * !(a <= b)
|
|
1633
1631
|
// adjoint * (a > b)
|
|
1634
1632
|
// adjoint * (a - b > 0)
|
|
1635
|
-
return this->
|
|
1633
|
+
return this->adj_expr * is_positive(a - b);
|
|
1636
1634
|
}
|
|
1637
1635
|
};
|
|
1638
1636
|
|
|
@@ -1683,27 +1681,26 @@ struct PowExpression final : Expression<Scalar> {
|
|
|
1683
1681
|
|
|
1684
1682
|
Scalar grad_l(Scalar base, Scalar power) const override {
|
|
1685
1683
|
using std::pow;
|
|
1686
|
-
return this->
|
|
1684
|
+
return this->adj * pow(base, power - Scalar(1)) * power;
|
|
1687
1685
|
}
|
|
1688
1686
|
|
|
1689
1687
|
Scalar grad_r(Scalar base, Scalar power) const override {
|
|
1690
1688
|
using std::log;
|
|
1691
1689
|
using std::pow;
|
|
1692
1690
|
|
|
1693
|
-
return this->
|
|
1691
|
+
return this->adj * pow(base, power) * log(base);
|
|
1694
1692
|
}
|
|
1695
1693
|
|
|
1696
1694
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1697
1695
|
const ExpressionPtr<Scalar>& base,
|
|
1698
1696
|
const ExpressionPtr<Scalar>& power) const override {
|
|
1699
|
-
return this->
|
|
1700
|
-
power;
|
|
1697
|
+
return this->adj_expr * pow(base, power - constant_ptr(Scalar(1))) * power;
|
|
1701
1698
|
}
|
|
1702
1699
|
|
|
1703
1700
|
ExpressionPtr<Scalar> grad_expr_r(
|
|
1704
1701
|
const ExpressionPtr<Scalar>& base,
|
|
1705
1702
|
const ExpressionPtr<Scalar>& power) const override {
|
|
1706
|
-
return this->
|
|
1703
|
+
return this->adj_expr * pow(base, power) * log(base);
|
|
1707
1704
|
}
|
|
1708
1705
|
};
|
|
1709
1706
|
|
|
@@ -1820,13 +1817,13 @@ struct SinExpression final : Expression<Scalar> {
|
|
|
1820
1817
|
|
|
1821
1818
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1822
1819
|
using std::cos;
|
|
1823
|
-
return this->
|
|
1820
|
+
return this->adj * cos(x);
|
|
1824
1821
|
}
|
|
1825
1822
|
|
|
1826
1823
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1827
1824
|
const ExpressionPtr<Scalar>& x,
|
|
1828
1825
|
const ExpressionPtr<Scalar>&) const override {
|
|
1829
|
-
return this->
|
|
1826
|
+
return this->adj_expr * cos(x);
|
|
1830
1827
|
}
|
|
1831
1828
|
};
|
|
1832
1829
|
|
|
@@ -1875,13 +1872,13 @@ struct SinhExpression final : Expression<Scalar> {
|
|
|
1875
1872
|
|
|
1876
1873
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1877
1874
|
using std::cosh;
|
|
1878
|
-
return this->
|
|
1875
|
+
return this->adj * cosh(x);
|
|
1879
1876
|
}
|
|
1880
1877
|
|
|
1881
1878
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1882
1879
|
const ExpressionPtr<Scalar>& x,
|
|
1883
1880
|
const ExpressionPtr<Scalar>&) const override {
|
|
1884
|
-
return this->
|
|
1881
|
+
return this->adj_expr * cosh(x);
|
|
1885
1882
|
}
|
|
1886
1883
|
};
|
|
1887
1884
|
|
|
@@ -1930,13 +1927,13 @@ struct SqrtExpression final : Expression<Scalar> {
|
|
|
1930
1927
|
|
|
1931
1928
|
Scalar grad_l(Scalar x, Scalar) const override {
|
|
1932
1929
|
using std::sqrt;
|
|
1933
|
-
return this->
|
|
1930
|
+
return this->adj / (Scalar(2) * sqrt(x));
|
|
1934
1931
|
}
|
|
1935
1932
|
|
|
1936
1933
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1937
1934
|
const ExpressionPtr<Scalar>& x,
|
|
1938
1935
|
const ExpressionPtr<Scalar>&) const override {
|
|
1939
|
-
return this->
|
|
1936
|
+
return this->adj_expr / (constant_ptr(Scalar(2)) * sqrt(x));
|
|
1940
1937
|
}
|
|
1941
1938
|
};
|
|
1942
1939
|
|
|
@@ -1988,14 +1985,14 @@ struct TanExpression final : Expression<Scalar> {
|
|
|
1988
1985
|
using std::cos;
|
|
1989
1986
|
|
|
1990
1987
|
auto c = cos(x);
|
|
1991
|
-
return this->
|
|
1988
|
+
return this->adj / (c * c);
|
|
1992
1989
|
}
|
|
1993
1990
|
|
|
1994
1991
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
1995
1992
|
const ExpressionPtr<Scalar>& x,
|
|
1996
1993
|
const ExpressionPtr<Scalar>&) const override {
|
|
1997
1994
|
auto c = cos(x);
|
|
1998
|
-
return this->
|
|
1995
|
+
return this->adj_expr / (c * c);
|
|
1999
1996
|
}
|
|
2000
1997
|
};
|
|
2001
1998
|
|
|
@@ -2046,14 +2043,14 @@ struct TanhExpression final : Expression<Scalar> {
|
|
|
2046
2043
|
using std::cosh;
|
|
2047
2044
|
|
|
2048
2045
|
auto c = cosh(x);
|
|
2049
|
-
return this->
|
|
2046
|
+
return this->adj / (c * c);
|
|
2050
2047
|
}
|
|
2051
2048
|
|
|
2052
2049
|
ExpressionPtr<Scalar> grad_expr_l(
|
|
2053
2050
|
const ExpressionPtr<Scalar>& x,
|
|
2054
2051
|
const ExpressionPtr<Scalar>&) const override {
|
|
2055
2052
|
auto c = cosh(x);
|
|
2056
|
-
return this->
|
|
2053
|
+
return this->adj_expr / (c * c);
|
|
2057
2054
|
}
|
|
2058
2055
|
};
|
|
2059
2056
|
|
|
@@ -117,11 +117,11 @@ void append_triplets(
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// Set root node's adjoint to 1 since df/df is 1
|
|
120
|
-
top_list[0]->
|
|
120
|
+
top_list[0]->adj = Scalar(1);
|
|
121
121
|
|
|
122
122
|
// Zero the rest of the adjoints
|
|
123
123
|
for (auto& node : top_list | std::views::drop(1)) {
|
|
124
|
-
node->
|
|
124
|
+
node->adj = Scalar(0);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
// df/dx = (df/dy)(dy/dx). The adjoint of x is equal to the adjoint of y
|
|
@@ -135,11 +135,11 @@ void append_triplets(
|
|
|
135
135
|
if (lhs != nullptr) {
|
|
136
136
|
if (rhs != nullptr) {
|
|
137
137
|
// Binary operator
|
|
138
|
-
lhs->
|
|
139
|
-
rhs->
|
|
138
|
+
lhs->adj += node->grad_l(lhs->val, rhs->val);
|
|
139
|
+
rhs->adj += node->grad_r(lhs->val, rhs->val);
|
|
140
140
|
} else {
|
|
141
141
|
// Unary operator
|
|
142
|
-
lhs->
|
|
142
|
+
lhs->adj += node->grad_l(lhs->val, Scalar(0));
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -148,7 +148,7 @@ void append_triplets(
|
|
|
148
148
|
// appear in the expression graph
|
|
149
149
|
for (const auto& [col, node] : output_list) {
|
|
150
150
|
// Append adjoints of wrt to sparse matrix triplets
|
|
151
|
-
triplets.emplace_back(row, col, node->
|
|
151
|
+
triplets.emplace_back(row, col, node->adj);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -1773,7 +1773,7 @@ VariableMatrix<Scalar> gradient_tree(const ExpressionGraph<Scalar>& top_list,
|
|
|
1773
1773
|
}
|
|
1774
1774
|
|
|
1775
1775
|
// Set root node's adjoint to 1 since df/df is 1
|
|
1776
|
-
top_list[0]->
|
|
1776
|
+
top_list[0]->adj_expr = constant_ptr(Scalar(1));
|
|
1777
1777
|
|
|
1778
1778
|
// df/dx = (df/dy)(dy/dx). The adjoint of x is equal to the adjoint of y
|
|
1779
1779
|
// multiplied by dy/dx. If there are multiple "paths" from the root node to
|
|
@@ -1786,11 +1786,11 @@ VariableMatrix<Scalar> gradient_tree(const ExpressionGraph<Scalar>& top_list,
|
|
|
1786
1786
|
if (lhs != nullptr) {
|
|
1787
1787
|
if (rhs != nullptr) {
|
|
1788
1788
|
// Binary operator
|
|
1789
|
-
lhs->
|
|
1790
|
-
rhs->
|
|
1789
|
+
lhs->adj_expr += node->grad_expr_l(lhs, rhs);
|
|
1790
|
+
rhs->adj_expr += node->grad_expr_r(lhs, rhs);
|
|
1791
1791
|
} else {
|
|
1792
1792
|
// Unary operator
|
|
1793
|
-
lhs->
|
|
1793
|
+
lhs->adj_expr += node->grad_expr_l(lhs, rhs);
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
@@ -1798,14 +1798,14 @@ VariableMatrix<Scalar> gradient_tree(const ExpressionGraph<Scalar>& top_list,
|
|
|
1798
1798
|
// Move gradient tree to return value
|
|
1799
1799
|
VariableMatrix<Scalar> grad{detail::empty, wrt.rows(), 1};
|
|
1800
1800
|
for (int row = 0; row < grad.rows(); ++row) {
|
|
1801
|
-
grad[row] = Variable{std::move(wrt[row].expr->
|
|
1801
|
+
grad[row] = Variable{std::move(wrt[row].expr->adj_expr)};
|
|
1802
1802
|
}
|
|
1803
1803
|
|
|
1804
1804
|
// Unlink adjoints to avoid circular references between them and their
|
|
1805
1805
|
// parent expressions. This ensures all expressions are returned to the free
|
|
1806
1806
|
// list.
|
|
1807
1807
|
for (auto& node : top_list) {
|
|
1808
|
-
node->
|
|
1808
|
+
node->adj_expr = nullptr;
|
|
1809
1809
|
}
|
|
1810
1810
|
|
|
1811
1811
|
return grad;
|
|
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.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/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
|
|
File without changes
|
{sleipnirgroup_jormungandr-0.6.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/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.6.dev33 → sleipnirgroup_jormungandr-0.6.7.dev1}/src/util/pool.cpp
RENAMED
|
File without changes
|