47template <base::concepts::real_scalar Scalar>
105 [[nodiscard]]
auto node() const noexcept
131 if (
this == &right) {
157 if (
this == &right) {
185 if (
this == &right) {
214 if (
this == &right) {
223 static_cast<scalar_type>(1) / right.value_, right.node_,
232 right.node_, -
value_ / right.value_);
254template <
typename Scalar>
268template <
typename Scalar>
282template <
typename Scalar>
296template <
typename Scalar>
310template <
typename Scalar>
324template <
typename Scalar>
338template <
typename Scalar>
352template <
typename Scalar>
366template <
typename Scalar>
380template <
typename Scalar>
394template <
typename Scalar>
408template <
typename Scalar>
429template <
typename Scalar>
430struct NumTraits<
num_collect::auto_diff::backward::variable<Scalar>> {
454 RequireInitialization = 1,
472 return NumTraits<Scalar>::epsilon();
481 return NumTraits<Scalar>::dummy_precision();
490 return NumTraits<Scalar>::highest();
499 return NumTraits<Scalar>::lowest();
508 return NumTraits<Scalar>::digits10();
517 return NumTraits<Scalar>::infinity();
526 return NumTraits<Scalar>::quiet_NaN();
Class of variables in backward-mode automatic differentiation kubota1998.
auto operator/=(const variable &right) -> variable &
Divide this variable by a variable.
auto operator-() const -> variable
Negate this variable.
auto operator*=(const variable &right) -> variable &
Multiply this variable by a variable.
graph::node_ptr< scalar_type > node_
Node.
auto operator-=(const variable &right) -> variable &
Subtract a variable from this variable.
auto operator+=(const variable &right) -> variable &
Add a variable to this variable.
Scalar scalar_type
Type of scalars.
variable(const scalar_type &value, const variable_tag &)
Construct variables.
auto node() const noexcept -> const graph::node_ptr< scalar_type > &
Get the node.
variable(const scalar_type &value, const constant_tag &)
Construct constants.
variable(const scalar_type &value)
Construct constants.
auto value() const noexcept -> const scalar_type &
Get the value.
variable(const scalar_type &value, graph::node_ptr< scalar_type > node)
Constructor.
Namespace of Eigen library.
std::shared_ptr< const node< Scalar > > node_ptr
Type of pointers of nodes.
auto create_node(Args &&... args) -> node_ptr< Scalar >
Create a node.
Namespace of backward-mode automatic differentiation.
auto operator*(const variable< Scalar > &left, const variable< Scalar > &right) -> variable< Scalar >
Multiply two variables.
auto operator+(const variable< Scalar > &left, const variable< Scalar > &right) -> variable< Scalar >
Add two variables.
auto operator-(const variable< Scalar > &left, const variable< Scalar > &right) -> variable< Scalar >
Subtract a variable from another variable.
auto operator/(const variable< Scalar > &left, const variable< Scalar > &right) -> variable< Scalar >
Divide a variable from another variable.
Namespace of num_collect source codes.
Definition of node class.
Definition of real_scalar concept.
static constexpr auto infinity() -> Real
Get the infinity.
static constexpr auto highest() -> Real
Get the highest value.
static constexpr auto digits10() -> int
Get the number of digits.
static constexpr auto epsilon() -> Real
Get machine epsilon.
static constexpr auto lowest() -> Real
Get the lowest value.
static constexpr auto dummy_precision() -> Real
Get dummy precision.
static constexpr auto quiet_NaN() -> Real
Get the quiet NaN value.
Tag class to specify constants.
Tag class to specify variables.