abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fxuList.c File Reference
#include "fxuInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void Fxu_ListMatrixAddVariable (Fxu_Matrix *p, Fxu_Var *pLink)
 DECLARATIONS ///. More...
 
void Fxu_ListMatrixDelVariable (Fxu_Matrix *p, Fxu_Var *pLink)
 
void Fxu_ListMatrixAddCube (Fxu_Matrix *p, Fxu_Cube *pLink)
 
void Fxu_ListMatrixDelCube (Fxu_Matrix *p, Fxu_Cube *pLink)
 
void Fxu_ListMatrixAddSingle (Fxu_Matrix *p, Fxu_Single *pLink)
 
void Fxu_ListMatrixDelSingle (Fxu_Matrix *p, Fxu_Single *pLink)
 
void Fxu_ListTableAddDivisor (Fxu_Matrix *p, Fxu_Double *pLink)
 
void Fxu_ListTableDelDivisor (Fxu_Matrix *p, Fxu_Double *pLink)
 
void Fxu_ListCubeAddLiteral (Fxu_Cube *pCube, Fxu_Lit *pLink)
 
void Fxu_ListCubeDelLiteral (Fxu_Cube *pCube, Fxu_Lit *pLink)
 
void Fxu_ListVarAddLiteral (Fxu_Var *pVar, Fxu_Lit *pLink)
 
void Fxu_ListVarDelLiteral (Fxu_Var *pVar, Fxu_Lit *pLink)
 
void Fxu_ListDoubleAddPairLast (Fxu_Double *pDiv, Fxu_Pair *pLink)
 
void Fxu_ListDoubleAddPairFirst (Fxu_Double *pDiv, Fxu_Pair *pLink)
 
void Fxu_ListDoubleAddPairMiddle (Fxu_Double *pDiv, Fxu_Pair *pSpot, Fxu_Pair *pLink)
 
void Fxu_ListDoubleDelPair (Fxu_Double *pDiv, Fxu_Pair *pLink)
 
void Fxu_ListDoubleAddPairPlace (Fxu_Double *pDiv, Fxu_Pair *pPair, Fxu_Pair *pPairSpot)
 

Function Documentation

