16 ConfiguredTransitionMatrix::ConfiguredTransitionMatrix (
Context& context,
NodeRefVec&& deps, std::unique_ptr<HmmTransitionMatrix>&& hmm)
18 , hmm_(std::move(hmm))
39 const auto* derived =
dynamic_cast<const Self*
>(&other);
40 if (derived ==
nullptr)
46 const auto& thisHMM = *
hmm_;
47 const auto& otherHMM = *derived->hmm_;
48 return typeid (thisHMM) ==
typeid (otherHMM);
54 const auto& bppTransitionMatrix = *
hmm_;
55 return typeid (bppTransitionMatrix).hash_code ();
60 auto m = ConfiguredParametrizable::createConfigured<Target, Self>(c, std::move (deps), std::unique_ptr<Target>(
dynamic_cast<Target*
>(
hmm_->clone ())));
69 :
Value<
T>(std::move (deps)), targetDimension_ (dim) {}
73 using namespace numeric;
80 return dynamic_cast<const Self*
>(&other) !=
nullptr;
87 auto& hmm =
static_cast<Dep&
>(*hmmDep);
88 auto buildFWithNewTransitionMatrix = [
this, &c](
NodeRef&& newTransitionMatrix) {
89 return ConfiguredParametrizable::createVector<Dep, Self>(c, {std::move (newTransitionMatrix)},
targetDimension_);
92 NodeRefVec derivativeSumDeps = ConfiguredParametrizable::generateDerivativeSumDepsForComputations<Dep, T>(
100 return ConfiguredParametrizable::createVector<Dep, Self>(c, std::move (deps),
targetDimension_);
110 r = Eigen::Map<const T>(freqs.data (),
static_cast<Eigen::Index
>(freqs.size ()));
121 using namespace numeric;
128 return dynamic_cast<const Self*
>(&other) !=
nullptr;
137 auto& hmm =
static_cast<Dep&
>(*hmmDep);
138 auto buildFWithNewTransitionMatrix = [
this, &c](
NodeRef&& newTransitionMatrix) {
139 return ConfiguredParametrizable::createMatrix<Dep, Self>(c, {std::move (newTransitionMatrix)},
targetDimension_);
142 NodeRefVec derivativeSumDeps = ConfiguredParametrizable::generateDerivativeSumDepsForComputations<Dep, T>(
150 return ConfiguredParametrizable::createMatrix<Dep, Self>(c, std::move (deps),
targetDimension_);
virtual void shareParameter_(const std::shared_ptr< Parameter > ¶meter)
Context for dataflow node construction.
std::string debugInfo() const final
Node debug info (default = ""): user defined detailed info for DF graph debug.
Dimension< T > targetDimension_
void compute() final
Computation implementation.
bool compareAdditionalArguments(const Node_DF &other) const
Compare node-specific configuration to another.
EquilibriumFrequenciesFromTransitionMatrix(NodeRefVec &&deps, const Dimension< T > &dim)
NodeRef derive(Context &c, const Node_DF &node) final
Returns a node computing d(this_node_expression)/d(node_expression).
NodeRef recreate(Context &c, NodeRefVec &&deps) final
Recreate the node with different dependencies.
virtual const std::vector< double > & getEquilibriumFrequencies() const=0
Base dataflow Node class.
const NodeRef & dependency(std::size_t i) const noexcept
const NodeRefVec & dependencies() const noexcept
Dimension< T > targetDimension_
NodeRef derive(Context &c, const Node_DF &node) final
Returns a node computing d(this_node_expression)/d(node_expression).
void compute() final
Computation implementation.
NodeRef recreate(Context &c, NodeRefVec &&deps) final
Recreate the node with different dependencies.
TransitionMatrixFromTransitionMatrix(NodeRefVec &&deps, const Dimension< T > &dim)
Build a new TransitionMatrixFromTransitionMatrix node with the given output dimensions.
bool compareAdditionalArguments(const Node_DF &other) const
Compare node-specific configuration to another.
std::string debugInfo() const final
Node debug info (default = ""): user defined detailed info for DF graph debug.
Abstract Node storing a value of type T.
const Eigen::VectorXd & accessValueConst() const noexcept
Raw value access (const).
Eigen::VectorXd & accessValueMutable() noexcept
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::vector< double > Vdouble
std::string to_string(const NoDimension &)
std::vector< NodeRef > NodeRefVec
Alias for a dependency vector (of NodeRef).
template void copyBppToEigen(const std::vector< ExtendedFloat > &bppVector, Eigen::RowVectorXd &eigenVector)
std::shared_ptr< Node_DF > NodeRef
Store a dimension for type T.