Constrains a node's adjacency for a match. More...
#include <MC_Node.hh>
Public Types | |
typedef std::set< std::string > | LabelSet |
the type that defines a set of labels More... | |
enum | MC_Operator { MC_EQ, MC_L, MC_G, MC_LQ, MC_GQ } |
Public Member Functions | |
virtual MC_NodeAdjacency * | clone (void) const |
virtual bool | isConstrainedLabel (const std::string &label) const |
virtual bool | isConstraining (const size_t nodeID) const |
virtual bool | isValidMatch (const Pattern_Interface &pattern, const Graph_Interface &target, const Match &match) const |
virtual bool | isValidMatch (const Pattern_Interface &pattern, const Graph_Interface &target, const size_t matchedTargetID) const |
MC_NodeAdjacency () | |
MC_NodeAdjacency (const MC_NodeAdjacency &toCopy) | |
MC_NodeAdjacency (const size_t constrainedNodeID, const MC_Operator op, const size_t count, const LabelSet &nodeLabels, const LabelSet &edgeLabels) | |
MC_NodeAdjacency (const size_t constrainedNodeID, const MC_Operator op, const size_t count, const std::string &nodeLabel) | |
virtual bool | operator== (const sgm::Pattern_Interface::Match_Constraint &toCompare) const |
virtual bool | operator== (const MC_NodeAdjacency &toCompare) const |
virtual MC_NodeAdjacency * | remap (const Match &old2newIndexMapping, const size_t unmatchedIndex=UINT_MAX) |
virtual | ~MC_NodeAdjacency () |
destruction More... | |
Data Fields | |
size_t | constrainedNodeID |
the node ID to be constrained More... | |
size_t | count |
the number of adjacent nodes/edges fulfilling the label condition More... | |
LabelSet | edgeLabels |
the labels of adjacent edges that have to be counted More... | |
LabelSet | nodeLabels |
the node labels of adjacent nodes that have to be counted More... | |
MC_Operator | op |
the relational operator to be applied using 'count' More... | |
This match constraint defines the relation of the number of adjacent nodes/edges that have a certain label (combination). The constraint is fulfilled if: (N(constrainedNodeID,nodeLabels,edgeLabels) op count) where N(constrainedNodeID,nodeLabels,edgeLabels) gives the number of adjacent edges of constrainedNodeID that show a label within edgeLabels and where the connected node shows on of nodeLabels. current idea of GML encoding:
***************************************************** constrainAdj [ id ::= INTEGER op ::= '=' | '<' | '>' count ::= DIGIT+ nodeLabels [ label ::= STRING ] edgeLabels [ label ::= STRING ] ] ***************************************************** *
a missing nodeLabels/edgeLabels is used to match anything.
Examples:
***************************************************** constrainAdj [ id 5 op < count 2 nodeLabels [ "N1" "N2" ] edgeLabels [ "E" ] ] ***************************************************** *
constrains the 5th node to show less than 2 edges with label "E" that target a node with label "N1" or "N2".
Definition at line 221 of file MC_Node.hh.
typedef std::set< std::string > sgm::MC_NodeAdjacency::LabelSet |
Definition at line 237 of file MC_Node.hh.
Possible operators to be applied onto the count of matched adjacent edges and nodes.
Enumerator | |
---|---|
MC_EQ |
equality operator |
MC_L |
less operator |
MC_G |
greater operator |
MC_LQ |
less or equal operator |
MC_GQ |
greater or equal operator |
Definition at line 229 of file MC_Node.hh.
|
inline |
Default construction of the match constraint : undefined values are initialized with INT_MAX
Definition at line 260 of file MC_Node.hh.
|
inline |
Copy construction of the match constraint
toCopy | the object to make this a copy of |
Definition at line 272 of file MC_Node.hh.
|
inline |
Construction of the match constraint
constrainedNodeID | the index of the node this constraint is for |
op | the relational operator to be applied using 'count' |
count | the number of adjacent nodes/edges fulfilling the label condition |
nodeLabels | the node labels of adjacent nodes that have to be counted |
edgeLabels | the labels of adjacent edges that have to be counted |
Definition at line 289 of file MC_Node.hh.
|
inline |
Construction of the match constraint
constrainedNodeID | the index of the node this constraint is for |
op | the relational operator to be applied using 'count' |
count | the number of adjacent nodes/edges fulfilling the label condition |
nodeLabel | a single node label of adjacent nodes that has to be counted |
Definition at line 310 of file MC_Node.hh.
|
inlinevirtual |
Definition at line 325 of file MC_Node.hh.
|
inlinevirtual |
Creates a new MC_NodeAdjacency heap object that equals the current object. NOTE: YOU have to delete it later on! There is no garbage collection!
Implements sgm::MC_Node.
Reimplemented in ggl::chem::MC_MC_NodeAdjacency.
Definition at line 445 of file MC_Node.hh.
|
inlinevirtual |
Checks whether or not a given label is part of the constraint information. This check is needed by some parsers to verify the wildcard definition.
label | the label of interest |
Implements sgm::Pattern_Interface::Match_Constraint.
Definition at line 452 of file MC_Node.hh.
|
inlinevirtualinherited |
Checks whether or not this constraint covers the node with the given ID.
nodeID | the ID of the node of interest |
Implements sgm::Pattern_Interface::Match_Constraint.
Definition at line 74 of file MC_Node.hh.
|
inlinevirtualinherited |
Checks whether or not a match on a given target fulfills the additional node constraint for the pattern matching.
pattern | the pattern graph that was matched |
target | the target graph the pattern was matched on |
match | the match information for the left side pattern of the pattern on the target graph |
Implements sgm::Pattern_Interface::Match_Constraint.
Definition at line 140 of file MC_Node.hh.
|
inlinevirtual |
Checks whether or not a match on a given target fulfills the additional node adjacency constraint for the pattern matching.
pattern | the pattern graph that was matched |
target | the target graph the pattern was matched on |
matchedTargetID | the matched node index within the target graph |
Implements sgm::MC_Node.
Reimplemented in ggl::chem::MC_MC_NodeAdjacency.
Definition at line 341 of file MC_Node.hh.
|
inlinevirtualinherited |
Equality comparison to another match constraint.
toCompare | the constraint to compare to |
Implements sgm::Pattern_Interface::Match_Constraint.
Definition at line 154 of file MC_Node.hh.
|
inlinevirtual |
Equality comparison to another match constraint.
toCompare | the constraint to compare to |
Definition at line 508 of file MC_Node.hh.
|
inlinevirtual |
Creates a new MC_NodeAdjacency heap object that equals the current object but uses the new indices given by old2newIndexMapping. NOTE: YOU have to delete it later on! There is no garbage collection!
old2newIndexMapping | the index mapping to be used for the remapping |
unmatchedIndex | an optional specific index that marks unmatched nodes within old2newIndexMapping. if this constrains one of these nodes, no remapping is done and NULL is returned |
Implements sgm::MC_Node.
Reimplemented in ggl::chem::MC_MC_NodeAdjacency.
Definition at line 482 of file MC_Node.hh.
|
inherited |
Definition at line 45 of file MC_Node.hh.
size_t sgm::MC_NodeAdjacency::count |
Definition at line 248 of file MC_Node.hh.
LabelSet sgm::MC_NodeAdjacency::edgeLabels |
Definition at line 254 of file MC_Node.hh.
LabelSet sgm::MC_NodeAdjacency::nodeLabels |
Definition at line 251 of file MC_Node.hh.
MC_Operator sgm::MC_NodeAdjacency::op |
Definition at line 245 of file MC_Node.hh.