numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
|
Class of variables in forward-mode automatic differentiation [17]. More...
#include <num_collect/auto_diff/forward/variable.h>
Public Types | |
using | diff_type = Diff |
Type of differential coefficients. | |
using | value_type = Value |
Type of values. | |
Public Member Functions | |
variable () | |
Constructor. | |
variable (const value_type &value) | |
Constructor. | |
template<typename DiffArg > | |
variable (const value_type &value, DiffArg &&diff) | |
Constructor. | |
auto | diff () const -> const diff_type & |
Get the differential coefficients. | |
auto | has_diff () const noexcept -> bool |
Get whether this variable has differential coefficients. | |
auto | operator*= (const variable &right) -> variable & |
Multiply a variable. | |
auto | operator+= (const variable &right) -> variable & |
Add a variable. | |
auto | operator- () const -> variable |
Negate this variable. | |
auto | operator-= (const variable &right) -> variable & |
Subtract a variable. | |
auto | operator/= (const variable &right) -> variable & |
Divide by a variable. | |
auto | value () const noexcept -> const value_type & |
Get the value. | |
Private Attributes | |
std::optional< diff_type > | diff_ {} |
Differential coefficients. | |
value_type | value_ |
Value. | |
Class of variables in forward-mode automatic differentiation [17].
Value | Type of values. |
Diff | Type of differential coefficients (scalars, vectors, or matrices). |
Definition at line 43 of file variable.h.
using num_collect::auto_diff::forward::variable< Value, Diff >::diff_type = Diff |
Type of differential coefficients.
Definition at line 49 of file variable.h.
using num_collect::auto_diff::forward::variable< Value, Diff >::value_type = Value |
Type of values.
Definition at line 46 of file variable.h.
|
inline |
Constructor.
[in] | value | Value. |
[in] | diff | Differential coefficients. |
Definition at line 58 of file variable.h.
|
inline |
|
inline |
Constructor.
Definition at line 72 of file variable.h.
|
inlinenodiscard |
Get the differential coefficients.
Definition at line 97 of file variable.h.
|
inlinenodiscardnoexcept |
Get whether this variable has differential coefficients.
Definition at line 88 of file variable.h.
|
inline |
Multiply a variable.
[in] | right | Right-hand-side variable. |
Definition at line 158 of file variable.h.
|
inline |
Add a variable.
[in] | right | Right-hand-side variable. |
Definition at line 122 of file variable.h.
|
inline |
|
inline |
Subtract a variable.
[in] | right | Right-hand-side variable. |
Definition at line 140 of file variable.h.
|
inline |
Divide by a variable.
[in] | right | Right-hand-side variable. |
Definition at line 181 of file variable.h.
|
inlinenodiscardnoexcept |
|
private |
Differential coefficients.
Definition at line 202 of file variable.h.
|
private |
Value.
Definition at line 199 of file variable.h.