1 #ifndef SGM_MC_NODE_HH_
2 #define SGM_MC_NODE_HH_
15 #if HAVE_UNORDERED_MAP > 0
16 #include <unordered_map>
17 #elif HAVE_TR1_UNORDERED_MAP > 0
18 #include <tr1/unordered_map>
19 #elif HAVE_GNU_HASH_MAP > 0
20 #include <ext/hash_map>
50 : constrainedNodeID(constrainedNodeID)
89 clone(
void )
const = 0;
106 remap(
const Match & old2newIndexMapping,
const size_t unmatchedIndex = UINT_MAX ) = 0;
124 const size_t matchedTargetID )
const = 0;
142 const Match & match )
const
263 ,
count((size_t)INT_MAX)
298 , nodeLabels(nodeLabels)
299 , edgeLabels(edgeLabels)
313 ,
const std::string & nodeLabel )
343 const size_t matchedTargetID )
const
362 #if HAVE_UNORDERED_MAP > 0
363 std::unordered_map<Graph_Interface::IndexType, char>
364 #elif HAVE_TR1_UNORDERED_MAP > 0
365 std::tr1::unordered_map<Graph_Interface::IndexType, char>
366 #elif HAVE_GNU_HASH_MAP > 0
367 __gnu_cxx::hash_map<Graph_Interface::IndexType, char>
369 std::map<Graph_Interface::IndexType, char>
376 curEdge != curEdgeEnd; ++curEdge )
379 if (observedNodes.find(curEdge->getToIndex()) == observedNodes.end()) {
381 observedNodes[curEdge->getToIndex()] =
'T';
392 const bool allNodes =
nodeLabels.empty() || nodeWildcard;
394 const bool allEdges =
edgeLabels.empty() || edgeWildcard;
397 if ( allNodes && allEdges )
402 curEdge != curEdgeEnd; ++curEdge )
411 curEdge != curEdgeEnd; ++curEdge )
425 case MC_L :
return ( hits <
count );
break;
426 case MC_G :
return ( hits >
count );
break;
429 default : assert(
false );
456 if (l->compare(label)==0)
460 if (l->compare(label)==0)
482 remap(
const Match & old2newIndexMapping,
const size_t unmatchedIndex = UINT_MAX )
487 if (old2newIndexMapping.at(this->constrainedNodeID) == unmatchedIndex)
514 && this->
op == pc->
op
520 for (LabelSet::const_iterator l=this->
nodeLabels.begin();
526 for (LabelSet::const_iterator l=this->
edgeLabels.begin();
638 , nodeLabels( nodeLabels )
650 , nodeLabels( nodeLabels )
651 , compareType( compareType )
682 const size_t matchedTargetID )
const
731 if (l->compare(label)==0)
768 remap(
const Match & old2newIndexMapping,
const size_t unmatchedIndex = UINT_MAX )
773 if (old2newIndexMapping.at(this->constrainedNodeID) == unmatchedIndex)
804 for (LabelSet::const_iterator l=this->
nodeLabels.begin();