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_NodeAdjacency Class Reference

Constrains a node's adjacency for a match. More...

#include <MC_Node.hh>

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

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_NodeAdjacencyclone (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_NodeAdjacencyremap (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...
 

Detailed Description

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

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

Definition at line 221 of file MC_Node.hh.

Member Typedef Documentation

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

Definition at line 237 of file MC_Node.hh.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

sgm::MC_NodeAdjacency::MC_NodeAdjacency ( )
inline

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

Definition at line 260 of file MC_Node.hh.

sgm::MC_NodeAdjacency::MC_NodeAdjacency ( const MC_NodeAdjacency toCopy)
inline

Copy construction of the match constraint

Parameters
toCopythe object to make this a copy of

Definition at line 272 of file MC_Node.hh.

sgm::MC_NodeAdjacency::MC_NodeAdjacency ( const size_t  constrainedNodeID,
const MC_Operator  op,
const size_t  count,
const LabelSet nodeLabels,
const LabelSet edgeLabels 
)
inline

Construction of the match constraint

Parameters
constrainedNodeIDthe index of the node this constraint is for
opthe relational operator to be applied using 'count'
countthe number of adjacent nodes/edges fulfilling the label condition
nodeLabelsthe node labels of adjacent nodes that have to be counted
edgeLabelsthe labels of adjacent edges that have to be counted

Definition at line 289 of file MC_Node.hh.

sgm::MC_NodeAdjacency::MC_NodeAdjacency ( const size_t  constrainedNodeID,
const MC_Operator  op,
const size_t  count,
const std::string &  nodeLabel 
)
inline

Construction of the match constraint

Parameters
constrainedNodeIDthe index of the node this constraint is for
opthe relational operator to be applied using 'count'
countthe number of adjacent nodes/edges fulfilling the label condition
nodeLabela single node label of adjacent nodes that has to be counted

Definition at line 310 of file MC_Node.hh.

virtual sgm::MC_NodeAdjacency::~MC_NodeAdjacency ( )
inlinevirtual

Definition at line 325 of file MC_Node.hh.

Member Function Documentation

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

Returns
a new allocated MC_NodeAdjacency object that equals *this

Implements sgm::MC_Node.

Reimplemented in ggl::chem::MC_MC_NodeAdjacency.

Definition at line 445 of file MC_Node.hh.

virtual bool sgm::MC_NodeAdjacency::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 452 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_NodeAdjacency::isValidMatch ( const Pattern_Interface pattern,
const Graph_Interface target,
const size_t  matchedTargetID 
) const
inlinevirtual

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

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

Definition at line 341 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_NodeAdjacency::operator== ( const MC_NodeAdjacency 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 508 of file MC_Node.hh.

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

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_NodeAdjacency object

Implements sgm::MC_Node.

Reimplemented in ggl::chem::MC_MC_NodeAdjacency.

Definition at line 482 of file MC_Node.hh.

Field Documentation

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


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