Generated on Wed Apr 29 2015 11:51:41 for GGL-4.1.2 by doxygen 1.8.3.1
Public Types | Public Member Functions | Data Fields
sgm::MC_NodeLabel Class Reference

Constrains a node's labels for a matching. More...

#include <MC_Node.hh>

Inheritance diagram for sgm::MC_NodeLabel:
Inheritance graph
[legend]

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_NodeLabelclone (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_NodeLabelremap (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
 

Detailed Description

    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".

Author
Martin Mann - http://www.bioinf.uni-freiburg.de/~mmann/

Definition at line 590 of file MC_Node.hh.

Member Typedef Documentation

typedef std::set< std::string > sgm::MC_NodeLabel::LabelSet

Definition at line 595 of file MC_Node.hh.

Member Enumeration Documentation

Enumerator
ALLOWED 
FORBIDDEN 

Definition at line 597 of file MC_Node.hh.

Constructor & Destructor Documentation

sgm::MC_NodeLabel::MC_NodeLabel ( )
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.

sgm::MC_NodeLabel::MC_NodeLabel ( const size_t  constrainedNodeID)
inline

construction where the allowed node labels are empty

Parameters
constrainedNodeIDthe node ID to be constrained

Definition at line 626 of file MC_Node.hh.

sgm::MC_NodeLabel::MC_NodeLabel ( const size_t  constrainedNodeID,
const LabelSet nodeLabels 
)
inline

construction where the allowed node labels are empty

Parameters
constrainedNodeIDthe node ID to be constrained
nodeLabelsthe allowed node labels to be matched on

Definition at line 635 of file MC_Node.hh.

sgm::MC_NodeLabel::MC_NodeLabel ( const size_t  constrainedNodeID,
const LabelSet nodeLabels,
const CompareType compareType 
)
inline

construction where the allowed node labels are empty

Parameters
constrainedNodeIDthe node ID to be constrained
nodeLabelsthe allowed node labels to be matched on
compareTypethe type of comparison to be applied

Definition at line 646 of file MC_Node.hh.

sgm::MC_NodeLabel::MC_NodeLabel ( const MC_NodeLabel toCopy)
inline

copy construction

Parameters
toCopythe MC_NodeLabel object to copy

Definition at line 656 of file MC_Node.hh.

virtual sgm::MC_NodeLabel::~MC_NodeLabel ( )
inlinevirtual

Definition at line 664 of file MC_Node.hh.

Member Function Documentation

virtual MC_NodeLabel* sgm::MC_NodeLabel::clone ( void  ) const
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!

Returns
a new allocated MC_NodeLabel object that equals *this

Implements sgm::MC_Node.

Reimplemented in ggl::chem::MC_MC_NodeLabel.

Definition at line 747 of file MC_Node.hh.

virtual bool sgm::MC_NodeLabel::isConstrainedLabel ( const std::string &  label) const
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.

Parameters
labelthe label of interest
Returns
true if the label is part of the constraint; false otherwise

Implements sgm::Pattern_Interface::Match_Constraint.

Definition at line 727 of file MC_Node.hh.

virtual bool sgm::MC_Node::isConstraining ( const size_t  nodeID) const
inlinevirtualinherited

Checks whether or not this constraint covers the node with the given ID.

Parameters
nodeIDthe ID of the node of interest
Returns
true if the node is covered by the constraint; false otherwise

Implements sgm::Pattern_Interface::Match_Constraint.

Definition at line 74 of file MC_Node.hh.

virtual bool sgm::MC_Node::isValidMatch ( const Pattern_Interface pattern,
const Graph_Interface target,
const Match match 
) const
inlinevirtualinherited

Checks whether or not a match on a given target fulfills the additional node constraint for the pattern matching.

Parameters
patternthe pattern graph that was matched
targetthe target graph the pattern was matched on
matchthe match information for the left side pattern of the pattern on the target graph
Returns
true if the match is valid; false if the constraint is violated

Implements sgm::Pattern_Interface::Match_Constraint.

Definition at line 140 of file MC_Node.hh.

virtual bool sgm::MC_NodeLabel::isValidMatch ( const Pattern_Interface pattern,
const Graph_Interface target,
const size_t  matchedTargetID 
) const
inlinevirtual

Checks whether or not the matched node holds one of the allowed labels.

Parameters
patternthe pattern graph that was matched
targetthe target graph the pattern was matched on
matchedTargetIDthe matched node index within the target graph
Returns
true if the match is valid; false if the constraint is violated

Implements sgm::MC_Node.

Reimplemented in ggl::chem::MC_MC_NodeLabel.

Definition at line 680 of file MC_Node.hh.

virtual bool sgm::MC_Node::operator== ( const sgm::Pattern_Interface::Match_Constraint toCompare) const
inlinevirtualinherited

Equality comparison to another match constraint.

Parameters
toComparethe constraint to compare to
Returns
true if the constraints are equal; false otherwise

Implements sgm::Pattern_Interface::Match_Constraint.

Definition at line 154 of file MC_Node.hh.

virtual bool sgm::MC_NodeLabel::operator== ( const MC_NodeLabel toCompare) const
inlinevirtual

Equality comparison to another match constraint.

Parameters
toComparethe constraint to compare to
Returns
true if the constraints are equal; false otherwise

Definition at line 794 of file MC_Node.hh.

virtual MC_NodeLabel* sgm::MC_NodeLabel::remap ( const Match old2newIndexMapping,
const size_t  unmatchedIndex = UINT_MAX 
)
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!

Parameters
old2newIndexMappingthe index mapping to be used for the remapping
unmatchedIndexan optional specific index that marks unmatched nodes within old2newIndexMapping. if this constrains one of these nodes, no remapping is done and NULL is returned
Returns
a new allocated MC_NodeLabel object

Implements sgm::MC_Node.

Reimplemented in ggl::chem::MC_MC_NodeLabel.

Definition at line 768 of file MC_Node.hh.

Field Documentation

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.

size_t sgm::MC_Node::constrainedNodeID
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.


The documentation for this class was generated from the following file: