31template <base::concepts::real_scalar Scalar>
39template <base::concepts::real_scalar Scalar>
40using node_ptr = std::shared_ptr<const node<Scalar>>;
47template <base::concepts::real_scalar Scalar>
98template <base::concepts::real_scalar Scalar>
137template <base::concepts::real_scalar Scalar>
140 return std::make_shared<node<Scalar>>(std::move(children));
159 children.emplace_back(std::move(
node), sensitivity);
175 std::vector<child_node<Scalar>> children;
Definition of assertion macros.
#define NUM_COLLECT_ASSERT(CONDITION)
Macro to check whether a condition is satisfied.
class to save information of child nodes.
child_node(node_ptr< scalar_type > node, const scalar_type &sensitivity)
Constructor.
Scalar scalar_type
Type of scalars.
scalar_type sensitivity_
Partial differential coefficient of the parent node by the child node.
auto node() const noexcept -> const node_ptr< scalar_type > &
Get the child node.
auto sensitivity() const noexcept -> const scalar_type &
Get the partial differential coefficient of the parent node by the child node.
node_ptr< scalar_type > node_
Child node.
Class of nodes in graphs of automatic differentiation.
std::vector< child_node< scalar_type > > children_
Child nodes.
Scalar scalar_type
Type of scalars.
auto children() const noexcept -> const std::vector< child_node< scalar_type > > &
Get the child nodes.
node(std::vector< child_node< scalar_type > > children=std::vector< child_node< scalar_type > >())
Constructor.
auto create_node_impl(std::vector< child_node< Scalar > > &children) -> node_ptr< Scalar >
Create a node.
Namespace of graphs in backward-mode automatic differentiation.
std::shared_ptr< const node< Scalar > > node_ptr
Type of pointers of nodes.
auto create_node(Args &&... args) -> node_ptr< Scalar >
Create a node.
Definition of real_scalar concept.