|
Mundy: Multibody Nonlocal Dynamics Version of the Day
|
A forward-mode automatic-differentiation scalar: carries a value and its derivatives. More...
Classes | |
| class | mundy::AutoDiffScalar< T, N > |
| A forward-mode autodiff scalar over passive real type T with N tracked derivatives. More... | |
| struct | mundy::NumTraits< AutoDiffScalar< T, N > > |
| Numeric traits for AutoDiffScalar. Numeric values come from the passive type; the related types remain differentiable. More... | |
| struct | mundy::ScalarBinaryOpTraits< AutoDiffScalar< T, N >, T, Op > |
| An AutoDiffScalar combined with its passive type yields an AutoDiffScalar (either order). More... | |
| struct | mundy::ScalarBinaryOpTraits< T, AutoDiffScalar< T, N >, Op > |
Namespaces | |
| namespace | mundy |
Functions | |
Passive-value arithmetic (passive op AutoDiffScalar) | |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::operator+ (const T &s, const AutoDiffScalar< T, N > &a) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::operator- (const T &s, const AutoDiffScalar< T, N > &a) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::operator* (const T &s, const AutoDiffScalar< T, N > &a) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::operator/ (const T &s, const AutoDiffScalar< T, N > &a) |
Comparisons (by value) | |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator== (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator!= (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator< (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator<= (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator> (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator>= (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator== (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator!= (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator< (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator<= (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator> (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator>= (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator== (const T &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator!= (const T &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator< (const T &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator<= (const T &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator> (const T &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr bool | mundy::operator>= (const T &a, const AutoDiffScalar< T, N > &b) |
Math overloads (value via the mundy:: dispatch, derivative via the chain rule) | |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::sqrt (const AutoDiffScalar< T, N > &x) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::exp (const AutoDiffScalar< T, N > &x) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::log (const AutoDiffScalar< T, N > &x) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::sin (const AutoDiffScalar< T, N > &x) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::cos (const AutoDiffScalar< T, N > &x) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::acos (const AutoDiffScalar< T, N > &x) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::abs (const AutoDiffScalar< T, N > &x) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::pow (const AutoDiffScalar< T, N > &x, const T &p) |
| Power with a passive exponent: d/dx x^p = p x^(p-1). | |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::atan2 (const AutoDiffScalar< T, N > &y, const AutoDiffScalar< T, N > &x) |
| Two-argument arctangent: d atan2(y,x) = (x dy - y dx) / (x^2 + y^2). | |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::copysign (const AutoDiffScalar< T, N > &x, const T &s) |
| Copy the sign of a passive value onto x; scales the derivative by the resulting sign flip. | |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::copysign (const AutoDiffScalar< T, N > &x, const AutoDiffScalar< T, N > &s) |
| Copy the sign of another AutoDiffScalar onto x; the sign source contributes no derivative. | |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::min (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::max (const AutoDiffScalar< T, N > &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::min (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::max (const AutoDiffScalar< T, N > &a, const T &b) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::min (const T &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| constexpr AutoDiffScalar< T, N > | mundy::max (const T &a, const AutoDiffScalar< T, N > &b) |
| template<typename T, size_t N> | |
| std::ostream & | mundy::operator<< (std::ostream &os, const AutoDiffScalar< T, N > &a) |
| Stream as "value [d0, d1, ...]". | |
AutoDiffScalar is a drop-in scalar that propagates first derivatives by the chain rule. It satisfies the MundyMath custom-scalar contract — NumTraits, ScalarBinaryOpTraits, and ADL math overloads — so it can stand in for a primitive scalar throughout the library.