Constrains a node's labels for a matching. More...
#include <MC_Node.hh>
Public Types | |
enum | CompareType { ALLOWED, FORBIDDEN } |
typedef std::set< std::string > | LabelSet |
the type that defines a set of labels More... | |
Public Member Functions | |
virtual MC_NodeLabel * | 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_NodeLabel () | |
MC_NodeLabel (const size_t constrainedNodeID) | |
MC_NodeLabel (const size_t constrainedNodeID, const LabelSet &nodeLabels) | |
MC_NodeLabel (const size_t constrainedNodeID, const LabelSet &nodeLabels, const CompareType &compareType) | |
MC_NodeLabel (const MC_NodeLabel &toCopy) | |
virtual bool | operator== (const sgm::Pattern_Interface::Match_Constraint &toCompare) const |
virtual bool | operator== (const MC_NodeLabel &toCompare) const |
virtual MC_NodeLabel * | remap (const Match &old2newIndexMapping, const size_t unmatchedIndex=UINT_MAX) |
virtual | ~MC_NodeLabel () |
destruction More... | |
Data Fields | |
CompareType | compareType |
size_t | constrainedNodeID |
the node ID to be constrained More... | |
LabelSet | nodeLabels |
A match constraint that restricts the allowed matched labels for a given matched node to a set of maintained labels. Depending on the operator type, the maintained node label set describes the set of allowed labels (op =) or the set of forbidden labels (op !). The operator defaults to allowed (op =). NOTE: This constraint is only useful if the according pattern node shows a wildcard label such that it can be matched on any target node. current idea of GML encoding:
***************************************************** constrainNode [ id ::= INTEGER op ::= OPERATOR { = | ! } nodeLabels [ label ::= STRING ] ] ***************************************************** *
a missing nodeLabels/edgeLabels is used to match anything.
Examples:
***************************************************** constrainNode [ id 1 nodeLabels [ label "C" label "P" ] ] ***************************************************** *
constrains the allowed labels of the node with index 1 to "C" or "P".
Definition at line 590 of file MC_Node.hh.
typedef std::set< std::string > sgm::MC_NodeLabel::LabelSet |
Definition at line 595 of file MC_Node.hh.
Enumerator | |
---|---|
ALLOWED | |
FORBIDDEN |
Definition at line 597 of file MC_Node.hh.
|
inline |
Default construction of the match constraint : undefined values are initialized with INT_MAX or empty sets
Definition at line 618 of file MC_Node.hh.
|
inline |
construction where the allowed node labels are empty
constrainedNodeID | the node ID to be constrained |
Definition at line 626 of file MC_Node.hh.
|
inline |
construction where the allowed node labels are empty
constrainedNodeID | the node ID to be constrained |
nodeLabels | the allowed node labels to be matched on |
Definition at line 635 of file MC_Node.hh.
|
inline |
construction where the allowed node labels are empty
constrainedNodeID | the node ID to be constrained |
nodeLabels | the allowed node labels to be matched on |
compareType | the type of comparison to be applied |
Definition at line 646 of file MC_Node.hh.
|
inline |
copy construction
toCopy | the MC_NodeLabel object to copy |
Definition at line 656 of file MC_Node.hh.
|
inlinevirtual |
Definition at line 664 of file MC_Node.hh.
|
inlinevirtual |
Creates a new MC_NodeLabel 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_NodeLabel.
Definition at line 747 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 727 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 the matched node holds one of the allowed labels.
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_NodeLabel.
Definition at line 680 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 794 of file MC_Node.hh.
|
inlinevirtual |
Creates a new MC_NodeLabel 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_NodeLabel.
Definition at line 768 of file MC_Node.hh.
CompareType sgm::MC_NodeLabel::compareType |
the type of comparison to be applied, i.e. if to ensure that the edge label is among the edgeLabels (ALLOWED) or that it is not present (FORBIDDEN)
Definition at line 612 of file MC_Node.hh.
|
inherited |
Definition at line 45 of file MC_Node.hh.
LabelSet sgm::MC_NodeLabel::nodeLabels |
the set of labels this node can be mapped on NOTE: if empty, no matching will be allowed !!!
Definition at line 607 of file MC_Node.hh.