File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
src/main/java/com/github/javabdd Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,8 @@ public void reset() {
417
417
418
418
/**
419
419
* Sets the cache ratio for the operator caches. When the node table grows, operator caches will also grow to
420
- * maintain the ratio.
420
+ * maintain the ratio. A ratio of {@code 0.5} leads to caches that are half the node table size, while a ratio
421
+ * of {@code 2.0} leads to caches that are twice the node table size.
421
422
*
422
423
* <p>
423
424
* Compare to bdd_setcacheratio.
Original file line number Diff line number Diff line change @@ -434,7 +434,7 @@ public void printStat() {
434
434
435
435
@ Override
436
436
public double setCacheRatio (double x ) {
437
- return bdd_setcacheratio (( int ) x );
437
+ return bdd_setcacheratio (x );
438
438
}
439
439
440
440
@ Override
@@ -4726,7 +4726,7 @@ void bdd_init(int initnodesize, int cs) {
4726
4726
4727
4727
BddCache countcache ; /* Cache for count results */
4728
4728
4729
- int cacheratio ;
4729
+ double cacheratio ;
4730
4730
4731
4731
boolean satPolarity ;
4732
4732
@@ -4817,7 +4817,7 @@ int bdd_setcachesize(int newcachesize) {
4817
4817
4818
4818
void bdd_operator_noderesize () {
4819
4819
if (cacheratio > 0 ) {
4820
- int newcachesize = bddnodesize / cacheratio ;
4820
+ int newcachesize = ( int )( bddnodesize * cacheratio ) ;
4821
4821
4822
4822
BddCache_resize (applycache , newcachesize );
4823
4823
BddCache_resize (itecache , newcachesize );
@@ -6088,8 +6088,8 @@ int bdd_setmaxincrease(int size) {
6088
6088
return old ;
6089
6089
}
6090
6090
6091
- int bdd_setcacheratio (int r ) {
6092
- int old = cacheratio ;
6091
+ double bdd_setcacheratio (double r ) {
6092
+ double old = cacheratio ;
6093
6093
6094
6094
if (r <= 0 ) {
6095
6095
return bdd_error (BDD_RANGE );
You can’t perform that action at this time.
0 commit comments