66 #define Llb_MgrForEachVar( p, pVar, i ) \
67 for ( i = 0; (i < p->nVars) && (((pVar) = Llb_MgrVar(p, i)), 1); i++ ) if ( pVar == NULL ) {} else
69 #define Llb_MgrForEachPart( p, pPart, i ) \
70 for ( i = 0; (i < p->iPartFree) && (((pPart) = Llb_MgrPart(p, i)), 1); i++ ) if ( pPart == NULL ) {} else
73 #define Llb_PartForEachVar( p, pPart, pVar, i ) \
74 for ( i = 0; (i < Vec_IntSize(pPart->vVars)) && (((pVar) = Llb_MgrVar(p, Vec_IntEntry(pPart->vVars,i))), 1); i++ )
76 #define Llb_VarForEachPart( p, pVar, pPart, i ) \
77 for ( i = 0; (i < Vec_IntSize(pVar->vParts)) && (((pPart) = Llb_MgrPart(p, Vec_IntEntry(pVar->vParts,i))), 1); i++ )
101 p->
pVars[pVar->iVar] = NULL;
236 printf(
"Var %3d : ", i );
238 printf(
"%d ", pPart->
iPart );
243 printf(
"Part %3d : ", i );
245 printf(
"%d ", pVar->iVar );
267 int i, RetValue, nSizeNew;
280 if ( p->
pSupp[pVar->iVar] )
283 pVar->nScore -= pPart->
nSize - nSizeNew;
289 pVar->nScore -= pPart->
nSize;
297 pPart->
nSize = nSizeNew;
299 for ( i = 0; i < p->
nVars; i++ )
327 int i, RetValue, nSuppSize;
330 int liveBeg, liveEnd;
342 printf(
"Conjoining partitions %d and %d.\n", pPart1->
iPart, pPart2->
iPart );
366 pTemp->
bFunc = bFunc;
373 pVar->nScore -= pPart1->
nSize;
380 pVar->nScore -= pPart2->
nSize;
385 for ( i = 0; i < p->
nVars; i++ )
387 nSuppSize += p->
pSupp[i];
391 pVar->nScore += pTemp->
nSize;
406 printf(
"Adding partition %d because of var %d.\n",
420 printf(
"Adding partition %d because of var %d.\n",
434 printf(
"Updating partitiong %d with singlton vars.\n", pTemp->
iPart );
512 if ( p->
pVars[iVar] == NULL )
515 p->
pVars[iVar]->iVar = iVar;
516 p->
pVars[iVar]->nScore = 0;
547 for ( k = 0; k < p->
nVars; k++ )
549 nSuppSize += p->
pSupp[k];
588 Llb_Prt_t * pPart, * pPart1Best = NULL, * pPart2Best = NULL;
597 if ( pVarBest == NULL || pVarBest->nScore > pVar->nScore )
602 if ( pVarBest == NULL )
607 if ( pPart1Best == NULL )
609 else if ( pPart2Best == NULL )
611 else if ( pPart1Best->
nSize > pPart->
nSize || pPart2Best->nSize > pPart->
nSize )
613 if ( pPart1Best->
nSize > pPart2Best->nSize )
623 *ppPart1 = pPart1Best;
624 *ppPart2 = pPart2Best;
650 pVar->nScore += pPart->
nSize;
676 nScore += pPart->
nSize;
677 assert( nScore == pVar->nScore );
DdNode * Llb_Nonlin4CreateCube1(Llb_Mgr_t *p, Llb_Prt_t *pPart)
void Llb_Nonlin4Free(Llb_Mgr_t *p)
void Llb_Nonlin4RemovePart(Llb_Mgr_t *p, Llb_Prt_t *pPart)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
void Llb_Nonlin4CutNodes_rec(Aig_Man_t *p, Aig_Obj_t *pObj, Vec_Ptr_t *vNodes)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
static Llb_Var_t * Llb_MgrVar(Llb_Mgr_t *p, int i)
static int Aig_ObjIsTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
void Cudd_Deref(DdNode *node)
int Cudd_ReadReorderings(DdManager *dd)
#define Cudd_IsConstant(node)
DdNode * Cudd_bddExistAbstract(DdManager *manager, DdNode *f, DdNode *cube)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
void Llb_Nonlin4AddPartition(Llb_Mgr_t *p, int i, DdNode *bFunc)
#define ABC_ALLOC(type, num)
void Llb_Nonlin4VerifyScores(Llb_Mgr_t *p)
static int Abc_MaxInt(int a, int b)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static int Vec_PtrSize(Vec_Ptr_t *p)
static Llb_Prt_t * Llb_MgrPart(Llb_Mgr_t *p, int i)
static void Aig_ObjSetTravIdCurrent(Aig_Man_t *p, Aig_Obj_t *pObj)
int Cudd_ReadSize(DdManager *dd)
static int Saig_ObjIsLi(Aig_Man_t *p, Aig_Obj_t *pObj)
void Aig_ManIncrementTravId(Aig_Man_t *p)
DECLARATIONS ///.
void Llb_Nonlin4RemoveVar(Llb_Mgr_t *p, Llb_Var_t *pVar)
FUNCTION DEFINITIONS ///.
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
#define Cudd_IsComplement(node)
typedefABC_NAMESPACE_IMPL_START struct Llb_Var_t_ Llb_Var_t
DECLARATIONS ///.
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
int Llb_Nonlin4NextPartitions(Llb_Mgr_t *p, Llb_Prt_t **ppPart1, Llb_Prt_t **ppPart2)
Vec_Ptr_t * Llb_Nonlin4Group(DdManager *dd, Vec_Ptr_t *vParts, Vec_Int_t *vVars2Q, int nSizeMax)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
static int Aig_ObjIsConst1(Aig_Obj_t *pObj)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
DdNode * Cudd_bddAndAbstract(DdManager *manager, DdNode *f, DdNode *g, DdNode *cube)
void Llb_Nonlin4RecomputeScores(Llb_Mgr_t *p)
DdNode * Llb_Nonlin4Image(DdManager *dd, Vec_Ptr_t *vParts, DdNode *bCurrent, Vec_Int_t *vVars2Q)
#define Llb_MgrForEachVar(p, pVar, i)
Llb_Mgr_t * Llb_Nonlin4Alloc(DdManager *dd, Vec_Ptr_t *vParts, DdNode *bCurrent, Vec_Int_t *vVars2Q, int nSizeMax)
static int Vec_IntRemove(Vec_Int_t *p, int Entry)
#define ABC_NAMESPACE_IMPL_START
DdNode * Cudd_ReadOne(DdManager *dd)
static int Vec_IntSize(Vec_Int_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Llb_MgrForEachPart(p, pPart, i)
int Llb_Nonlin4Quantify1(Llb_Mgr_t *p, Llb_Prt_t *pPart)
DdNode * Cudd_bddIthVar(DdManager *dd, int i)
#define ABC_CALLOC(type, num)
void Llb_Nonlin4AddPair(Llb_Mgr_t *p, int iPart, int iVar)
DdNode * Cudd_bddAnd(DdManager *dd, DdNode *f, DdNode *g)
#define Llb_VarForEachPart(p, pVar, pPart, i)
void Llb_Nonlin4Print(Llb_Mgr_t *p)
int Llb_Nonlin4HasSingletonVars(Llb_Mgr_t *p, Llb_Prt_t *pPart)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Llb_Nonlin4Quantify2(Llb_Mgr_t *p, Llb_Prt_t *pPart1, Llb_Prt_t *pPart2)
static void Vec_IntClear(Vec_Int_t *p)
#define Llb_PartForEachVar(p, pPart, pVar, i)
DdNode * Llb_Nonlin4CreateCube2(Llb_Mgr_t *p, Llb_Prt_t *pPart1, Llb_Prt_t *pPart2)
void Llb_Nonlin4CheckVars(Llb_Mgr_t *p)
Vec_Ptr_t * Llb_Nonlin4CutNodes(Aig_Man_t *p, Vec_Ptr_t *vLower, Vec_Ptr_t *vUpper)
int Cudd_DagSize(DdNode *node)
static void Vec_PtrFree(Vec_Ptr_t *p)