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

Go to the source code of this file.

Data Structures

struct  Msat_Queue_t_
 DECLARATIONS ///. More...
 

Functions

Msat_Queue_tMsat_QueueAlloc (int nVars)
 FUNCTION DEFINITIONS ///. More...
 
void Msat_QueueFree (Msat_Queue_t *p)
 
int Msat_QueueReadSize (Msat_Queue_t *p)
 
void Msat_QueueInsert (Msat_Queue_t *p, int Lit)
 
int Msat_QueueExtract (Msat_Queue_t *p)
 
void Msat_QueueClear (Msat_Queue_t *p)
 

Function Documentation

Msat_Queue_t* Msat_QueueAlloc ( int  nVars)

FUNCTION DEFINITIONS ///.

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

Synopsis [Allocates the variable propagation queue.]

Description []

SideEffects []

SeeAlso []

Definition at line 53 of file msatQueue.c.

54 {
55  Msat_Queue_t * p;
56  p = ABC_ALLOC( Msat_Queue_t, 1 );
57  memset( p, 0, sizeof(Msat_Queue_t) );
58  p->nVars = nVars;
59  p->pVars = ABC_ALLOC( int, nVars );
60  return p;
61 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
int * pVars
Definition: msatQueue.c:33
DECLARATIONS ///.
Definition: msatQueue.c:30
void Msat_QueueClear ( Msat_Queue_t p)

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

Synopsis [Resets the queue.]

Description []

SideEffects []

SeeAlso []

Definition at line 149 of file msatQueue.c.

150 {
151  p->iFirst = 0;
152  p->iLast = 0;
153 }
int Msat_QueueExtract ( Msat_Queue_t p)

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

Synopsis [Extracts an entry from the queue.]

Description []

SideEffects []

SeeAlso []

Definition at line 131 of file msatQueue.c.

132 {
133  if ( p->iFirst == p->iLast )
134  return -1;
135  return p->pVars[p->iFirst++];
136 }
int * pVars
Definition: msatQueue.c:33
void Msat_QueueFree ( Msat_Queue_t p)

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

Synopsis [Deallocate the variable propagation queue.]

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file msatQueue.c.

75 {
76  ABC_FREE( p->pVars );
77  ABC_FREE( p );
78 }
int * pVars
Definition: msatQueue.c:33
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Msat_QueueInsert ( Msat_Queue_t p,
int  Lit 
)

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

Synopsis [Insert an entry into the queue.]

Description []

SideEffects []

SeeAlso []

Definition at line 107 of file msatQueue.c.

108 {
109  if ( p->iLast == p->nVars )
110  {
111  int i;
112  assert( 0 );
113  for ( i = 0; i < p->iLast; i++ )
114  printf( "entry = %2d lit = %2d var = %2d \n", i, p->pVars[i], p->pVars[i]/2 );
115  }
116  assert( p->iLast < p->nVars );
117  p->pVars[p->iLast++] = Lit;
118 }
int * pVars
Definition: msatQueue.c:33
#define assert(ex)
Definition: util_old.h:213
int Msat_QueueReadSize ( Msat_Queue_t p)

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

Synopsis [Reads the queue size.]

Description []

SideEffects []

SeeAlso []

Definition at line 91 of file msatQueue.c.

92 {
93  return p->iLast - p->iFirst;
94 }