32 #include <agrum/agrum.h> 34 #include <agrum/tools/graphs/diGraph.h> 36 #include <agrum/PRM/gspan/DFSCode.h> 37 #include <agrum/PRM/gspan/interfaceGraph.h> 43 class NeighborIterator;
137 void addArc(NodeId i, NodeId j, LabelData& l);
140 bool exists(NodeId id)
const;
143 bool exists(NodeId tail, NodeId head)
const;
236 Bijection< NodeId, NodeId >& node_map,
242 Bijection< NodeId, NodeId >& node_map,
256 #ifndef GUM_NO_INLINE 257 # include <agrum/PRM/gspan/pattern_inl.h> EdgeCode & edgeCode(NodeId tail, NodeId head)
Returns the EdgeCode of an edge of this Pattern.
const LabelData & label(NodeId i, NodeId j) const
Returns the LabelData assigned to arc.
const LabelData & label(const Arc &arc) const
Returns the LabelData assigned to arc.
Pattern()
Default constructor.
INLINE void emplace(Args &&... args)
const LabelData & lastAdded() const
Insert a node with the given LabelData.
DFSCode & code()
Returns the DFSCode of this Pattern.
NodeId addNodeWithLabel(LabelData &l)
Insert a node with the given LabelData.
bool rec__(Pattern &p, Bijection< NodeId, NodeId > &node_map, NodeId u, NodeId v)
Recurisve method used by expandCodeIsMinimal__.
bool exists(NodeId tail, NodeId head) const
Returns true if (tail, head) is an arc in this Pattern.
bool isMinimal()
Returns the DFSCode of this Pattern.
EdgeCode & edgeCode(const Arc &arc)
Returns the EdgeCode of an edge of this Pattern.
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
Size size() const
Returns the number of nodes in this Pattern.
std::string toDot(size_t name) const
Print the pattern in the DOT syntax.
ParamScopeData(const std::string &s, const PRMReferenceSlot< GUM_SCALAR > &ref, Idx d)
const DFSCode & code() const
Returns the DFSCode of this Pattern.
bool expandCodeIsMinimal__(NodeId u, NodeId v)
Returns true if the expand code by adding and edge betwenne u and v is minimal with respect to code__...
const EdgeCode & edgeCode(const Arc &arc) const
Returns the EdgeCode of an edge of this Pattern.
LabelData * last__
The last LabelData added to this pattern.
LabelData & lastAdded()
Insert a node with the given LabelData.
const NodeGraphPart & nodes() const
void rightmostPath(std::list< NodeId > &r_path) const
Fill r_path with the rightmost path of this Pattern. The list is supposed empty.
const ArcSet & arcs() const
void pop_back()
Remove the last EdgeCode of this pattern.
LabelData & label(const Arc &arc)
Returns the LabelData assigned to arc.
DFSCode code__
The DFSCode of this Pattern.
ArcProperty< std::pair< LabelData *, EdgeCode *> > arc_map__
Mapping between edges in this Pattern and their respective LabelData.
void addArc(NodeId i, NodeId j, LabelData &l)
Add an arc to this Pattern.
bool exists(NodeId id) const
Returns true if id is a node in this Pattern.
const LabelData & label(NodeId node) const
Returns the LabelData assigned to node.
Pattern(const Pattern &source)
Copy constructor.
const EdgeCode & edgeCode(NodeId tail, NodeId head) const
Returns the EdgeCode of an edge of this Pattern.
void remove(NodeId node)
Remove a node if it has no neighbors, raise an OperationNotAllowed otherwise.
Size sizeArcs() const
Returns the number of arcs in this Pattern.
LabelData & label(NodeId i, NodeId j)
Returns the LabelData assigned to arc.
INLINE std::ostream & operator<<(std::ostream &out, const EdgeData< GUM_SCALAR > &data)
Print a EdgeData<GUM_SCALAR> in out.
NodeProperty< LabelData *> node_map__
Mapping between nodes in this Pattern and their respective LabelData.
bool not_rec__(Pattern &p, Bijection< NodeId, NodeId > &node_map, NodeId u, NodeId v)
A non recursive bugged version of rec__.