[Javabdd-checkins] JavaBDD/buddy/src kernel.c,1.7,1.8
Brought to you by:
joewhaley
From: John W. <joe...@us...> - 2005-03-15 09:22:41
|
Update of /cvsroot/javabdd/JavaBDD/buddy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2986/buddy/src Modified Files: kernel.c Log Message: Added setIncreaseFactor() Index: kernel.c =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/buddy/src/kernel.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kernel.c 31 Jan 2005 10:23:39 -0000 1.7 --- kernel.c 15 Mar 2005 09:22:24 -0000 1.8 *************** *** 91,94 **** --- 91,95 ---- int bddmaxnodesize; /* Maximum allowed number of nodes */ int bddmaxnodeincrease; /* Max. # of nodes used to inc. table */ + double bddincreasefactor; /* Increase factor when growing table. */ BddNode* bddnodes; /* All of the bdd nodes */ int bddfreepos; /* First free node */ *************** *** 236,239 **** --- 237,241 ---- usednodes_nextreorder = bddnodesize; bddmaxnodeincrease = DEFAULTMAXNODEINC; + bddincreasefactor = 2; bdderrorcond = 0; *************** *** 573,577 **** DESCR {* The node table is expanded by doubling the size of the table when no more free nodes can be found, but a maximum for the ! number of new nodes added can be set with {\tt bdd\_maxincrease} to {\tt size} nodes. The default is 50000 nodes (1 Mb). *} RETURN {* The old threshold on succes, otherwise a negative error code. *} --- 575,579 ---- DESCR {* The node table is expanded by doubling the size of the table when no more free nodes can be found, but a maximum for the ! number of new nodes added can be set with {\tt bdd\_setmaxincrease} to {\tt size} nodes. The default is 50000 nodes (1 Mb). *} RETURN {* The old threshold on succes, otherwise a negative error code. *} *************** *** 593,596 **** --- 595,624 ---- /* + NAME {* bdd\_increasefactor *} + SECTION {* kernel *} + SHORT {* set factor used to increase node table *} + PROTO {* double bdd_setincreasefactor(double size) *} + DESCR {* The node table is expanded by multiplying the size by this factor + when no more free nodes can be found, but a maximum for the + number of new nodes added can be set with {\tt bdd\_setmaxincrease} + to {\tt size} nodes. The default is 2. *} + RETURN {* The old threshold on success, otherwise a negative error code. *} + ALSO {* bdd\_setmaxnodenum, bdd\_setminfreenodes, bdd\_setmaxincrease *} + */ + double bdd_setincreasefactor(double size) + { + double old = bddincreasefactor; + + BUDDY_PROLOGUE; + ADD_ARG1(T_DOUBLE,size); + + if (size <= 1) + RETURN(bdd_error(BDD_SIZE)); + + bddincreasefactor = size; + RETURN(old); + } + + /* NAME {* bdd\_setmaxnodenum *} SECTION {* kernel *} *************** *** 1505,1509 **** return -1; ! newsize = bddnodesize << 1; if (newsize > oldsize + bddmaxnodeincrease) --- 1533,1537 ---- return -1; ! newsize = (int) bddnodesize * bddincreasefactor; if (newsize > oldsize + bddmaxnodeincrease) |