28 #define MAX_SIZE_LOOKAHEAD 20
37 int piVarsC1[],
int piVarsC2[],
int nVarsC1,
int nVarsC2 );
39 int piVarsC1[],
int piVarsC2[],
int * pnVarsC1,
int * pnVarsC2 );
78 if ( pSingles[nSingles] == NULL )
82 for ( i = 0; i < nSingles; i++ )
91 if ( pDoubles[nDoubles] == NULL )
95 for ( i = 0; i < nDoubles; i++ )
100 for ( i = 0; i < nSingles; i++ )
105 for ( i = 0; i < nDoubles; i++ )
128 for ( i = 0; i < nSingles; i++ )
130 WeightCur = pSingles[i]->
Weight;
134 WeightCur += pSCompl[i]->
Weight;
139 if ( WeightBest < WeightCur )
141 WeightBest = WeightCur;
142 *ppSingle = pSingles[i];
143 *ppDouble = pSCompl[i];
148 for ( i = 0; i < nDoubles; i++ )
150 WeightCur = pDoubles[i]->
Weight;
154 WeightCur += pDComplS[i]->
Weight;
159 if ( WeightBest < WeightCur )
161 WeightBest = WeightCur;
162 *ppSingle = pDComplS[i];
163 *ppDouble = pDoubles[i];
232 if ( iVar1C == -1 || iVar2C == -1 )
234 assert( iVar1C < iVar2C );
252 int piVarsC1[10], piVarsC2[10];
253 int nVarsC1, nVarsC2;
254 int iVar1, iVar2, iVarTemp;
268 if ( iVar1C == -1 || iVar2C == -1 )
273 if ( iVar1C > iVar2C )
300 int piVarsC1[10], piVarsC2[10];
301 int nVarsC1, nVarsC2;
302 int iVar11, iVar12, iVar21, iVar22;
303 int iVar11C, iVar12C, iVar21C, iVar22C;
308 assert( nVarsC1 == 2 && nVarsC2 == 2 );
310 iVar11 = piVarsC1[0];
311 iVar12 = piVarsC1[1];
312 iVar21 = piVarsC2[0];
313 iVar22 = piVarsC2[1];
314 assert( iVar11 < iVar21 );
320 if ( iVar11C == -1 || iVar12C == -1 || iVar21C == -1 || iVar22C == -1 )
322 if ( iVar11C != iVar21 || iVar12C != iVar22 ||
323 iVar21C != iVar11 || iVar22C != iVar12 )
329 RetValue = piVarsC1[1];
330 piVarsC1[1] = piVarsC2[1];
331 piVarsC2[1] = RetValue;
404 int piVarsC1[],
int piVarsC2[],
int * pnVarsC1,
int * pnVarsC2 )
419 if ( pLit1 && pLit2 )
426 else if ( pLit1->
iVar < pLit2->
iVar )
428 piVarsC1[nLits1++] = pLit1->
iVar;
433 piVarsC2[nLits2++] = pLit2->
iVar;
437 else if ( pLit1 && !pLit2 )
439 piVarsC1[nLits1++] = pLit1->
iVar;
442 else if ( !pLit1 && pLit2 )
444 piVarsC2[nLits2++] = pLit2->
iVar;
467 int piVarsC1[],
int piVarsC2[],
int nVarsC1,
int nVarsC2 )
469 int piVarsC1_[100], piVarsC2_[100];
470 int nVarsC1_, nVarsC2_, i;
477 assert( piVarsC1[0] < piVarsC2[0] );
483 Key %= p->nTableSize;
487 if ( pPair->
nLits1 != nVarsC1 )
489 if ( pPair->
nLits2 != nVarsC2 )
494 for ( i = 0; i < nVarsC1; i++ )
495 if ( piVarsC1[i] != piVarsC1_[i] )
500 for ( i = 0; i < nVarsC2; i++ )
501 if ( piVarsC2[i] != piVarsC2_[i] )
552 for ( pLitH = pLitV->
pHNext; pLitH; pLitH = pLitH->
pHNext )
580 WeightCur = Coin - 2;
583 if ( WeightBest < WeightCur )
585 WeightBest = WeightCur;
void Fxu_HeapSingleInsert(Fxu_HeapSingle *p, Fxu_Single *pSingle)
#define Fxu_MatrixForEachVarInRingSafe(Matrix, Var, Var2)
#define Fxu_MatrixRingVarsReset(Matrix)
Fxu_Single * Fxu_HeapSingleGetMax(Fxu_HeapSingle *p)
#define Fxu_MatrixForEachVarInRing(Matrix, Var)
#define Fxu_MatrixForEachSingle(Matrix, Single)
int Fxu_SelectSCD(Fxu_Matrix *p, int WeightLimit, Fxu_Var **ppVar1, Fxu_Var **ppVar2)
Fxu_Double * Fxu_HeapDoubleGetMax(Fxu_HeapDouble *p)
static Fxu_Single * Fxu_MatrixFindComplementDouble2(Fxu_Matrix *p, Fxu_Double *pDouble)
#define Fxu_MatrixForEachVariable(Matrix, Var)
unsigned Fxu_PairHashKeyArray(Fxu_Matrix *p, int piVarsC1[], int piVarsC2[], int nVarsC1, int nVarsC2)
#define Fxu_MatrixRingVarsStart(Matrix)
#define ABC_NAMESPACE_IMPL_END
#define MAX_SIZE_LOOKAHEAD
DECLARATIONS ///.
#define Fxu_MatrixRingVarsAdd(Matrix, Var)
#define Fxu_TableForEachDouble(Matrix, Key, Div)
#define ABC_NAMESPACE_IMPL_START
Fxu_Double * Fxu_MatrixFindDouble(Fxu_Matrix *p, int piVarsC1[], int piVarsC2[], int nVarsC1, int nVarsC2)
int Fxu_SingleCountCoincidence(Fxu_Matrix *p, Fxu_Var *pVar1, Fxu_Var *pVar2)
static Fxu_Double * Fxu_MatrixFindComplementSingle(Fxu_Matrix *p, Fxu_Single *pSingle)
void Fxu_MatrixGetDoubleVars(Fxu_Matrix *p, Fxu_Double *pDouble, int piVarsC1[], int piVarsC2[], int *pnVarsC1, int *pnVarsC2)
static int Fxu_MatrixFindComplement(Fxu_Matrix *p, int iVar)
void Fxu_HeapDoubleInsert(Fxu_HeapDouble *p, Fxu_Double *pDiv)
int Fxu_Select(Fxu_Matrix *p, Fxu_Single **ppSingle, Fxu_Double **ppDouble)
FUNCTION DEFINITIONS ///.
#define Fxu_MatrixRingVarsStop(Matrix)
typedefABC_NAMESPACE_HEADER_START struct FxuMatrix Fxu_Matrix
INCLUDES ///.
static Fxu_Double * Fxu_MatrixFindComplementDouble4(Fxu_Matrix *p, Fxu_Double *pDouble)