77 Graph(
const Graph &other,
const std::vector<std::string> &otherNodes);
79 void createNode(std::string nodeId, std::string typeId,
void *userData =
NULL,
bool shared =
false);
80 void createPort(std::string nodeId, std::string portId,
int width = 1,
int minWidth = -1);
81 void createConnection(std::string fromNodeId, std::string fromPortId,
int fromBit, std::string toNodeId, std::string toPortId,
int toBit,
int width = 1);
82 void createConnection(std::string fromNodeId, std::string fromPortId, std::string toNodeId, std::string toPortId);
83 void createConstant(std::string toNodeId, std::string toPortId,
int toBit,
int constValue);
84 void createConstant(std::string toNodeId, std::string toPortId,
int constValue);
85 void markExtern(std::string nodeId, std::string portId,
int bit = -1);
120 virtual bool userCompareNodes(
const std::string &needleGraphId,
const std::string &needleNodeId,
void *needleUserData,
121 const std::string &haystackGraphId,
const std::string &haystackNodeId,
void *haystackUserData,
const std::map<std::string, std::string> &portMapping);
123 virtual std::string
userAnnotateEdge(
const std::string &graphId,
const std::string &fromNodeId,
void *fromUserData,
const std::string &toNodeId,
void *toUserData);
125 virtual bool userCompareEdge(
const std::string &needleGraphId,
const std::string &needleFromNodeId,
void *needleFromUserData,
const std::string &needleToNodeId,
void *needleToUserData,
126 const std::string &haystackGraphId,
const std::string &haystackFromNodeId,
void *haystackFromUserData,
const std::string &haystackToNodeId,
void *haystackToUserData);
140 void addSwappablePorts(std::string needleTypeId, std::string portId1, std::string portId2, std::string portId3 = std::string(), std::string portId4 = std::string());
144 void solve(std::vector<Result> &results, std::string needleGraphId, std::string haystackGraphId,
bool allowOverlap =
true,
int maxSolutions = -1);
145 void solve(std::vector<Result> &results, std::string needleGraphId, std::string haystackGraphId,
146 const std::map<std::string, std::set<std::string>> &initialMapping,
bool allowOverlap =
true,
int maxSolutions = -1);
148 void mine(std::vector<MineResult> &results,
int minNodes,
int maxNodes,
int minMatches,
int limitMatchesPerGraph = -1);
virtual bool userCompareNodes(const std::string &needleGraphId, const std::string &needleNodeId, void *needleUserData, const std::string &haystackGraphId, const std::string &haystackNodeId, void *haystackUserData, const std::map< std::string, std::string > &portMapping)
virtual std::string userAnnotateEdge(const std::string &graphId, const std::string &fromNodeId, void *fromUserData, const std::string &toNodeId, void *toUserData)
std::vector< Node > nodes
BitRef(int nodeIdx=-1, int portIdx=-1, int bitIdx=-1)
std::map< std::string, int > portMap
std::string needleGraphId
std::map< std::string, std::string > portMapping
void addSwappablePorts(std::string needleTypeId, std::string portId1, std::string portId2, std::string portId3=std::string(), std::string portId4=std::string())
void addCompatibleConstants(int needleConstant, int haystackConstant)
std::vector< Edge > edges
void createNode(std::string nodeId, std::string typeId, void *userData=NULL, bool shared=false)
void solve(std::vector< Result > &results, std::string needleGraphId, std::string haystackGraphId, bool allowOverlap=true, int maxSolutions=-1)
std::vector< MineResultNode > nodes
virtual bool userCompareEdge(const std::string &needleGraphId, const std::string &needleFromNodeId, void *needleFromUserData, const std::string &needleToNodeId, void *needleToUserData, const std::string &haystackGraphId, const std::string &haystackFromNodeId, void *haystackFromUserData, const std::string &haystackToNodeId, void *haystackToUserData)
virtual bool userCheckSolution(const Result &result)
void createConstant(std::string toNodeId, std::string toPortId, int toBit, int constValue)
void addGraph(std::string graphId, const Graph &graph)
void addSwappablePortsPermutation(std::string needleTypeId, std::map< std::string, std::string > portMapping)
void markExtern(std::string nodeId, std::string portId, int bit=-1)
void mine(std::vector< MineResult > &results, int minNodes, int maxNodes, int minMatches, int limitMatchesPerGraph=-1)
std::string haystackNodeId
std::set< BitRef > portBits
void createConnection(std::string fromNodeId, std::string fromPortId, int fromBit, std::string toNodeId, std::string toPortId, int toBit, int width=1)
std::string haystackGraphId
void clearOverlapHistory()
std::map< std::string, int > nodeMap
std::vector< PortBit > bits
std::map< std::string, int > matchesPerGraph
void createPort(std::string nodeId, std::string portId, int width=1, int minWidth=-1)
std::vector< Port > ports
std::map< std::string, ResultNodeMapping > mappings
int totalMatchesAfterLimits
bool operator<(const BitRef &other) const
void addCompatibleTypes(std::string needleTypeId, std::string haystackTypeId)