5 #ifndef BPP_GRAPH_ASSOCIATIONTREEGRAPHIMPLOBSERVER_H 6 #define BPP_GRAPH_ASSOCIATIONTREEGRAPHIMPLOBSERVER_H 20 template<
class N,
class E,
class TreeGraphImpl>
65 template<
class N2,
class E2>
124 void rootAt(
const std::shared_ptr<N> root)
135 return this->
getGraph()->isRooted();
151 bool hasFather(
const std::shared_ptr<N> nodeObject)
const 166 std::vector<std::shared_ptr<N>>
getSons(
const std::shared_ptr<N> node)
const 171 std::vector<NodeIndex>
getSons(
const NodeIndex node)
const 181 std::vector<std::shared_ptr<E>>
getBranches(
const std::shared_ptr<N> node)
const 196 std::shared_ptr<N>
getSon(
const std::shared_ptr<E> edge)
const 201 NodeIndex
getSon(
const EdgeIndex edge)
const 252 std::vector<std::shared_ptr<N>>
removeSons(
const std::shared_ptr<N> node)
260 void removeSon(
const std::shared_ptr<N> node,
const std::shared_ptr<N> son)
272 void setFather(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> fatherNodeObject,
const std::shared_ptr<E> edgeObject = 0)
288 void addSon(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> sonNodeObject,
const std::shared_ptr<E> edgeObject = 0)
305 std::unique_ptr<typename AssociationTreeGraphObserver<N, E>::NodeIterator>
sonsIterator(std::shared_ptr<N> node)
310 std::unique_ptr<typename AssociationTreeGraphObserver<N, E>::NodeIterator>
sonsIterator(std::shared_ptr<N> node)
const 319 std::unique_ptr<typename AssociationTreeGraphObserver<N, E>::EdgeIterator>
branchesIterator(std::shared_ptr<N> node)
324 std::unique_ptr<typename AssociationTreeGraphObserver<N, E>::EdgeIterator>
branchesIterator(std::shared_ptr<N> node)
const 338 std::vector<std::shared_ptr<N>>
getNodePathBetweenTwoNodes(
const std::shared_ptr<N> nodeA,
const std::shared_ptr<N> nodeB,
bool includeAncestor =
true)
const 358 std::vector<std::shared_ptr<N>>
getSubtreeNodes(
const std::shared_ptr<N> localRoot)
const 363 std::vector<std::shared_ptr<E>>
getSubtreeEdges(
const std::shared_ptr<N> localRoot)
const 383 std::shared_ptr<N>
MRCA(
const std::vector<std::shared_ptr<N>> vNodeObject)
const 385 std::vector<Graph::NodeId> vNid(vNodeObject.size());
387 std::transform(vNodeObject.begin(), vNodeObject.end(), vNid.begin(), [
this](
const std::shared_ptr<N>& nodeObject){
return this->
getNodeGraphid(nodeObject);});
395 template<
class N,
class E>
398 #endif // BPP_GRAPH_ASSOCIATIONTREEGRAPHIMPLOBSERVER_H std::vector< std::shared_ptr< N > > getLeavesUnderNode(std::shared_ptr< N > node) const
std::vector< EdgeIndex > getSubtreeEdges(const NodeIndex localRoot) const
std::vector< std::shared_ptr< N > > removeSons(const std::shared_ptr< N > node)
AssociationGraphObserver< N, E >::NodeIndex NodeIndex
AssociationTreeGraphImplObserver(bool rooted=false)
std::vector< std::shared_ptr< N > > getNodePathBetweenTwoNodes(const std::shared_ptr< N > nodeA, const std::shared_ptr< N > nodeB, bool includeAncestor=true) const
Get a vector of ancestor nodes between to nodes.
NodeGraphid getNodeGraphid(const Nref nodeObject) const
AssociationTreeGraphImplObserver(bpp::AssociationTreeGraphImplObserver< N2, E2, TreeGraphImpl > const &treeGraphObserver)
std::vector< EdgeIndex > getEdgeIndexes(std::vector< Eref > edges) const
Eref getEdgeFromGraphid(EdgeGraphid edge)
AssociationTreeGraphImplObserver(bpp::AssociationTreeGraphImplObserver< N, E, TreeGraphImpl > const &treeGraphObserver)
AssociationTreeGraphImplObserver(std::shared_ptr< TreeGraphImpl > subjectTreeGraph)
std::vector< Nref > getNodesFromGraphid(std::vector< NodeGraphid > nodes) const
void addSon(const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > sonNodeObject, const std::shared_ptr< E > edgeObject=0)
bool hasFather(const NodeIndex index) const
NodeIndex getFatherOfEdge(const EdgeIndex edge) const
Graph::NodeId NodeGraphid
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::NodeIterator > sonsIterator(std::shared_ptr< N > node)
AssociationTreeGraphImplObserver< N, E, TreeGraphImpl > * clone() const
Graph::EdgeId EdgeGraphid
EdgeGraphid getEdgeGraphid(const Eref edgeObject) const
Defines a Tree Graph Associator. It is a template which follows (subscribed to) a Graph...
std::vector< NodeIndex > getSons(const NodeIndex node) const
const std::shared_ptr< TreeGraphImpl > getGraph() const
std::vector< EdgeIndex > getBranches(const NodeIndex node) const
std::vector< Eref > getEdgesFromGraphid(std::vector< EdgeGraphid > edges) const
AssociationGraphImplObserver< N, E, GraphImpl > & operator=(bpp::AssociationGraphImplObserver< N, E, GraphImpl > const &graphObserver)
std::vector< std::shared_ptr< E > > getBranches(const std::shared_ptr< N > node) const
std::vector< std::shared_ptr< E > > getEdgePathBetweenTwoNodes(const std::shared_ptr< N > nodeA, const std::shared_ptr< N > nodeB) const
std::shared_ptr< N > getFatherOfNode(const std::shared_ptr< N > nodeObject) const
NodeIndex getNodeIndex(const Nref nodeObject) const
void removeSon(const std::shared_ptr< N > node, const std::shared_ptr< N > son)
std::shared_ptr< N > getSon(const std::shared_ptr< E > edge) const
std::vector< NodeIndex > getNodeIndexes(std::vector< Nref > nodes) const
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::NodeIterator > sonsIterator(std::shared_ptr< N > node) const
std::vector< std::shared_ptr< N > > getSubtreeNodes(const std::shared_ptr< N > localRoot) const
~AssociationTreeGraphImplObserver()
AssociationGraphObserver< N, E >::EdgeIndex EdgeIndex
size_t getNumberOfSons(const std::shared_ptr< N > node) const
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::EdgeIterator > branchesIterator(std::shared_ptr< N > node) const
std::vector< NodeIndex > getNodePathBetweenTwoNodes(const NodeIndex nodeA, const NodeIndex nodeB, bool includeAncestor=true) const
Nref getNode(NodeIndex node) const
bool hasFather(const std::shared_ptr< N > nodeObject) const
void setFather(const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > fatherNodeObject, const std::shared_ptr< E > edgeObject=0)
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::EdgeIterator > branchesIterator(std::shared_ptr< N > node)
Eref getEdge(EdgeIndex edge) const
std::vector< std::shared_ptr< N > > getSons(const std::shared_ptr< N > node) const
std::vector< NodeIndex > getSubtreeNodes(const NodeIndex localRoot) const
std::vector< NodeIndex > getLeavesUnderNode(NodeIndex node) const
Nref getNodeFromGraphid(NodeGraphid node)
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIterator > outgoingNeighborNodesIterator(Nref node)
std::shared_ptr< E > getEdgeToFather(const NodeIndex index) const
void rootAt(const std::shared_ptr< N > root)
Sets the root and make the tree directed from root to leaves.
std::vector< EdgeIndex > getEdgePathBetweenTwoNodes(const NodeIndex nodeA, const NodeIndex nodeB, bool includeAncestor=true) const
std::vector< std::shared_ptr< E > > getSubtreeEdges(const std::shared_ptr< N > localRoot) const
AssociationTreeGraphImplObserver< N, E, TreeGraphImpl > & operator=(bpp::AssociationTreeGraphImplObserver< N, E, TreeGraphImpl > const &treeGraphObserver)
std::shared_ptr< N > getFatherOfEdge(const std::shared_ptr< E > edge) const
std::shared_ptr< E > getEdgeToFather(const std::shared_ptr< N > nodeObject) const
std::shared_ptr< N > MRCA(const std::vector< std::shared_ptr< N >> vNodeObject) const
NodeIndex getSon(const EdgeIndex edge) const
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIterator > outgoingEdgesIterator(Nref node)