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_EdgeLabel Class Referenceabstract

Constrains edge labels within a match. More...

#include <MC_Edge.hh>

Inheritance diagram for sgm::MC_EdgeLabel:
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_EdgeLabelclone (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
 
 MC_EdgeLabel ()
 
 MC_EdgeLabel (const size_t constrainedFromID, const size_t constrainedToID)
 
 MC_EdgeLabel (const size_t constrainedFromID, const size_t constrainedToID, const LabelSet &edgeLabels)
 
 MC_EdgeLabel (const size_t constrainedFromID, const size_t constrainedToID, const LabelSet &edgeLabels, const CompareType &compareType)
 
 MC_EdgeLabel (const MC_EdgeLabel &toCopy)
 
virtual bool operator== (const Match_Constraint &toCompare) const =0
 
virtual bool operator== (const Match_Constraint &toCompare) const
 
virtual MC_EdgeLabelremap (const Match &old2newIndexMapping, const size_t unmatchedIndex=UINT_MAX)
 
virtual ~MC_EdgeLabel ()
 destruction More...
 

Data Fields

CompareType compareType
 
size_t constrainedFromID
 the source ID of the edge to be constrained More...
 
size_t constrainedToID
 the target ID of the edge to be constrained More...
 
LabelSet edgeLabels
 

Detailed Description

    A match constraint that restricts the allowed matched labels for a given
    matched edge to a set of maintained labels.

    Via the operator it is defined whether the given set of edge labels is
    the allowed (op =) or forbidden (op !) set of labels for the edge. It
    defaults to allowed (op =).

    NOTE: This constraint is only useful if the according pattern edge shows
          a wildcard label such that it can be matched on any target edge.

    NOTE: if there is NO EDGE between the nodes, the constraint fails!

     Current idea of GML encoding:
*****************************************************
 constrainEdge [
   source   ::= INTEGER
   target   ::= INTEGER
   op       ::= OPERATOR { = | ! }
   edgeLabels [
     label ::= STRING
   ]
 ]
*****************************************************
Author
Martin Mann - http://www.bioinf.uni-freiburg.de/~mmann/

Definition at line 330 of file MC_Edge.hh.

Member Typedef Documentation

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

Definition at line 335 of file MC_Edge.hh.

Member Enumeration Documentation

Enumerator
ALLOWED 
FORBIDDEN 

Definition at line 337 of file MC_Edge.hh.

Constructor & Destructor Documentation

sgm::MC_EdgeLabel::MC_EdgeLabel ( )
inline

Default construction of the match constraint : undefined values are initialized with INT_MAX or empty sets

Definition at line 361 of file MC_Edge.hh.

sgm::MC_EdgeLabel::MC_EdgeLabel ( const size_t  constrainedFromID,
const size_t  constrainedToID 
)
inline

construction where the allowed node labels are empty

Parameters
constrainedFromIDthe source node ID to be constrained
constrainedToIDthe target node ID to be constrained

Definition at line 370 of file MC_Edge.hh.

sgm::MC_EdgeLabel::MC_EdgeLabel ( const size_t  constrainedFromID,
const size_t  constrainedToID,
const LabelSet edgeLabels 
)
inline

construction where the allowed node labels are empty

Parameters
constrainedFromIDthe source node ID to be constrained
constrainedToIDthe target node ID to be constrained
edgeLabelsthe allowed node labels to be matched on

Definition at line 381 of file MC_Edge.hh.

sgm::MC_EdgeLabel::MC_EdgeLabel ( const size_t  constrainedFromID,
const size_t  constrainedToID,
const LabelSet edgeLabels,
const CompareType compareType 
)
inline

construction where the allowed node labels are empty

Parameters
constrainedFromIDthe source node ID to be constrained
constrainedToIDthe target node ID to be constrained
edgeLabelsthe allowed node labels to be matched on
compareTypethe type of comparison to be applied

Definition at line 394 of file MC_Edge.hh.

sgm::MC_EdgeLabel::MC_EdgeLabel ( const MC_EdgeLabel toCopy)
inline

copy construction

Parameters
toCopythe MC_EdgeLabel object to copy

Definition at line 405 of file MC_Edge.hh.

virtual sgm::MC_EdgeLabel::~MC_EdgeLabel ( )
inlinevirtual

Definition at line 413 of file MC_Edge.hh.

Member Function Documentation

virtual MC_EdgeLabel* sgm::MC_EdgeLabel::clone ( void  ) const
inlinevirtual

Creates a new MC_EdgeLabel 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_EdgeLabel object that equals *this

Implements sgm::MC_Edge.

Definition at line 520 of file MC_Edge.hh.

virtual bool sgm::MC_EdgeLabel::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 501 of file MC_Edge.hh.

virtual bool sgm::MC_Edge::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 69 of file MC_Edge.hh.

virtual bool sgm::MC_EdgeLabel::isValidMatch ( const Pattern_Interface pattern,
const Graph_Interface target,
const Match match 
) const
inlinevirtual

Checks whether or not the matched edges between two nodes show one of the allowed labels or are not showing any of the forbidden labels.

NOTE: if there is NO EDGE between the node, the constraint fails!

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 432 of file MC_Edge.hh.

virtual bool sgm::Pattern_Interface::Match_Constraint::operator== ( const Match_Constraint toCompare) const
pure virtualinherited

Equality comparison to another match constraint.

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

Implemented in sgm::MC_Node.

virtual bool sgm::MC_EdgeLabel::operator== ( const Match_Constraint toCompare) const
inlinevirtual

Equality comparison to another match constraint.

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

Reimplemented from sgm::MC_Edge.

Definition at line 570 of file MC_Edge.hh.

virtual MC_EdgeLabel* sgm::MC_EdgeLabel::remap ( const Match old2newIndexMapping,
const size_t  unmatchedIndex = UINT_MAX 
)
inlinevirtual

Creates a new MC_EdgeLabel 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_EdgeLabel object

Implements sgm::MC_Edge.

Definition at line 541 of file MC_Edge.hh.

Field Documentation

CompareType sgm::MC_EdgeLabel::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 355 of file MC_Edge.hh.

size_t sgm::MC_Edge::constrainedFromID
inherited

Definition at line 33 of file MC_Edge.hh.

size_t sgm::MC_Edge::constrainedToID
inherited

Definition at line 36 of file MC_Edge.hh.

LabelSet sgm::MC_EdgeLabel::edgeLabels

the set of labels this node can be mapped on NOTE: if empty, no matching will be allowed !!!

Definition at line 350 of file MC_Edge.hh.


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