FSymbol API#

namespace ad#

Functions

template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator+(const FSym<T> &lhs, const FSym<T> &rhs) -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator-(const FSym<T> &lhs, const FSym<T> &rhs) -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator*(const FSym<T> &lhs, const FSym<T> &rhs) -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator/(const FSym<T> &lhs, const FSym<T> &rhs) -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
struct FSym#
#include <fsymbol.hpp>

Represents the forward mode operator for autodifferentiation. Note to find partial derivative of a multivariable function, we need to seed the t_dot value with 1.0 to express this e.g. df(x,y)/dx => FSym(x, 1.0), df(x,y)/dy => FSym(y, 1.0).

Template Parameters:
  • T

  • std::enable_if_t<std::is_floating_point_v<T>>

Public Functions

inline FSym(T t_value, T t_dot)#
inline FSym(T t_value)#
inline auto value() const noexcept -> T#
inline auto dot() const noexcept -> T#
inline auto df(int t_index) const noexcept -> T#
inline auto operator<(const FSym &other) const noexcept -> bool#
inline auto operator>(const FSym &other) const noexcept -> bool#
inline auto operator==(const FSym &other) const noexcept -> bool#
inline auto operator!=(const FSym &other) const noexcept -> bool#

Private Members

T m_value#
T m_dot#

ForwardOps API#

Functions

template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto pow(const FSym<T> &base, const FSym<T> &exp) -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto pow(const FSym<T> &base, T exp) -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto exp(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto ln(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sin(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto cos(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto tan(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto cot(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sec(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto csc(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sinh(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto cosh(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto tanh(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto coth(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sech(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto csch(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asin(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acos(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto atan(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asec(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acsc(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acot(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asinh(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acosh(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto atanh(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acoth(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asech(const FSym<T> &rhs) noexcept -> FSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acsch(const FSym<T> &rhs) noexcept -> FSym<T>#

RSymbol API#

namespace ad

Functions

template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator+(const RSym<T> &lhs, const RSym<T> &rhs) -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator-(const RSym<T> &lhs, const RSym<T> &rhs) -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator*(const RSym<T> &lhs, const RSym<T> &rhs) -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto operator/(const RSym<T> &lhs, const RSym<T> &rhs) -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
auto gradient(const RSym<T> &variable) -> std::map<RSym<T>, T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
struct RSym#

Public Functions

inline RSym(const std::map<RSym, T> &t_loc_grad, T t_value)#
inline RSym(T t_value)#
inline auto value() const noexcept -> T#
inline auto local_gradient() const noexcept -> std::map<RSym, T>#
inline auto operator<(const RSym &other) const noexcept -> bool#
inline auto operator>(const RSym &other) const noexcept -> bool#
inline auto operator==(const RSym &other) const noexcept -> bool#
inline auto operator!=(const RSym &other) const noexcept -> bool#

Private Members

std::map<RSym, T> m_local_grad#
T m_value#

ReverseOps API#

Functions

template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto pow(const RSym<T> &base, const RSym<T> &exponent) -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto pow(const RSym<T> &base, T exponent) -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto exp(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto ln(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sin(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto cos(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto tan(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto cot(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sec(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto csc(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sinh(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto cosh(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto tanh(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto coth(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto sech(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto csch(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asin(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acos(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto atan(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acot(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asec(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acsc(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asinh(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acosh(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto atanh(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acoth(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto asech(const RSym<T> &rhs) noexcept -> RSym<T>#
template<typename T, typename = typename std::enable_if_t<std::is_floating_point_v<T>>>
constexpr auto acsch(const RSym<T> &rhs) noexcept -> RSym<T>#