bpp-phyl3
3.0.0
|
Base dataflow Node class. More...
#include <Bpp/Phyl/Likelihood/DataFlow/DataFlow.h>
Public Member Functions | |
Node_DF ()=default | |
Node_DF (const Node_DF &)=delete | |
Node_DF (Node_DF &&)=delete | |
Node_DF & | operator= (const Node_DF &)=delete |
Node_DF & | operator= (Node_DF &&)=delete |
virtual | ~Node_DF () |
Node_DF (const NodeRefVec &dependenciesArg) | |
Node_DF (NodeRefVec &&dependenciesArg) | |
bool | isValid () const noexcept |
std::size_t | nbDependentNodes () const noexcept |
Number of dependent nodes (ie nodes that depend on this) More... | |
const std::vector< Node_DF * > & | dependentNodes () const noexcept |
std::size_t | nbDependencies () const noexcept |
Number of dependencies (ie nodes we depend on) More... | |
const NodeRefVec & | dependencies () const noexcept |
const NodeRef & | dependency (std::size_t i) const noexcept |
virtual std::string | description () const |
Node pretty name (default = type name). More... | |
virtual std::string | color () const |
virtual std::string | shape () const |
virtual std::string | debugInfo () const |
Node debug info (default = ""): user defined detailed info for DF graph debug. More... | |
virtual bool | hasNumericalProperty (NumericalProperty prop) const |
Test if the node has the given numerical property. More... | |
virtual bool | compareAdditionalArguments (const Node_DF &other) const |
Compare node-specific configuration to another. More... | |
virtual std::size_t | hashAdditionalArguments () const |
Return the hash of node-specific configuration. More... | |
virtual NodeRef | derive (Context &c, const Node_DF &node) |
Returns a node computing d(this_node_expression)/d(node_expression). More... | |
virtual NodeRef | recreate (Context &c, NodeRefVec &&deps) |
Recreate the node with different dependencies. More... | |
void | computeRecursively () |
Compute this node value, recomputing dependencies (transitively) as needed. More... | |
Protected Member Functions | |
virtual void | compute ()=0 |
Computation implementation. More... | |
void | invalidateRecursively () noexcept |
Invalidate (transitively) dependent nodes from this one. More... | |
void | makeInvalid () noexcept |
void | makeValid () noexcept |
void | resetDependencies_ (NodeRefVec &&dependenciesArg) |
Private Member Functions | |
void | registerNode (Node_DF *n) |
void | unregisterNode (const Node_DF *n) |
Private Attributes | |
NodeRefVec | dependencyNodes_ {} |
std::vector< Node_DF * > | dependentNodes_ {} |
bool | isValid_ {false} |
Friends | |
class | Context |
Base dataflow Node class.
All data flow nodes inherit from this class. Instances of this class must be used through std::shared_ptr<T>.
A base node represents something that can be computed from its dependencies. The computation is defined by the compute() method in derived classes.
The base class stores a boolean indicating if the current value is valid. This boolean is used to cache intermediate results in the graph, and avoid recomputings. When data flow graph leaves change, they invalidate (transitively) dependent nodes. This means setting the valid flag to false, to trigger a recomputation at next access.
Each node has dependencies: other nodes providing data it needs to compute. These dependencies are stored as NodeRef (shared_ptr<Node>). Thus, multiple nodes can depend on the same value, to shared intermediate results. The list of dependencies is FIXED at creation, and cannot be changed. Changing the meaning of a node (dependencies, config) is done by creating a different node.
Nodes also store pointers to dependent nodes. Dependent nodes are nodes which have a direct dependency to the current node. This is used to propagate invalidations to all transitive dependent nodes of a leaf. Dependent nodes are stored as raw pointers (no ownership).
Base nodes thus store the data flow graph topology, in terms of pointer to base Node. This is useful for code reuse: no templates in topology walks code. It is useful for debugging: can print the whole graph structure. Accessing the derived classes (for compute) can be done efficiently with static_cast.
Two main invariants are maintained at all times by this class. 1: If a node is valid, all its transitive dependencies are valid. 2: If a node is invalid, all transitively dependent nodes are invalid.
In addition, two properties are implemented for performance: 1: During computation of a node dependencies, do not recompute valid nodes. 2: Only invalidate transitively dependent node, not others (still valid).
Specific features are present in the base class as virtual functions. This include derivation (numerical values), debug, etc. These features have no-op or failure defaults which can be overridden in derived classes.
Definition at line 151 of file DataFlow.h.
|
default |
|
delete |
|
delete |
|
virtual |
Definition at line 142 of file DataFlow.cpp.
References dependencyNodes_.
bpp::Node_DF::Node_DF | ( | const NodeRefVec & | dependenciesArg | ) |
Definition at line 123 of file DataFlow.cpp.
References dependencyNodes_.
bpp::Node_DF::Node_DF | ( | NodeRefVec && | dependenciesArg | ) |
Definition at line 132 of file DataFlow.cpp.
References dependencyNodes_.
|
inlinevirtual |
Reimplemented in bpp::Sequence_DF, bpp::ShiftParameter, bpp::ConfiguredParameter, bpp::NumericConstant< T >, bpp::MatrixProduct< R, T0, T1 >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::TransitionMatrixFromTransitionMatrix, bpp::EquilibriumFrequenciesFromTransitionMatrix, bpp::ConfiguredTransitionMatrix, bpp::FrequenciesFromSimplex, bpp::ConfiguredSimplex, bpp::ProbabilityFromMixedModel, bpp::ProbabilitiesFromMixedModel, bpp::TransitionFunctionFromModel, bpp::TransitionMatrixFromModel, bpp::EquilibriumFrequenciesFromModel, bpp::ConfiguredModel, bpp::FrequenciesFromFrequencySet, bpp::ConfiguredFrequencySet, bpp::CategoryFromDiscreteDistribution, bpp::ProbabilityFromDiscreteDistribution, bpp::ProbabilitiesFromDiscreteDistribution, bpp::ConfiguredDistribution, and bpp::ValueFromConfiguredParameter.
Definition at line 190 of file DataFlow.h.
Referenced by bpp::writeDotEdge(), and bpp::writeDotNode().
|
virtual |
Compare node-specific configuration to another.
Required by Context for merging. It must compare everything in the node configuration except its type and dependencies. See DataFlowNumeric for examples. The default returns false, so nodes are considered different and not merged.
Reimplemented in bpp::Sequence_DF, bpp::ConfiguredParameter, bpp::ConfiguredModel, bpp::NumericConstant< T >, bpp::BackwardHmmLikelihood_DF, bpp::ForwardHmmD2Likelihood_DF, bpp::ForwardHmmDLikelihood_DF, bpp::ForwardHmmLikelihood_DF, bpp::CondLikelihood, bpp::FrequenciesFromSimplex, bpp::ValueFromConfiguredParameter, bpp::ShiftParameter, bpp::ProbabilityFromMixedModel, bpp::ProbabilitiesFromMixedModel, bpp::FrequenciesFromFrequencySet, bpp::CategoryFromDiscreteDistribution, bpp::ProbabilityFromDiscreteDistribution, bpp::ProbabilitiesFromDiscreteDistribution, bpp::Identity< R >, bpp::Convert< R, F >, bpp::ConstantOne< T >, bpp::ConstantZero< T >, bpp::CombineDeltaShifted< T >, bpp::ShiftDelta< T >, bpp::MatrixProduct< R, T0, T1 >, bpp::LogSumExp< R, T0, T1 >, bpp::SumOfLogarithms< F >, bpp::ScalarProduct< R, T0, T1 >, bpp::CWiseConstantPow< T >, bpp::CWiseExp< T >, bpp::CWiseLog< T >, bpp::CWiseInverse< T >, bpp::CWiseNegate< T >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, ReductionOf< T > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, ReductionOf< T > >, bpp::CWiseSub< R, std::tuple< T0, T1 > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::CWiseCompound< R, ReductionOf< T > >, bpp::CWiseMatching< R, ReductionOf< T > >, bpp::CWisePattern< R >, bpp::CWiseFill< R, T >, bpp::TransitionMatrixFromTransitionMatrix, bpp::EquilibriumFrequenciesFromTransitionMatrix, bpp::ConfiguredTransitionMatrix, bpp::ConfiguredSimplex, bpp::TransitionFunctionFromModel, bpp::TransitionMatrixFromModel, bpp::EquilibriumFrequenciesFromModel, bpp::ConfiguredFrequencySet, and bpp::ConfiguredDistribution.
Definition at line 170 of file DataFlow.cpp.
|
protectedpure virtual |
Computation implementation.
This functions is defined by derived classes. It should compute the new node value from dependency node values. When called, dependency node are guaranteed to have valid values.
This function is private to prevent use for invalid dependencies. Higher level functions like computeRecursively call it while ensuring dependency validity.
Compute has access to dependencies as a NodeRefVec (base Node_DF classes only). The recommended usage is to check dependency types at Node construction. Then use static_cast to access derived classes efficiently from the NodeRefVec. See DataFlowNumeric.h for examples.
Implemented in bpp::BackwardHmmLikelihood_DF, bpp::ForwardHmmD2Likelihood_DF, bpp::ForwardHmmDLikelihood_DF, bpp::ForwardHmmLikelihood_DF, bpp::CondLikelihood, bpp::ConfiguredParameter, bpp::ConfiguredModel, bpp::CombineDeltaShifted< T >, bpp::SumOfLogarithms< F >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, ReductionOf< T > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::CWiseCompound< R, ReductionOf< T > >, bpp::CWiseMatching< R, ReductionOf< T > >, bpp::CWisePattern< R >, bpp::CWiseFill< R, T >, bpp::TransitionMatrixFromTransitionMatrix, bpp::EquilibriumFrequenciesFromTransitionMatrix, bpp::FrequenciesFromSimplex, bpp::Sequence_DF, bpp::ValueFromConfiguredParameter, bpp::ShiftParameter, bpp::ProbabilityFromMixedModel, bpp::ProbabilitiesFromMixedModel, bpp::TransitionFunctionFromModel, bpp::TransitionMatrixFromModel, bpp::EquilibriumFrequenciesFromModel, bpp::FrequenciesFromFrequencySet, bpp::CategoryFromDiscreteDistribution, bpp::ProbabilityFromDiscreteDistribution, bpp::ProbabilitiesFromDiscreteDistribution, bpp::Identity< R >, bpp::Convert< R, F >, bpp::NumericMutable< T >, bpp::NumericConstant< T >, bpp::ConstantOne< T >, bpp::ConstantZero< T >, bpp::ShiftDelta< T >, bpp::MatrixProduct< R, T0, T1 >, bpp::LogSumExp< R, T0, T1 >, bpp::ScalarProduct< R, T0, T1 >, bpp::CWiseConstantPow< T >, bpp::CWiseExp< T >, bpp::CWiseLog< T >, bpp::CWiseInverse< T >, bpp::CWiseNegate< T >, bpp::CWiseMul< R, ReductionOf< T > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseSub< R, std::tuple< T0, T1 > >, bpp::ConfiguredTransitionMatrix, bpp::ConfiguredSimplex, bpp::ConfiguredFrequencySet, bpp::ConfiguredDistribution, bpp::CombineDeltaShifted< T >, bpp::CombineDeltaShifted< T >, bpp::SumOfLogarithms< F >, bpp::SumOfLogarithms< F >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, ReductionOf< T > >, bpp::CWiseAdd< R, ReductionOf< T > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::CWiseFill< R, T >, bpp::CWiseFill< R, T >, and bpp::CWiseFill< R, T >.
void bpp::Node_DF::computeRecursively | ( | ) |
Compute this node value, recomputing dependencies (transitively) as needed.
Not thread safe !
Definition at line 183 of file DataFlow.cpp.
References isValid().
Referenced by bpp::Value< T >::targetValue().
|
virtual |
Node debug info (default = ""): user defined detailed info for DF graph debug.
Reimplemented in bpp::BackwardHmmLikelihood_DF, bpp::ForwardHmmD2Likelihood_DF, bpp::ForwardHmmDLikelihood_DF, bpp::ForwardHmmLikelihood_DF, bpp::CondLikelihood, bpp::ShiftParameter, bpp::ConfiguredParameter, bpp::Identity< R >, bpp::Convert< R, F >, bpp::NumericMutable< T >, bpp::NumericConstant< T >, bpp::ConstantOne< T >, bpp::ConstantZero< T >, bpp::CombineDeltaShifted< T >, bpp::ShiftDelta< T >, bpp::MatrixProduct< R, T0, T1 >, bpp::LogSumExp< R, T0, T1 >, bpp::SumOfLogarithms< F >, bpp::ScalarProduct< R, T0, T1 >, bpp::CWiseConstantPow< T >, bpp::CWiseExp< T >, bpp::CWiseLog< T >, bpp::CWiseInverse< T >, bpp::CWiseNegate< T >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, ReductionOf< T > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, ReductionOf< T > >, bpp::CWiseSub< R, std::tuple< T0, T1 > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::CWiseCompound< R, ReductionOf< T > >, bpp::CWiseMatching< R, ReductionOf< T > >, bpp::CWisePattern< R >, bpp::CWiseFill< R, T >, bpp::TransitionMatrixFromTransitionMatrix, bpp::EquilibriumFrequenciesFromTransitionMatrix, bpp::ConfiguredTransitionMatrix, bpp::FrequenciesFromSimplex, bpp::ConfiguredSimplex, bpp::Sequence_DF, bpp::ValueFromConfiguredParameter, bpp::ProbabilityFromMixedModel, bpp::ProbabilitiesFromMixedModel, bpp::TransitionFunctionFromModel, bpp::TransitionMatrixFromModel, bpp::EquilibriumFrequenciesFromModel, bpp::ConfiguredModel, bpp::FrequenciesFromFrequencySet, bpp::ConfiguredFrequencySet, bpp::CategoryFromDiscreteDistribution, bpp::ProbabilityFromDiscreteDistribution, bpp::ProbabilitiesFromDiscreteDistribution, and bpp::ConfiguredDistribution.
Definition at line 166 of file DataFlow.cpp.
Referenced by bpp::writeDotNode().
|
inlinenoexcept |
Definition at line 183 of file DataFlow.h.
References dependencyNodes_.
Referenced by bpp::CWiseAdd< R, ReductionOf< T > >::compute(), bpp::CombineDeltaShifted< T >::compute(), bpp::CWiseMul< R, ReductionOf< T > >::compute(), bpp::ConfiguredDistribution::ConfiguredDistribution(), bpp::ConfiguredFrequencySet::ConfiguredFrequencySet(), bpp::ConfiguredModel::ConfiguredModel(), bpp::ConfiguredSimplex::ConfiguredSimplex(), bpp::ConfiguredTransitionMatrix::ConfiguredTransitionMatrix(), bpp::CWiseMul< R, std::tuple< T0, T1 > >::derive(), and bpp::CWiseMul< R, ReductionOf< T > >::derive().
|
inlinenoexcept |
Definition at line 185 of file DataFlow.h.
References dependencyNodes_.
Referenced by bpp::BackwardHmmLikelihood_DF::BackwardHmmLikelihood_DF(), bpp::ForwardHmmLikelihood_DF::build(), bpp::ValueFromConfiguredParameter::color(), bpp::CWiseFill< R, T >::compute(), bpp::CWiseApply< R, T, F >::compute(), bpp::CWiseAdd< R, std::tuple< T0, T1 > >::compute(), bpp::CWiseAdd< R, T >::compute(), bpp::CWiseMul< R, std::tuple< T0, T1 > >::compute(), bpp::CWiseDiv< R, std::tuple< T0, T1 > >::compute(), bpp::SumOfLogarithms< F >::compute(), bpp::CombineDeltaShifted< T >::compute(), bpp::CWiseSub< R, std::tuple< T0, T1 > >::compute(), bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >::compute(), bpp::CWiseMean< R, ReductionOf< T >, P >::compute(), bpp::CWiseNegate< T >::compute(), bpp::CWiseInverse< T >::compute(), bpp::CWiseLog< T >::compute(), bpp::CWiseExp< T >::compute(), bpp::CWiseConstantPow< T >::compute(), bpp::ScalarProduct< R, T0, T1 >::compute(), bpp::LogSumExp< R, T0, T1 >::compute(), bpp::MatrixProduct< R, T0, T1 >::compute(), bpp::ShiftDelta< T >::compute(), bpp::Convert< R, F >::compute(), bpp::Identity< R >::compute(), bpp::ProbabilitiesFromDiscreteDistribution::compute(), bpp::ProbabilityFromDiscreteDistribution::compute(), bpp::CategoryFromDiscreteDistribution::compute(), bpp::FrequenciesFromFrequencySet::compute(), bpp::EquilibriumFrequenciesFromModel::compute(), bpp::TransitionMatrixFromModel::compute(), bpp::TransitionFunctionFromModel::compute(), bpp::ProbabilitiesFromMixedModel::compute(), bpp::ProbabilityFromMixedModel::compute(), bpp::ShiftParameter::compute(), bpp::ValueFromConfiguredParameter::compute(), bpp::FrequenciesFromSimplex::compute(), bpp::EquilibriumFrequenciesFromTransitionMatrix::compute(), bpp::TransitionMatrixFromTransitionMatrix::compute(), bpp::CWisePattern< R >::compute(), bpp::CWiseMatching< R, ReductionOf< T > >::compute(), bpp::CWiseCompound< R, ReductionOf< T > >::compute(), bpp::ConfiguredParameter::compute(), bpp::CombineDeltaShifted< T >::create(), bpp::TransitionMatrixFromModel::debugInfo(), bpp::TransitionFunctionFromModel::debugInfo(), bpp::ValueFromConfiguredParameter::debugInfo(), bpp::CondLikelihood::debugInfo(), bpp::CWiseFill< R, T >::derive(), bpp::CWisePattern< R >::derive(), bpp::CWiseMatching< R, ReductionOf< T > >::derive(), bpp::CWiseCompound< R, ReductionOf< T > >::derive(), bpp::CWiseApply< R, T, F >::derive(), bpp::CWiseAdd< R, std::tuple< T0, T1 > >::derive(), bpp::CWiseSub< R, std::tuple< T0, T1 > >::derive(), bpp::CWiseAdd< R, ReductionOf< T > >::derive(), bpp::CWiseAdd< R, T >::derive(), bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >::derive(), bpp::CWiseMean< R, ReductionOf< T >, P >::derive(), bpp::CWiseMul< R, std::tuple< T0, T1 > >::derive(), bpp::CWiseMul< R, ReductionOf< T > >::derive(), bpp::CWiseDiv< R, std::tuple< T0, T1 > >::derive(), bpp::CWiseNegate< T >::derive(), bpp::CWiseInverse< T >::derive(), bpp::CWiseLog< T >::derive(), bpp::CWiseExp< T >::derive(), bpp::CWiseConstantPow< T >::derive(), bpp::ScalarProduct< R, T0, T1 >::derive(), bpp::SumOfLogarithms< F >::derive(), bpp::LogSumExp< R, T0, T1 >::derive(), bpp::MatrixProduct< R, T0, T1 >::derive(), bpp::ShiftDelta< T >::derive(), bpp::CombineDeltaShifted< T >::derive(), bpp::Convert< R, F >::derive(), bpp::Identity< R >::derive(), bpp::ProbabilitiesFromDiscreteDistribution::derive(), bpp::ProbabilityFromDiscreteDistribution::derive(), bpp::CategoryFromDiscreteDistribution::derive(), bpp::FrequenciesFromFrequencySet::derive(), bpp::EquilibriumFrequenciesFromModel::derive(), bpp::TransitionMatrixFromModel::derive(), bpp::TransitionFunctionFromModel::derive(), bpp::ProbabilitiesFromMixedModel::derive(), bpp::ProbabilityFromMixedModel::derive(), bpp::ShiftParameter::derive(), bpp::ValueFromConfiguredParameter::derive(), bpp::FrequenciesFromSimplex::derive(), bpp::EquilibriumFrequenciesFromTransitionMatrix::derive(), bpp::TransitionMatrixFromTransitionMatrix::derive(), bpp::BackwardHmmLikelihood_DF::derive(), bpp::ConfiguredParameter::derive(), bpp::ValueFromConfiguredParameter::description(), bpp::ConfiguredParameter::getValue(), bpp::ConfiguredParameter::recreate(), bpp::ConfiguredParameter::setValue(), and bpp::writeDotEdge().
|
inlinenoexcept |
Definition at line 175 of file DataFlow.h.
References dependentNodes_.
Returns a node computing d(this_node_expression)/d(node_expression).
The expression represented by 'node' is considered as a variable. Event if 'node' is a constant value node, d(node)/d(node) == 1. The derivative of a matrix is the matrix of the derivatives. Derivation is undefined by default, and this function will throw an exception. Implementations will usually recursively derive sub-expressions and combine them.
Reimplemented in bpp::ConfiguredParameter, bpp::BackwardHmmLikelihood_DF, bpp::ForwardHmmD2Likelihood_DF, bpp::ForwardHmmDLikelihood_DF, bpp::ForwardHmmLikelihood_DF, bpp::CondLikelihood, bpp::TransitionMatrixFromTransitionMatrix, bpp::EquilibriumFrequenciesFromTransitionMatrix, bpp::FrequenciesFromSimplex, bpp::Sequence_DF, bpp::ValueFromConfiguredParameter, bpp::ShiftParameter, bpp::ProbabilityFromMixedModel, bpp::ProbabilitiesFromMixedModel, bpp::TransitionFunctionFromModel, bpp::TransitionMatrixFromModel, bpp::EquilibriumFrequenciesFromModel, bpp::FrequenciesFromFrequencySet, bpp::CategoryFromDiscreteDistribution, bpp::ProbabilityFromDiscreteDistribution, bpp::ProbabilitiesFromDiscreteDistribution, bpp::Identity< R >, bpp::Convert< R, F >, bpp::NumericMutable< T >, bpp::NumericConstant< T >, bpp::ConstantOne< T >, bpp::ConstantZero< T >, bpp::CombineDeltaShifted< T >, bpp::ShiftDelta< T >, bpp::MatrixProduct< R, T0, T1 >, bpp::LogSumExp< R, T0, T1 >, bpp::SumOfLogarithms< F >, bpp::ScalarProduct< R, T0, T1 >, bpp::CWiseConstantPow< T >, bpp::CWiseExp< T >, bpp::CWiseLog< T >, bpp::CWiseInverse< T >, bpp::CWiseNegate< T >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, ReductionOf< T > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, ReductionOf< T > >, bpp::CWiseSub< R, std::tuple< T0, T1 > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::CWiseCompound< R, ReductionOf< T > >, bpp::CWiseMatching< R, ReductionOf< T > >, bpp::CWisePattern< R >, and bpp::CWiseFill< R, T >.
Definition at line 173 of file DataFlow.cpp.
References description().
Referenced by bpp::Value< T >::deriveAsValue().
|
virtual |
Node pretty name (default = type name).
Reimplemented in bpp::ShiftParameter, bpp::ConfiguredParameter, bpp::NumericMutable< T >, bpp::NumericConstant< T >, bpp::CombineDeltaShifted< T >, bpp::MatrixProduct< R, T0, T1 >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::TransitionMatrixFromTransitionMatrix, bpp::ConfiguredTransitionMatrix, bpp::ConfiguredSimplex, bpp::Sequence_DF, bpp::TransitionFunctionFromModel, bpp::TransitionMatrixFromModel, bpp::ConfiguredModel, bpp::ConfiguredFrequencySet, bpp::ConfiguredDistribution, and bpp::ValueFromConfiguredParameter.
Definition at line 151 of file DataFlow.cpp.
References bpp::prettyTypeName().
Referenced by derive(), bpp::Sequence_DF::description(), bpp::NumericConstant< T >::description(), bpp::NumericMutable< T >::description(), recreate(), and bpp::writeDotNode().
|
virtual |
Return the hash of node-specific configuration.
Compute a hash from additional arguments of the node. The hashed values must the same as the ones compared by compareAdditionalArguments. The default returns 0, which is ok if there are no additional arguments.
Reimplemented in bpp::Sequence_DF, bpp::ConfiguredParameter, bpp::ConfiguredModel, bpp::NumericConstant< T >, bpp::ShiftParameter, bpp::ConstantOne< T >, bpp::ConstantZero< T >, bpp::CombineDeltaShifted< T >, bpp::ShiftDelta< T >, bpp::CWiseConstantPow< T >, bpp::ConfiguredTransitionMatrix, bpp::ConfiguredSimplex, bpp::ConfiguredFrequencySet, and bpp::ConfiguredDistribution.
Definition at line 171 of file DataFlow.cpp.
|
virtual |
Test if the node has the given numerical property.
This is an optional indication only, used for optimisations. If unsure, leave it to always false (the default implementation). This should be non recursive, to ensure a constant time check.
Reimplemented in bpp::NumericConstant< T >, bpp::ConstantOne< T >, and bpp::ConstantZero< T >.
Definition at line 168 of file DataFlow.cpp.
Referenced by bpp::ScalarProduct< R, T0, T1 >::create(), bpp::CWisePattern< R >::create(), bpp::CWiseAdd< R, T >::create(), bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >::create(), bpp::CWiseDiv< R, std::tuple< T0, T1 > >::create(), bpp::CWiseNegate< T >::create(), bpp::CWiseInverse< T >::create(), bpp::CWiseLog< T >::create(), bpp::CWiseExp< T >::create(), bpp::CWiseConstantPow< T >::create(), and bpp::CombineDeltaShifted< T >::create().
|
protectednoexcept |
Invalidate (transitively) dependent nodes from this one.
Not thread safe !
Definition at line 219 of file DataFlow.cpp.
References isValid().
Referenced by bpp::Value< T >::modify(), and resetDependencies_().
|
inlinenoexcept |
Definition at line 166 of file DataFlow.h.
References isValid_.
Referenced by computeRecursively(), invalidateRecursively(), and bpp::writeDotNode().
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
Definition at line 271 of file DataFlow.h.
References isValid_.
Referenced by bpp::Value< T >::modify(), bpp::NumericConstant< T >::NumericConstant(), bpp::NumericMutable< T >::NumericMutable(), and bpp::Sequence_DF::Sequence_DF().
|
inlinenoexcept |
Number of dependencies (ie nodes we depend on)
Definition at line 181 of file DataFlow.h.
References dependencyNodes_.
Referenced by bpp::SumOfLogarithms< F >::compute(), bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >::compute(), bpp::CWiseMean< R, ReductionOf< T >, P >::compute(), bpp::EquilibriumFrequenciesFromModel::compute(), bpp::TransitionMatrixFromModel::compute(), bpp::CWiseMatching< R, ReductionOf< T > >::compute(), bpp::CWiseCompound< R, ReductionOf< T > >::compute(), bpp::CWiseMatching< R, ReductionOf< T > >::derive(), bpp::CWiseCompound< R, ReductionOf< T > >::derive(), bpp::CWiseAdd< R, ReductionOf< T > >::derive(), bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >::derive(), bpp::CWiseMean< R, ReductionOf< T >, P >::derive(), bpp::CWiseMul< R, ReductionOf< T > >::derive(), bpp::SumOfLogarithms< F >::derive(), bpp::CombineDeltaShifted< T >::derive(), bpp::EquilibriumFrequenciesFromModel::derive(), and bpp::TransitionMatrixFromModel::derive().
|
inlinenoexcept |
Number of dependent nodes (ie nodes that depend on this)
Definition at line 172 of file DataFlow.h.
References dependentNodes_.
|
virtual |
Recreate the node with different dependencies.
Reimplemented in bpp::ConfiguredParameter, bpp::BackwardHmmLikelihood_DF, bpp::ForwardHmmD2Likelihood_DF, bpp::ForwardHmmDLikelihood_DF, bpp::ForwardHmmLikelihood_DF, bpp::CondLikelihood, bpp::TransitionMatrixFromTransitionMatrix, bpp::EquilibriumFrequenciesFromTransitionMatrix, bpp::ConfiguredTransitionMatrix, bpp::FrequenciesFromSimplex, bpp::ConfiguredSimplex, bpp::Sequence_DF, bpp::ValueFromConfiguredParameter, bpp::ShiftParameter, bpp::ProbabilityFromMixedModel, bpp::ProbabilitiesFromMixedModel, bpp::TransitionFunctionFromModel, bpp::TransitionMatrixFromModel, bpp::EquilibriumFrequenciesFromModel, bpp::ConfiguredModel, bpp::FrequenciesFromFrequencySet, bpp::ConfiguredFrequencySet, bpp::CategoryFromDiscreteDistribution, bpp::ProbabilityFromDiscreteDistribution, bpp::ProbabilitiesFromDiscreteDistribution, bpp::ConfiguredDistribution, bpp::Identity< R >, bpp::Convert< R, F >, bpp::CombineDeltaShifted< T >, bpp::ShiftDelta< T >, bpp::MatrixProduct< R, T0, T1 >, bpp::LogSumExp< R, T0, T1 >, bpp::SumOfLogarithms< F >, bpp::ScalarProduct< R, T0, T1 >, bpp::CWiseConstantPow< T >, bpp::CWiseExp< T >, bpp::CWiseLog< T >, bpp::CWiseInverse< T >, bpp::CWiseNegate< T >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, ReductionOf< T > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseAdd< R, T >, bpp::CWiseAdd< R, ReductionOf< T > >, bpp::CWiseSub< R, std::tuple< T0, T1 > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::CWiseCompound< R, ReductionOf< T > >, bpp::CWiseMatching< R, ReductionOf< T > >, bpp::CWisePattern< R >, bpp::CWiseFill< R, T >, bpp::NumericConstant< T >, bpp::NumericMutable< T >, bpp::ConstantOne< T >, and bpp::ConstantZero< T >.
Definition at line 178 of file DataFlow.cpp.
References description().
|
private |
Definition at line 240 of file DataFlow.cpp.
References dependentNodes_.
|
inlineprotected |
Definition at line 288 of file DataFlow.h.
References dependencyNodes_, invalidateRecursively(), and makeInvalid().
|
inlinevirtual |
Reimplemented in bpp::MatrixProduct< R, T0, T1 >, bpp::CWiseDiv< R, std::tuple< T0, T1 > >, bpp::CWiseMul< R, std::tuple< T0, T1 > >, bpp::CWiseMean< R, ReductionOf< T >, P >, bpp::CWiseMean< R, ReductionOf< T >, ReductionOf< P > >, bpp::CWiseAdd< R, std::tuple< T0, T1 > >, bpp::CWiseApply< R, T, F >, bpp::TransitionMatrixFromTransitionMatrix, bpp::TransitionFunctionFromModel, and bpp::TransitionMatrixFromModel.
Definition at line 195 of file DataFlow.h.
Referenced by bpp::writeDotNode().
|
private |
Definition at line 245 of file DataFlow.cpp.
References dependentNodes_.
|
friend |
Definition at line 316 of file DataFlow.h.
|
private |
Definition at line 312 of file DataFlow.h.
Referenced by dependencies(), dependency(), nbDependencies(), Node_DF(), resetDependencies_(), and ~Node_DF().
|
private |
Definition at line 313 of file DataFlow.h.
Referenced by dependentNodes(), nbDependentNodes(), registerNode(), and unregisterNode().
|
private |
Definition at line 314 of file DataFlow.h.
Referenced by isValid(), makeInvalid(), and makeValid().