123 edge->connectionType = op;
133 int minCostIndex = -1;
134 int minVertexIndex = -1;
135 unsigned int minCost = ~0;
137 unsigned int edgeCost;
140 for (i = 0; i < edgeCount; ++i) {
142 if (!edge->visited) {
143 edgeCost = vertexDegree[edge->idx1] + vertexDegree[edge->idx2];
144 minVertex = (edge->idx1 < edge->idx2) ? edge->idx1 : edge->idx2;
145 if (edgeCost < minCost) {
148 minVertexIndex = minVertex;
149 }
else if ((edgeCost == minCost) && minVertex < minVertexIndex) {
152 minVertexIndex = minVertex;
160 Abc_Print(-2,
"Edge (%d,%d)/%d\n", edge->idx1, edge->idx2, edge->connectionType);
176 int nLitCap = nVars * 2;
182 int thresholdCount = 0;
200 for (w = nVars - 1; w >= 0; w--) {
213 Abc_Print(-2,
"Allocated %d literal clusters\n", nLit);
216 result =
Rpo_Recursion(target, vecLit, nLit, nLit, nVars, &thresholdCount, nThreshold, verbose);
219 for (w = 0; w < nLit; ++w) {
247 *thresholdCount = *thresholdCount + 1;
248 if (*thresholdCount == thresholdMax) {
252 Abc_Print(-2,
"Entering recursion %d\n", *thresholdCount);
255 if (nLitCount == 1) {
259 for (k = 0; k < nLit; ++k) {
260 if (vecLit[k] != NULL) {
262 copyResult =
Lit_Copy(vecLit[k], nVars);
264 Abc_Print(-2,
"FOUND!\n", thresholdCount);
272 Abc_Print(-2,
"FAILED!\n", thresholdCount);
281 for (v = 0; v < nLit; v++) {
285 edgeSize = (nLit * (nLit - 1)) / 2;
291 for (i = 0; i < nLit; ++i) {
292 if (vecLit[i] == NULL) {
295 for (j = i; j < nLit; ++j) {
296 if (vecLit[j] == NULL) {
311 edges[edgeCount++] = edge;
323 edges[edgeCount++] = edge;
328 Abc_Print(-2,
"%d edges created.\n", edgeCount);
337 Abc_Print(-2,
"There is no edges unvisited... Exiting recursion.\n");
343 edge = edges[edgeIndex];
346 minLitIndex = (edge->idx1 < edge->idx2) ? edge->idx1 : edge->idx2;
347 maxLitIndex = (edge->idx1 > edge->idx2) ? edge->idx1 : edge->idx2;
348 oldLit1 = vecLit[minLitIndex];
349 oldLit2 = vecLit[maxLitIndex];
351 vecLit[minLitIndex] = newLit;
352 vecLit[maxLitIndex] = NULL;
355 Abc_Print(-2,
"New Literal Cluster found: ");
361 result =
Rpo_Recursion(target, vecLit, nLit, (nLitCount - 1), nVars, thresholdCount, thresholdMax, verbose);
364 vecLit[minLitIndex] = oldLit1;
365 vecLit[maxLitIndex] = oldLit2;
366 if (*thresholdCount == thresholdMax) {
369 }
while (result == NULL);
375 for (i = 0; i < edgeCount; ++i) {
typedefABC_NAMESPACE_HEADER_START struct Rpo_LCI_Edge_t_ Rpo_LCI_Edge_t
INCLUDES ///.
static int Kit_TruthWordNum(int nVars)
int Rpo_CheckORGroup(Literal_t *lit1, Literal_t *lit2, int nVars)
static Literal_t * Lit_Alloc(unsigned *pTruth, int nVars, int varIdx, char pol)
static Literal_t * Lit_Copy(Literal_t *lit, int nVars)
Literal_t * Rpo_Recursion(unsigned *target, Literal_t **vecLit, int nLit, int nLitCount, int nVars, int *thresholdCount, int thresholdMax, int verbose)
#define ABC_ALLOC(type, num)
static int Kit_TruthIsEqual(unsigned *pIn0, unsigned *pIn1, int nVars)
static int Kit_TruthIsConst0(unsigned *pIn, int nVars)
static void Lit_PrintExp(Literal_t *lit)
static void Lit_Free(Literal_t *lit)
static void Kit_TruthAnd(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, int nVars)
static int Kit_TruthIsConst1(unsigned *pIn, int nVars)
Literal_t * Rpo_Factorize(unsigned *target, int nVars, int nThreshold, int verbose)
static Literal_t * Lit_CreateLiteralConst(unsigned *pTruth, int nVars, int constant)
#define ABC_NAMESPACE_IMPL_END
void Rpo_PrintEdge(Rpo_LCI_Edge_t *edge)
static Literal_t * Lit_GroupLiterals(Literal_t *lit1, Literal_t *lit2, Operator_t op, int nVars)
typedefABC_NAMESPACE_IMPL_START struct Rpo_Man_t_ Rpo_Man_t
DECLARATIONS ///.
int Rpo_computeMinEdgeCost(Rpo_LCI_Edge_t **edges, int edgeCount, int *vertexDegree)
static void Kit_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
static void Abc_Print(int level, const char *format,...)
#define ABC_NAMESPACE_IMPL_START
static void Lit_PrintTT(unsigned *tt, int nVars)
int Rpo_CheckANDGroup(Literal_t *lit1, Literal_t *lit2, int nVars)
FUNCTION DEFINITIONS ///.
Rpo_LCI_Edge_t * Rpo_CreateEdge(Operator_t op, int i, int j, int *vertexDegree)