5 #ifndef BPP_PHYL_LIKELIHOOD_DATAFLOW_SEQUENCE_DF_H
6 #define BPP_PHYL_LIKELIHOOD_DATAFLOW_SEQUENCE_DF_H
11 #include <unordered_map>
33 return cachedAs<Self>(c, std::make_shared<Self>(std::move(value), name));
50 using namespace numeric;
61 const auto* derived =
dynamic_cast<const Self*
>(&other);
62 return derived !=
nullptr &&
name_ == derived->name_ && this->
accessValueConst () == derived->accessValueConst ();
65 std::string
color ()
const override
73 return this->shared_from_this ();
78 using namespace numeric;
80 combineHash<std::string>(seed,
name_);
static std::shared_ptr< Self > create(Context &c, const Dimension< T > &dim)
Build a new ConstantOne node of the given dimension.
static std::shared_ptr< Self > create(Context &c, const Dimension< T > &dim)
Build a new ConstantZero node of the given dimension.
Context for dataflow node construction.
Base dataflow Node class.
virtual std::string description() const
Node pretty name (default = type name).
void makeValid() noexcept
Data flow node representing a Sequence as a Value<Eigen::MatrixXd> with a name.
NodeRef recreate(Context &c, NodeRefVec &&deps) final
Recreate the node with different dependencies.
bool compareAdditionalArguments(const Node_DF &other) const override
Compare node-specific configuration to another.
NodeRef derive(Context &c, const Node_DF &node) final
Returns a node computing d(this_node_expression)/d(node_expression).
const std::string & getName() const
std::string description() const final
Node pretty name (default = type name).
std::string debugInfo() const final
Node debug info (default = ""): user defined detailed info for DF graph debug.
static ValueRef< T > create(Context &c, T &&value, const std::string &name)
std::size_t hashAdditionalArguments() const override
Return the hash of node-specific configuration.
std::string color() const override
void compute() final
Computation implementation.
Sequence_DF(T &&value, const std::string &name)
Abstract Node storing a value of type T.
const MatrixLik & accessValueConst() const noexcept
Raw value access (const).
std::string debug(const T &t, typename std::enable_if< std::is_arithmetic< T >::value >::type *=0)
Defines the basic types of data flow nodes.
std::size_t hash(const MatrixDimension &dim)
std::shared_ptr< Value< T > > ValueRef
Shared pointer alias for Value<T>.
ExtendedFloatMatrixXd MatrixLik
void checkRecreateWithoutDependencies(const std::type_info &contextNodeType, const NodeRefVec &deps)
std::vector< NodeRef > NodeRefVec
Alias for a dependency vector (of NodeRef).
void failureComputeWasCalled(const std::type_info &nodeType)
std::shared_ptr< Node_DF > NodeRef
Store a dimension for type T.