void Fxu_ListCubeAddLiteral ( Fxu_Cube pCube,
Fxu_Lit pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 283 of file fxuList.c.

284 {
285  Fxu_ListLit * pList = &(pCube->lLits);
286  if ( pList->pHead == NULL )
287  {
288  pList->pHead = pLink;
289  pList->pTail = pLink;
290  pLink->pHPrev = NULL;
291  pLink->pHNext = NULL;
292  }
293  else
294  {
295  pLink->pHNext = NULL;
296  pList->pTail->pHNext = pLink;
297  pLink->pHPrev = pList->pTail;
298  pList->pTail = pLink;
299  }
300  pList->nItems++;
301 }
Fxu_Lit * pHead
Definition: fxuInt.h:109
Fxu_Lit * pHNext
Definition: fxuInt.h:233
Fxu_ListLit lLits
Definition: fxuInt.h:206
Fxu_Lit * pTail
Definition: fxuInt.h:110
int nItems
Definition: fxuInt.h:111
Fxu_Lit * pHPrev
Definition: fxuInt.h:232
void Fxu_ListCubeDelLiteral ( Fxu_Cube pCube,
Fxu_Lit pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 314 of file fxuList.c.

315 {
316  Fxu_ListLit * pList = &(pCube->lLits);
317  if ( pList->pHead == pLink )
318  pList->pHead = pLink->pHNext;
319  if ( pList->pTail == pLink )
320  pList->pTail = pLink->pHPrev;
321  if ( pLink->pHPrev )
322  pLink->pHPrev->pHNext = pLink->pHNext;
323  if ( pLink->pHNext )
324  pLink->pHNext->pHPrev = pLink->pHPrev;
325  pList->nItems--;
326 }
Fxu_Lit * pHead
Definition: fxuInt.h:109
Fxu_Lit * pHNext
Definition: fxuInt.h:233
Fxu_ListLit lLits
Definition: fxuInt.h:206
Fxu_Lit * pTail
Definition: fxuInt.h:110
int nItems
Definition: fxuInt.h:111
Fxu_Lit * pHPrev
Definition: fxuInt.h:232
void Fxu_ListDoubleAddPairFirst ( Fxu_Double pDiv,
Fxu_Pair pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 433 of file fxuList.c.

434 {
435  Fxu_ListPair * pList = &pDiv->lPairs;
436  if ( pList->pHead == NULL )
437  {
438  pList->pHead = pLink;
439  pList->pTail = pLink;
440  pLink->pDPrev = NULL;
441  pLink->pDNext = NULL;
442  }
443  else
444  {
445  pLink->pDPrev = NULL;
446  pList->pHead->pDPrev = pLink;
447  pLink->pDNext = pList->pHead;
448  pList->pHead = pLink;
449  }
450  pList->nItems++;
451 }
Fxu_Pair * pHead
Definition: fxuInt.h:117
Fxu_ListPair lPairs
Definition: fxuInt.h:260
Fxu_Pair * pDPrev
Definition: fxuInt.h:249
int nItems
Definition: fxuInt.h:119
Fxu_Pair * pDNext
Definition: fxuInt.h:250
Fxu_Pair * pTail
Definition: fxuInt.h:118
void Fxu_ListDoubleAddPairLast ( Fxu_Double pDiv,
Fxu_Pair pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 402 of file fxuList.c.

403 {
404  Fxu_ListPair * pList = &pDiv->lPairs;
405  if ( pList->pHead == NULL )
406  {
407  pList->pHead = pLink;
408  pList->pTail = pLink;
409  pLink->pDPrev = NULL;
410  pLink->pDNext = NULL;
411  }
412  else
413  {
414  pLink->pDNext = NULL;
415  pList->pTail->pDNext = pLink;
416  pLink->pDPrev = pList->pTail;
417  pList->pTail = pLink;
418  }
419  pList->nItems++;
420 }
Fxu_Pair * pHead
Definition: fxuInt.h:117
Fxu_ListPair lPairs
Definition: fxuInt.h:260
Fxu_Pair * pDPrev
Definition: fxuInt.h:249
int nItems
Definition: fxuInt.h:119
Fxu_Pair * pDNext
Definition: fxuInt.h:250
Fxu_Pair * pTail
Definition: fxuInt.h:118
void Fxu_ListDoubleAddPairMiddle ( Fxu_Double pDiv,
Fxu_Pair pSpot,
Fxu_Pair pLink 
)

Function*************************************************************

Synopsis [Adds the entry in the middle of the list after the spot.]

Description [Assumes that spot points to the link, after which the given link should be added. Spot cannot be NULL or the tail of the list. Therefore, the head and the tail of the list are not changed.]

SideEffects []

SeeAlso []

Definition at line 466 of file fxuList.c.

467 {
468  Fxu_ListPair * pList = &pDiv->lPairs;
469  assert( pSpot );
470  assert( pSpot != pList->pTail );
471  pLink->pDPrev = pSpot;
472  pLink->pDNext = pSpot->pDNext;
473  pLink->pDPrev->pDNext = pLink;
474  pLink->pDNext->pDPrev = pLink;
475  pList->nItems++;
476 }
Fxu_ListPair lPairs
Definition: fxuInt.h:260
Fxu_Pair * pDPrev
Definition: fxuInt.h:249
int nItems
Definition: fxuInt.h:119
#define assert(ex)
Definition: util_old.h:213
Fxu_Pair * pDNext
Definition: fxuInt.h:250
Fxu_Pair * pTail
Definition: fxuInt.h:118
void Fxu_ListDoubleAddPairPlace ( Fxu_Double pDiv,
Fxu_Pair pPair,
Fxu_Pair pPairSpot 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 514 of file fxuList.c.

515 {
516  printf( "Fxu_ListDoubleAddPairPlace() is called!\n" );
517 }
void Fxu_ListDoubleDelPair ( Fxu_Double pDiv,
Fxu_Pair pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 489 of file fxuList.c.

490 {
491  Fxu_ListPair * pList = &pDiv->lPairs;
492  if ( pList->pHead == pLink )
493  pList->pHead = pLink->pDNext;
494  if ( pList->pTail == pLink )
495  pList->pTail = pLink->pDPrev;
496  if ( pLink->pDPrev )
497  pLink->pDPrev->pDNext = pLink->pDNext;
498  if ( pLink->pDNext )
499  pLink->pDNext->pDPrev = pLink->pDPrev;
500  pList->nItems--;
501 }
Fxu_Pair * pHead
Definition: fxuInt.h:117
Fxu_ListPair lPairs
Definition: fxuInt.h:260
Fxu_Pair * pDPrev
Definition: fxuInt.h:249
int nItems
Definition: fxuInt.h:119
Fxu_Pair * pDNext
Definition: fxuInt.h:250
Fxu_Pair * pTail
Definition: fxuInt.h:118
void Fxu_ListMatrixAddCube ( Fxu_Matrix p,
Fxu_Cube pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 104 of file fxuList.c.

105 {
106  Fxu_ListCube * pList = &p->lCubes;
107  if ( pList->pHead == NULL )
108  {
109  pList->pHead = pLink;
110  pList->pTail = pLink;
111  pLink->pPrev = NULL;
112  pLink->pNext = NULL;
113  }
114  else
115  {
116  pLink->pNext = NULL;
117  pList->pTail->pNext = pLink;
118  pLink->pPrev = pList->pTail;
119  pList->pTail = pLink;
120  }
121  pList->nItems++;
122 }
Fxu_Cube * pPrev
Definition: fxuInt.h:207
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Cube * pTail
Definition: fxuInt.h:94
Fxu_Cube * pNext
Definition: fxuInt.h:208
Fxu_Cube * pHead
Definition: fxuInt.h:93
int nItems
Definition: fxuInt.h:95
void Fxu_ListMatrixAddSingle ( Fxu_Matrix p,
Fxu_Single pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 163 of file fxuList.c.

164 {
165  Fxu_ListSingle * pList = &p->lSingles;
166  if ( pList->pHead == NULL )
167  {
168  pList->pHead = pLink;
169  pList->pTail = pLink;
170  pLink->pPrev = NULL;
171  pLink->pNext = NULL;
172  }
173  else
174  {
175  pLink->pNext = NULL;
176  pList->pTail->pNext = pLink;
177  pLink->pPrev = pList->pTail;
178  pList->pTail = pLink;
179  }
180  pList->nItems++;
181 }
Fxu_Single * pTail
Definition: fxuInt.h:134
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Single * pHead
Definition: fxuInt.h:133
Fxu_Single * pPrev
Definition: fxuInt.h:274
int nItems
Definition: fxuInt.h:135
Fxu_Single * pNext
Definition: fxuInt.h:275
ABC_NAMESPACE_IMPL_START void Fxu_ListMatrixAddVariable ( Fxu_Matrix p,
Fxu_Var pLink 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [fxuList.c]

PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]

Synopsis [Operations on lists.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - February 1, 2003.]

Revision [

Id:
fxuList.c,v 1.0 2003/02/01 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file fxuList.c.

46 {
47  Fxu_ListVar * pList = &p->lVars;
48  if ( pList->pHead == NULL )
49  {
50  pList->pHead = pLink;
51  pList->pTail = pLink;
52  pLink->pPrev = NULL;
53  pLink->pNext = NULL;
54  }
55  else
56  {
57  pLink->pNext = NULL;
58  pList->pTail->pNext = pLink;
59  pLink->pPrev = pList->pTail;
60  pList->pTail = pLink;
61  }
62  pList->nItems++;
63 }
Fxu_Var * pPrev
Definition: fxuInt.h:220
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Var * pHead
Definition: fxuInt.h:101
int nItems
Definition: fxuInt.h:103
Fxu_Var * pTail
Definition: fxuInt.h:102
Fxu_Var * pNext
Definition: fxuInt.h:221
void Fxu_ListMatrixDelCube ( Fxu_Matrix p,
Fxu_Cube pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 135 of file fxuList.c.

136 {
137  Fxu_ListCube * pList = &p->lCubes;
138  if ( pList->pHead == pLink )
139  pList->pHead = pLink->pNext;
140  if ( pList->pTail == pLink )
141  pList->pTail = pLink->pPrev;
142  if ( pLink->pPrev )
143  pLink->pPrev->pNext = pLink->pNext;
144  if ( pLink->pNext )
145  pLink->pNext->pPrev = pLink->pPrev;
146  pList->nItems--;
147 }
Fxu_Cube * pPrev
Definition: fxuInt.h:207
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Cube * pTail
Definition: fxuInt.h:94
Fxu_Cube * pNext
Definition: fxuInt.h:208
Fxu_Cube * pHead
Definition: fxuInt.h:93
int nItems
Definition: fxuInt.h:95
void Fxu_ListMatrixDelSingle ( Fxu_Matrix p,
Fxu_Single pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 194 of file fxuList.c.

195 {
196  Fxu_ListSingle * pList = &p->lSingles;
197  if ( pList->pHead == pLink )
198  pList->pHead = pLink->pNext;
199  if ( pList->pTail == pLink )
200  pList->pTail = pLink->pPrev;
201  if ( pLink->pPrev )
202  pLink->pPrev->pNext = pLink->pNext;
203  if ( pLink->pNext )
204  pLink->pNext->pPrev = pLink->pPrev;
205  pList->nItems--;
206 }
Fxu_Single * pTail
Definition: fxuInt.h:134
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Single * pHead
Definition: fxuInt.h:133
Fxu_Single * pPrev
Definition: fxuInt.h:274
int nItems
Definition: fxuInt.h:135
Fxu_Single * pNext
Definition: fxuInt.h:275
void Fxu_ListMatrixDelVariable ( Fxu_Matrix p,
Fxu_Var pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file fxuList.c.

77 {
78  Fxu_ListVar * pList = &p->lVars;
79  if ( pList->pHead == pLink )
80  pList->pHead = pLink->pNext;
81  if ( pList->pTail == pLink )
82  pList->pTail = pLink->pPrev;
83  if ( pLink->pPrev )
84  pLink->pPrev->pNext = pLink->pNext;
85  if ( pLink->pNext )
86  pLink->pNext->pPrev = pLink->pPrev;
87  pList->nItems--;
88 }
Fxu_Var * pPrev
Definition: fxuInt.h:220
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Var * pHead
Definition: fxuInt.h:101
int nItems
Definition: fxuInt.h:103
Fxu_Var * pTail
Definition: fxuInt.h:102
Fxu_Var * pNext
Definition: fxuInt.h:221
void Fxu_ListTableAddDivisor ( Fxu_Matrix p,
Fxu_Double pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 222 of file fxuList.c.

223 {
224  Fxu_ListDouble * pList = &(p->pTable[pLink->Key]);
225  if ( pList->pHead == NULL )
226  {
227  pList->pHead = pLink;
228  pList->pTail = pLink;
229  pLink->pPrev = NULL;
230  pLink->pNext = NULL;
231  }
232  else
233  {
234  pLink->pNext = NULL;
235  pList->pTail->pNext = pLink;
236  pLink->pPrev = pList->pTail;
237  pList->pTail = pLink;
238  }
239  pList->nItems++;
240  p->nDivs++;
241 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Double * pPrev
Definition: fxuInt.h:261
int nItems
Definition: fxuInt.h:127
Fxu_Double * pHead
Definition: fxuInt.h:125
unsigned Key
Definition: fxuInt.h:259
Fxu_Double * pNext
Definition: fxuInt.h:262
Fxu_Double * pTail
Definition: fxuInt.h:126
void Fxu_ListTableDelDivisor ( Fxu_Matrix p,
Fxu_Double pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 254 of file fxuList.c.

255 {
256  Fxu_ListDouble * pList = &(p->pTable[pLink->Key]);
257  if ( pList->pHead == pLink )
258  pList->pHead = pLink->pNext;
259  if ( pList->pTail == pLink )
260  pList->pTail = pLink->pPrev;
261  if ( pLink->pPrev )
262  pLink->pPrev->pNext = pLink->pNext;
263  if ( pLink->pNext )
264  pLink->pNext->pPrev = pLink->pPrev;
265  pList->nItems--;
266  p->nDivs--;
267 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Fxu_Double * pPrev
Definition: fxuInt.h:261
int nItems
Definition: fxuInt.h:127
Fxu_Double * pHead
Definition: fxuInt.h:125
unsigned Key
Definition: fxuInt.h:259
Fxu_Double * pNext
Definition: fxuInt.h:262
Fxu_Double * pTail
Definition: fxuInt.h:126
void Fxu_ListVarAddLiteral ( Fxu_Var pVar,
Fxu_Lit pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 342 of file fxuList.c.

343 {
344  Fxu_ListLit * pList = &(pVar->lLits);
345  if ( pList->pHead == NULL )
346  {
347  pList->pHead = pLink;
348  pList->pTail = pLink;
349  pLink->pVPrev = NULL;
350  pLink->pVNext = NULL;
351  }
352  else
353  {
354  pLink->pVNext = NULL;
355  pList->pTail->pVNext = pLink;
356  pLink->pVPrev = pList->pTail;
357  pList->pTail = pLink;
358  }
359  pList->nItems++;
360 }
Fxu_ListLit lLits
Definition: fxuInt.h:219
Fxu_Lit * pHead
Definition: fxuInt.h:109
Fxu_Lit * pVNext
Definition: fxuInt.h:235
Fxu_Lit * pVPrev
Definition: fxuInt.h:234
Fxu_Lit * pTail
Definition: fxuInt.h:110
int nItems
Definition: fxuInt.h:111
void Fxu_ListVarDelLiteral ( Fxu_Var pVar,
Fxu_Lit pLink 
)

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 373 of file fxuList.c.

374 {
375  Fxu_ListLit * pList = &(pVar->lLits);
376  if ( pList->pHead == pLink )
377  pList->pHead = pLink->pVNext;
378  if ( pList->pTail == pLink )
379  pList->pTail = pLink->pVPrev;
380  if ( pLink->pVPrev )
381  pLink->pVPrev->pVNext = pLink->pVNext;
382  if ( pLink->pVNext )
383  pLink->pVNext->pVPrev = pLink->pVPrev;
384  pList->nItems--;
385 }
Fxu_ListLit lLits
Definition: fxuInt.h:219
Fxu_Lit * pHead
Definition: fxuInt.h:109
Fxu_Lit * pVNext
Definition: fxuInt.h:235
Fxu_Lit * pVPrev
Definition: fxuInt.h:234
Fxu_Lit * pTail
Definition: fxuInt.h:110
int nItems
Definition: fxuInt.h:111