28 for (
const auto& node:vNodes)
31 auto pn = make_shared<ProcessNode>(*node, index);
38 std::vector<std::shared_ptr<PhyloBranchParam>> vB = tree.
getAllEdges();
42 const auto& bp = branch->getParameters()[0];
46 auto brref = make_shared<ProcessEdge>(index, parDF,
nullptr);
67 auto confpar = std::dynamic_pointer_cast<ConfiguredParameter>(edge->getBrLen()->recreate(
context_, {std::move(mulref)}));
68 edge->setBrLen(confpar);
77 const std::string& suff) :
84 for (
const auto& node:vNodes)
87 auto pn = make_shared<ProcessNode>(*node, index);
94 std::vector<std::shared_ptr<PhyloBranchParam>> vB = tree.
getAllEdges();
98 const auto& bp = branch->getParameters()[0];
100 std::string name = bp.getName() + suff;
104 throw Exception(
"makeTreeNode: unknown ConfiguredParameter " + name);
106 name = bp.getName() +
"_1";
111 throw Exception(
"ProcessTree::ProcessTree: unknown ConfiguredParameter " + name);
116 auto brref = make_shared<ProcessEdge>(index, parDF,
nullptr);
131 for (
const auto& node:vNodes)
133 auto pn = make_shared<ProcessNode>(*node);
142 for (
const auto& edge:vEdges)
144 std::shared_ptr<ProcessEdge> brref;
147 uint spIndex = edge->getSpeciesIndex();
151 auto model = edge->getModel();
154 brref = make_shared<ProcessEdge>(spIndex,
nullptr);
160 if (!modelColl.
hasObject(edge->getModelNumber()))
163 std::shared_ptr<ConfiguredModel> pmodel = dynamic_pointer_cast<ConfiguredModel>(modelColl[edge->getModelNumber()]);
165 auto vNb = edge->subModelNumbers();
167 throw Exception(
"ProcessTree::ProcessTree : only simple submodels are used, not combinations. Ask developers");
169 if (!edge->useProb())
171 if (!phyloTree.
hasEdge(spIndex))
174 auto edge2 = phyloTree.
getEdge(spIndex);
176 brref = make_shared<ProcessEdge>(spIndex, edge2->getBrLen(), pmodel);
180 brref = make_shared<ProcessEdge>(spIndex, edge2->getBrLen(), pmodel, nMod);
191 brref = make_shared<ProcessEdge>(spIndex, brprob);
216 std::shared_ptr<const SubstitutionProcessInterface> process,
218 const std::string& suff)
220 auto parTree = process->getParametrizablePhyloTree();
223 throw Exception(
"ProcessTree::makeProcessTree: missing Tree in process.");
233 return std::make_shared<ProcessTree>(tree, modelColl, pt);
241 for (
auto& branch:vB)
243 if (branch->getSpeciesIndex() == speciesIndex)
virtual std::unique_ptr< EdgeIterator > allEdgesIterator()=0
virtual NodeGraphid getNodeGraphid(const std::shared_ptr< N > nodeObject) const=0
virtual std::vector< std::shared_ptr< E > > getAllEdges() const=0
virtual NodeIndex setNodeIndex(const std::shared_ptr< N > nodeObject, NodeIndex index)=0
virtual void associateNode(std::shared_ptr< N > nodeObject, NodeGraphid node)=0
virtual EdgeIndex getEdgeIndex(const std::shared_ptr< E > edgeObject) const=0
virtual EdgeGraphid getEdgeGraphid(const std::shared_ptr< E > edgeObject) const=0
virtual std::vector< std::shared_ptr< N > > getAllNodes() const=0
virtual EdgeIndex setEdgeIndex(const std::shared_ptr< E > edgeObject, EdgeIndex index)=0
virtual NodeIndex getNodeIndex(const std::shared_ptr< N > nodeObject) const=0
virtual std::shared_ptr< E > getEdge(EdgeIndex edgeIndex) const=0
virtual bool hasEdge(EdgeIndex edgeIndex) const=0
virtual void associateEdge(std::shared_ptr< E > edgeObject, EdgeGraphid edge)=0
ParametrizableCollection< ConfiguredModel > & getModelCollection()
const SubstitutionProcessCollection & collection() const
std::shared_ptr< ProcessTree > getProcessTree(size_t treeIndex)
r = 1 for each component.
Context for dataflow node construction.
static std::shared_ptr< Self > create(Context &c, Args &&... args)
Build a new NumericConstant node with T(args...) value.
virtual bool hasParameter(const std::string &name) const
virtual const std::shared_ptr< Parameter > & getParameter(size_t i) const
bool hasObject(size_t objectIndex) const
PhyloTree with Parametrizable Phylo Branches. They SHARE their branch length parameters.
static std::shared_ptr< Self > create(Context &c, NodeRefVec &&deps, size_t nCat)
Tree Organization of Computing Nodes.
static std::shared_ptr< ProcessTree > makeProcessTree(Context &context, std::shared_ptr< const SubstitutionProcessInterface > process, ParameterList &parList, const std::string &suff="")
Create a Process Tree following a Substitution Process. Tree Node parameters are got from ConfiguredP...
ProcessTree(Context &context, const ParametrizablePhyloTree &tree)
Build a ProcessTree with same topology as a given ParametrizablePhyloTree, and new ConfiguredParamete...
DAGindexes getDAGEdgesIndexes(const Speciesindex speciesIndex) const
std::shared_ptr< SubstitutionProcessCollectionMember > getSubstitutionProcess(size_t i)
std::string toString(T t)
Defines the basic types of data flow nodes.
std::shared_ptr< Value< T > > ValueRef
Shared pointer alias for Value<T>.
std::vector< uint > DAGindexes
Helper: create a map with mutable dataflow nodes for each branch of the tree. The map is indexed by b...
ParametrizableCollection< ConfiguredModel > makeConfiguredModelCollection(Context &context, const SubstitutionProcessInterface &process, ParameterList &parList)
Make a Collection of ConfiguredModel, from the models described in the SubstitutionProcess,...
Specialisation of Dimension<T> for floating point types.