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;
235 bool _rec_(
Pattern& p, Bijection< NodeId, NodeId >& node_map, NodeId u, NodeId v);
238 bool _not_rec_(
Pattern& p, Bijection< NodeId, NodeId >& node_map, NodeId u, NodeId v);
250 #ifndef GUM_NO_INLINE 251 # 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 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.
LabelData * _last_
The last LabelData added to 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.
const EdgeCode & edgeCode(const Arc &arc) const
Returns the EdgeCode of an edge of 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.
bool _rec_(Pattern &p, Bijection< NodeId, NodeId > &node_map, NodeId u, NodeId v)
Recurisve method used by expandCodeIsMinimal.
DFSCode _code_
The DFSCode of this Pattern.
void addArc(NodeId i, NodeId j, LabelData &l)
Add an arc to this Pattern.
NodeProperty< LabelData *> _node_map_
Mapping between nodes in this Pattern and their respective LabelData.
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...
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.
ArcProperty< std::pair< LabelData *, EdgeCode *> > _arc_map_
Mapping between edges in this Pattern and their respective LabelData.
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.
bool _not_rec_(Pattern &p, Bijection< NodeId, NodeId > &node_map, NodeId u, NodeId v)
A non recursive bugged version of rec.
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.