src/sat/msat/msatClauseVec.c File Reference

#include "msatInt.h"
Include dependency graph for msatClauseVec.c:

Go to the source code of this file.

Functions

Msat_ClauseVec_tMsat_ClauseVecAlloc (int nCap)
void Msat_ClauseVecFree (Msat_ClauseVec_t *p)
Msat_Clause_t ** Msat_ClauseVecReadArray (Msat_ClauseVec_t *p)
int Msat_ClauseVecReadSize (Msat_ClauseVec_t *p)
void Msat_ClauseVecGrow (Msat_ClauseVec_t *p, int nCapMin)
void Msat_ClauseVecShrink (Msat_ClauseVec_t *p, int nSizeNew)
void Msat_ClauseVecClear (Msat_ClauseVec_t *p)
void Msat_ClauseVecPush (Msat_ClauseVec_t *p, Msat_Clause_t *Entry)
Msat_Clause_tMsat_ClauseVecPop (Msat_ClauseVec_t *p)
void Msat_ClauseVecWriteEntry (Msat_ClauseVec_t *p, int i, Msat_Clause_t *Entry)
Msat_Clause_tMsat_ClauseVecReadEntry (Msat_ClauseVec_t *p, int i)

Function Documentation

Msat_ClauseVec_t* Msat_ClauseVecAlloc ( int  nCap  ) 

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

FileName [msatClauseVec.c]

PackageName [A C version of SAT solver MINISAT, originally developed in C++ by Niklas Een and Niklas Sorensson, Chalmers University of Technology, Sweden: http://www.cs.chalmers.se/~een/Satzoo.]

Synopsis [Procedures working with arrays of SAT clauses.]

Author [Alan Mishchenko <alanmi@eecs.berkeley.edu>]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - January 1, 2004.]

Revision [

Id
msatClauseVec.c,v 1.0 2004/01/01 1:00:00 alanmi Exp

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

Synopsis [Allocates a vector with the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 42 of file msatClauseVec.c.

00043 {
00044     Msat_ClauseVec_t * p;
00045     p = ALLOC( Msat_ClauseVec_t, 1 );
00046     if ( nCap > 0 && nCap < 16 )
00047         nCap = 16;
00048     p->nSize  = 0;
00049     p->nCap   = nCap;
00050     p->pArray = p->nCap? ALLOC( Msat_Clause_t *, p->nCap ) : NULL;
00051     return p;
00052 }

void Msat_ClauseVecClear ( Msat_ClauseVec_t p  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 150 of file msatClauseVec.c.

00151 {
00152     p->nSize = 0;
00153 }

void Msat_ClauseVecFree ( Msat_ClauseVec_t p  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 65 of file msatClauseVec.c.

00066 {
00067     FREE( p->pArray );
00068     FREE( p );
00069 }

void Msat_ClauseVecGrow ( Msat_ClauseVec_t p,
int  nCapMin 
)

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

Synopsis [Resizes the vector to the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 114 of file msatClauseVec.c.

00115 {
00116     if ( p->nCap >= nCapMin )
00117         return;
00118     p->pArray = REALLOC( Msat_Clause_t *, p->pArray, nCapMin ); 
00119     p->nCap   = nCapMin;
00120 }

Msat_Clause_t* Msat_ClauseVecPop ( Msat_ClauseVec_t p  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 189 of file msatClauseVec.c.

00190 {
00191     return p->pArray[--p->nSize];
00192 }

void Msat_ClauseVecPush ( Msat_ClauseVec_t p,
Msat_Clause_t Entry 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 166 of file msatClauseVec.c.

00167 {
00168     if ( p->nSize == p->nCap )
00169     {
00170         if ( p->nCap < 16 )
00171             Msat_ClauseVecGrow( p, 16 );
00172         else
00173             Msat_ClauseVecGrow( p, 2 * p->nCap );
00174     }
00175     p->pArray[p->nSize++] = Entry;
00176 }

Msat_Clause_t** Msat_ClauseVecReadArray ( Msat_ClauseVec_t p  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 82 of file msatClauseVec.c.

00083 {
00084     return p->pArray;
00085 }

Msat_Clause_t* Msat_ClauseVecReadEntry ( Msat_ClauseVec_t p,
int  i 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 222 of file msatClauseVec.c.

00223 {
00224     assert( i >= 0 && i < p->nSize );
00225     return p->pArray[i];
00226 }

int Msat_ClauseVecReadSize ( Msat_ClauseVec_t p  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 98 of file msatClauseVec.c.

00099 {
00100     return p->nSize;
00101 }

void Msat_ClauseVecShrink ( Msat_ClauseVec_t p,
int  nSizeNew 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 133 of file msatClauseVec.c.

00134 {
00135     assert( p->nSize >= nSizeNew );
00136     p->nSize = nSizeNew;
00137 }

void Msat_ClauseVecWriteEntry ( Msat_ClauseVec_t p,
int  i,
Msat_Clause_t Entry 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 205 of file msatClauseVec.c.

00206 {
00207     assert( i >= 0 && i < p->nSize );
00208     p->pArray[i] = Entry;
00209 }


Generated on Tue Jan 5 12:19:39 2010 for abc70930 by  doxygen 1.6.1