You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
(6) |
Apr
(6) |
May
(4) |
Jun
(31) |
Jul
(64) |
Aug
(19) |
Sep
(28) |
Oct
(50) |
Nov
(25) |
Dec
|
2005 |
Jan
(44) |
Feb
(8) |
Mar
(2) |
Apr
(15) |
May
(48) |
Jun
(8) |
Jul
(7) |
Aug
|
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
(14) |
Aug
|
Sep
|
Oct
|
Nov
(6) |
Dec
(4) |
2007 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John W. <joe...@us...> - 2004-10-19 21:45:30
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32568/net/sf/javabdd Modified Files: BuDDyFactory.java Log Message: Update Javadoc. Index: BuDDyFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BuDDyFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BuDDyFactory.java 19 Oct 2004 11:11:35 -0000 1.5 --- BuDDyFactory.java 19 Oct 2004 21:45:19 -0000 1.6 *************** *** 235,239 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ public double setMinFreeNodes(double x) { --- 235,239 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(double) */ public double setMinFreeNodes(double x) { |
From: John W. <joe...@us...> - 2004-10-19 11:46:39
|
Update of /cvsroot/javabdd/JavaBDD_tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4991 Removed Files: NQueensTest.java Log Message: Updated JavaBDD tests. --- NQueensTest.java DELETED --- |
From: John W. <joe...@us...> - 2004-10-19 11:46:39
|
Update of /cvsroot/javabdd/JavaBDD_tests/regression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4991/regression Modified Files: R1.java Log Message: Updated JavaBDD tests. Index: R1.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/regression/R1.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** R1.java 19 Oct 2004 06:51:21 -0000 1.5 --- R1.java 19 Oct 2004 11:46:30 -0000 1.6 *************** *** 29,33 **** BDD set = d.set(); double s1 = x.satCount(set); ! bdd.setVarNum(20); double s2 = x.satCount(set); Assert.assertEquals(bdd.toString(), s1, s2, 0.00001); --- 29,33 ---- BDD set = d.set(); double s1 = x.satCount(set); ! if (bdd.varNum() < 20) bdd.setVarNum(20); double s2 = x.satCount(set); Assert.assertEquals(bdd.toString(), s1, s2, 0.00001); |
From: John W. <joe...@us...> - 2004-10-19 11:46:38
|
Update of /cvsroot/javabdd/JavaBDD_tests/bdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4991/bdd Modified Files: BDDTestCase.java Added Files: IteratorTests.java Log Message: Updated JavaBDD tests. Index: BDDTestCase.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/bdd/BDDTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BDDTestCase.java 19 Oct 2004 06:50:09 -0000 1.3 --- BDDTestCase.java 19 Oct 2004 11:46:29 -0000 1.4 *************** *** 19,55 **** public abstract class BDDTestCase extends TestCase implements Iterator { ! static volatile Collection factories; ! static final String[] factoryNames = { "net.sf.javabdd.BuDDyFactory", - "net.sf.javabdd.CUDDFactory", - "net.sf.javabdd.CALFactory", "net.sf.javabdd.JFactory", //"net.sf.javabdd.JDDFactory", }; ! static void initFactories(int nodenum, int cachesize) { if (factories != null) return; ! synchronized (BDDTestCase.class) { ! if (factories != null) return; ! Collection f = new LinkedList(); ! for (int k = 0; k < factoryNames.length; ++k) { ! String bddpackage = factoryNames[k]; ! try { ! Class c = Class.forName(bddpackage); ! Method m = c.getMethod("init", new Class[] { int.class, int.class }); ! BDDFactory b = (BDDFactory) m.invoke(null, new Object[] { new Integer(nodenum), new Integer(cachesize) }); ! f.add(b); ! } ! catch (Throwable _) {} } - factories = f; } } ! protected Iterator i; public BDDTestCase(int nodenum, int cachesize) { ! initFactories(nodenum, cachesize); ! reset(); } public BDDTestCase() { --- 19,64 ---- public abstract class BDDTestCase extends TestCase implements Iterator { ! public static final String[] factoryNames = { "net.sf.javabdd.BuDDyFactory", "net.sf.javabdd.JFactory", + //"net.sf.javabdd.CUDDFactory", + //"net.sf.javabdd.CALFactory", //"net.sf.javabdd.JDDFactory", }; ! protected static Collection factories; ! protected Iterator i; ! protected int nodenum, cachesize; ! ! protected void initFactories() { if (factories != null) return; ! Collection f = new LinkedList(); ! for (int k = 0; k < factoryNames.length; ++k) { ! String bddpackage = factoryNames[k]; ! try { ! Class c = Class.forName(bddpackage); ! Method m = c.getMethod("init", new Class[] { int.class, int.class }); ! BDDFactory b = (BDDFactory) m.invoke(null, new Object[] { new Integer(nodenum), new Integer(cachesize) }); ! f.add(b); ! } ! catch (Throwable _) { ! System.out.println("Failed: "+_); } } + factories = f; } ! protected void destroyFactories() { ! if (factories == null) return; ! for (Iterator i = factories.iterator(); i.hasNext(); ) { ! BDDFactory f = (BDDFactory) i.next(); ! f.done(); ! } ! factories = null; ! } public BDDTestCase(int nodenum, int cachesize) { ! this.nodenum = nodenum; ! this.cachesize = cachesize; } public BDDTestCase() { *************** *** 57,66 **** } public BDDFactory nextFactory() { ! return (BDDFactory) i.next(); } public Object next() { ! return i.next(); } --- 66,83 ---- } + protected void setUp() { + //System.out.println("Doing setUp()"); + initFactories(); + reset(); + } + public BDDFactory nextFactory() { ! BDDFactory f = (BDDFactory) i.next(); ! f.reset(); ! return f; } public Object next() { ! return nextFactory(); } *************** *** 76,78 **** --- 93,101 ---- i = factories.iterator(); } + + protected void tearDown() { + //System.out.println("Doing tearDown()"); + //destroyFactories(); + } + } --- NEW FILE: IteratorTests.java --- // IteratorTests.java, created Oct 19, 2004 1:16:36 AM by joewhaley // Copyright (C) 2004 John Whaley <jw...@al...> // Licensed under the terms of the GNU LGPL; see COPYING for details. package bdd; import java.util.HashSet; import java.util.Iterator; import java.util.Random; import java.util.Set; import junit.framework.Assert; import net.sf.javabdd.BDD; import net.sf.javabdd.BDDDomain; import net.sf.javabdd.BDDFactory; /** * IteratorTests * * @author jwhaley * @version $Id: IteratorTests.java,v 1.1 2004/10/19 11:46:29 joewhaley Exp $ */ public class IteratorTests extends BDDTestCase { public static void main(String[] args) { junit.textui.TestRunner.run(IteratorTests.class); } public void testIterator() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); bdd.setNodeTableSize(200000); int domainSize = 1024; bdd.extDomain(new int[] { domainSize, domainSize }); BDDDomain d = bdd.getDomain(0); BDDDomain d2 = bdd.getDomain(1); Random r = new Random(); int times = 1000; int combine = 400; for (int i = 0; i < times; ++i) { int count = r.nextInt(combine); BDD b = bdd.zero(); for (int j = 0; j < count; ++j) { int varNum = r.nextInt(domainSize); BDD c = d.ithVar(varNum); //.andWith(d2.ithVar(domainSize - varNum - 1)); b.orWith(c); } BDD var = d.set(); Iterator i1 = b.iterator(var); Iterator i2 = b.iterator2(var); b.free(); Set s1 = new HashSet(); Set s2 = new HashSet(); while (i1.hasNext()) { BDD b1 = (BDD) i1.next(); double sc = b1.satCount(var); Assert.assertEquals(1., sc, 0.0000001); s1.add(b1); } while (i2.hasNext()) { BDD b2 = (BDD) i2.next(); double sc = b2.satCount(var); Assert.assertEquals(1., sc, 0.0000001); s2.add(b2); } var.free(); if (!s1.equals(s2)) { Set s1_minus_s2 = new HashSet(s1); s1_minus_s2.removeAll(s2); Set s2_minus_s1 = new HashSet(s2); s2_minus_s1.removeAll(s1); Assert.fail("iterator() contains these extras: "+s1_minus_s2+"\n"+ "iterator2() contains these extras: "+s2_minus_s1); } for (Iterator k = s1.iterator(); k.hasNext(); ) { BDD q = (BDD) k.next(); q.free(); } for (Iterator k = s2.iterator(); k.hasNext(); ) { BDD q = (BDD) k.next(); q.free(); } } } } } |
From: John W. <joe...@us...> - 2004-10-19 11:46:37
|
Update of /cvsroot/javabdd/JavaBDD_tests/highlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4991/highlevel Added Files: NQueensTest.java Log Message: Updated JavaBDD tests. --- NEW FILE: NQueensTest.java --- // NQueensTest.java, created Jul 28, 2004 1:44:28 AM by joewhaley // Copyright (C) 2004 John Whaley <jw...@al...> // Licensed under the terms of the GNU LGPL; see COPYING for details. package highlevel; import net.sf.javabdd.BDD; import net.sf.javabdd.BDDFactory; import junit.framework.Assert; import bdd.BDDTestCase; /** * NQueensTest * * @author John Whaley * @version $Id: NQueensTest.java,v 1.1 2004/10/19 11:46:29 joewhaley Exp $ */ public class NQueensTest extends BDDTestCase { public static void main(String[] args) { junit.textui.TestRunner.run(NQueensTest.class); } public static final int CHECK = 10; public static final double[] ANSWERS = { 1., 0., 0., 2., 10., 4., 40., 92., 352., 724., 2680., 14200., 73712., 365596., 2279184., 14772512., 95815104., 666090624., 4968057848., 39029188884., 314666222712., 2691008701644., 24233937684440. }; public void testNQueens() { Assert.assertTrue(hasNext()); int numberOfNodes = (int) (Math.pow(4.42, CHECK-6))*1000; while (hasNext()) { NQueens.B = nextFactory(); NQueens.B.setNodeTableSize(numberOfNodes); for (int i = 1; i <= CHECK; ++i) { NQueens.N = i; double n = NQueens.runTest(); Assert.assertEquals(n, ANSWERS[i-1], 0.1); NQueens.freeAll(); } } } private static class NQueens { private static BDDFactory B; private static int N; /* Size of the chess board */ private static BDD[][] X; /* BDD variable array */ private static BDD queen; /* N-queen problem expressed as a BDD */ private static BDD solution; /* One solution */ private static double runTest() { if (B.varNum() < N * N) B.setVarNum(N * N); queen = B.one(); int i, j; /* Build variable array */ X = new BDD[N][N]; for (i = 0; i < N; i++) for (j = 0; j < N; j++) X[i][j] = B.ithVar(i * N + j); /* Place a queen in each row */ for (i = 0; i < N; i++) { BDD e = B.zero(); for (j = 0; j < N; j++) { e.orWith(X[i][j].id()); } queen.andWith(e); } /* Build requirements for each variable(field) */ for (i = 0; i < N; i++) for (j = 0; j < N; j++) { build(i, j); } solution = queen.satOne(); double result = queen.satCount(); return result; } private static void freeAll() { for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) X[i][j].free(); queen.free(); solution.free(); } private static void build(int i, int j) { BDD a = B.one(), b = B.one(), c = B.one(), d = B.one(); int k, l; /* No one in the same column */ for (l = 0; l < N; l++) { if (l != j) { BDD u = X[i][l].apply(X[i][j], BDDFactory.nand); a.andWith(u); } } /* No one in the same row */ for (k = 0; k < N; k++) { if (k != i) { BDD u = X[i][j].apply(X[k][j], BDDFactory.nand); b.andWith(u); } } /* No one in the same up-right diagonal */ for (k = 0; k < N; k++) { int ll = k - i + j; if (ll >= 0 && ll < N) { if (k != i) { BDD u = X[i][j].apply(X[k][ll], BDDFactory.nand); c.andWith(u); } } } /* No one in the same down-right diagonal */ for (k = 0; k < N; k++) { int ll = i + j - k; if (ll >= 0 && ll < N) { if (k != i) { BDD u = X[i][j].apply(X[k][ll], BDDFactory.nand); d.andWith(u); } } } c.andWith(d); b.andWith(c); a.andWith(b); queen.andWith(a); } } } |
From: John W. <joe...@us...> - 2004-10-19 11:46:34
|
Update of /cvsroot/javabdd/JavaBDD_tests/highlevel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4970/highlevel Log Message: Directory /cvsroot/javabdd/JavaBDD_tests/highlevel added to the repository |
From: John W. <joe...@us...> - 2004-10-19 11:41:50
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3737 Modified Files: project.properties Log Message: Added statcvs option. Index: project.properties =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.properties,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** project.properties 19 Oct 2004 11:33:36 -0000 1.9 --- project.properties 19 Oct 2004 11:41:40 -0000 1.10 *************** *** 41,43 **** --- 41,44 ---- # Ignore some buddy junk in statcvs + statcvs.history = true statcvs.exclude = buddy/doc/**;buddy/examples/** |
From: John W. <joe...@us...> - 2004-10-19 11:34:01
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1790 Modified Files: .cvsignore Log Message: added "target" dir Index: .cvsignore =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/.cvsignore,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** .cvsignore 29 Jun 2004 08:39:47 -0000 1.7 --- .cvsignore 19 Oct 2004 11:33:52 -0000 1.8 *************** *** 12,13 **** --- 12,14 ---- cudd-2.4.0 cal-2.1 + target |
From: John W. <joe...@us...> - 2004-10-19 11:33:46
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1728 Modified Files: project.properties Log Message: Added statcvs option. Index: project.properties =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.properties,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** project.properties 19 Oct 2004 11:11:54 -0000 1.8 --- project.properties 19 Oct 2004 11:33:36 -0000 1.9 *************** *** 39,40 **** --- 39,43 ---- # JUnit tests use JNI, so we need either -noloading or to fork. maven.junit.fork = true + + # Ignore some buddy junk in statcvs + statcvs.exclude = buddy/doc/**;buddy/examples/** |
From: John W. <joe...@us...> - 2004-10-19 11:23:48
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31239 Modified Files: project.xml Log Message: Added developer connection. Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** project.xml 19 Oct 2004 11:11:54 -0000 1.14 --- project.xml 19 Oct 2004 11:23:38 -0000 1.15 *************** *** 57,60 **** --- 57,63 ---- scm:cvs:pserver:ano...@cv...:/cvsroot/javabdd:JavaBDD </connection> + <developerConnection> + scm:cvs:ext:joe...@cv...:/cvsroot/javabdd:JavaBDD + </developerConnection> <url> http://cvs.sourceforge.net/viewcvs.py/javabdd/ |
From: John W. <joe...@us...> - 2004-10-19 11:12:25
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28273 Modified Files: buddy_jni.c project.properties project.xml NQueens.java Log Message: More updates in preparation for release. Index: project.properties =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.properties,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** project.properties 21 Aug 2004 02:22:40 -0000 1.7 --- project.properties 19 Oct 2004 11:11:54 -0000 1.8 *************** *** 30,34 **** # Properties for Javadoc generation. maven.javadoc.links = http://java.sun.com/j2se/1.4.2/docs/api/ ! maven.javadoc.protected = true maven.javadoc.private = false #maven.javadoc.overview = docs/overview.html --- 30,34 ---- # Properties for Javadoc generation. maven.javadoc.links = http://java.sun.com/j2se/1.4.2/docs/api/ ! maven.javadoc.protected = false maven.javadoc.private = false #maven.javadoc.overview = docs/overview.html *************** *** 36,37 **** --- 36,40 ---- # Properties for dashboard #maven.dashboard.aggregators = junittests,junitfailures,juniterrors,junitpassrate + + # JUnit tests use JNI, so we need either -noloading or to fork. + maven.junit.fork = true Index: NQueens.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/NQueens.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NQueens.java 16 Oct 2004 02:58:57 -0000 1.15 --- NQueens.java 19 Oct 2004 11:11:54 -0000 1.16 *************** *** 5,15 **** */ public class NQueens { ! public static BDDFactory B; ! public static boolean TRACE; ! public static int N; /* Size of the chess board */ ! public static BDD[][] X; /* BDD variable array */ ! public static BDD queen; /* N-queen problem expressed as a BDD */ ! public static BDD solution; /* One solution */ public static void main(String[] args) { --- 5,15 ---- */ public class NQueens { ! static BDDFactory B; ! static boolean TRACE; ! static int N; /* Size of the chess board */ ! static BDD[][] X; /* BDD variable array */ ! static BDD queen; /* N-queen problem expressed as a BDD */ ! static BDD solution; /* One solution */ public static void main(String[] args) { Index: project.xml =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/project.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** project.xml 16 Oct 2004 02:58:57 -0000 1.13 --- project.xml 19 Oct 2004 11:11:54 -0000 1.14 *************** *** 4,8 **** <name>JavaBDD</name> <id>javabdd</id> ! <currentVersion>0.6</currentVersion> <logo>/images/logo2_mid.jpg</logo> <organization> --- 4,8 ---- <name>JavaBDD</name> <id>javabdd</id> ! <currentVersion>1.0b1</currentVersion> <logo>/images/logo2_mid.jpg</logo> <organization> *************** *** 84,90 **** </version> <version> ! <id>1.0beta</id> ! <name>1.0beta</name> ! <tag>HEAD</tag> </version> </versions> --- 84,90 ---- </version> <version> ! <id>1.0b1</id> ! <name>1.0b1</name> ! <tag>v1_0b1</tag> </version> </versions> *************** *** 186,191 **** <includes> <include>**/*Test.java</include> ! </includes> ! <includes> <include>regression/*.java</include> </includes> --- 186,190 ---- <includes> <include>**/*Test.java</include> ! <include>**/*Tests.java</include> <include>regression/*.java</include> </includes> *************** *** 245,248 **** --- 244,250 ---- </report> <report> + maven-junit-report-plugin + </report> + <report> maven-findbugs-plugin </report> *************** *** 250,253 **** --- 252,261 ---- maven-linkcheck-plugin </report> + <report> + maven-statcvs-plugin + </report> + <report> + maven-changes-plugin + </report> <!-- TOO EXPENSIVE <report> Index: buddy_jni.c =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/buddy_jni.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** buddy_jni.c 19 Oct 2004 09:14:10 -0000 1.22 --- buddy_jni.c 19 Oct 2004 11:11:54 -0000 1.23 *************** *** 85,89 **** case BDD_SIZE: /* Illegal size argument */ case BVEC_SHIFT: /* Illegal shift-left/right parameter */ ! clsname = "java/lang/IllegalArgumentException"; break; default: --- 85,90 ---- case BDD_SIZE: /* Illegal size argument */ case BVEC_SHIFT: /* Illegal shift-left/right parameter */ ! //clsname = "java/lang/IllegalArgumentException"; ! clsname = "net/sf/javabdd/BDDException"; break; default: *************** *** 330,333 **** --- 331,356 ---- /* * Class: net_sf_javabdd_BuDDyFactory + * Method: setNodeTableSize0 + * Signature: (I)I + */ + JNIEXPORT jint JNICALL Java_net_sf_javabdd_BuDDyFactory_setNodeTableSize0 + (JNIEnv *env, jclass cl, jint size) + { + int result; + jnienv = env; + #if defined(TRACE_BUDDYLIB) + printf("bdd_getallocnum()\n"); + #endif + result = bdd_getallocnum(); + #if defined(TRACE_BUDDYLIB) + printf("bdd_noderesize2(%d, %d, %d)\n", 1, result, size); + #endif + bdd_noderesize2(1, result, size); + check_error(env); + return result; + } + + /* + * Class: net_sf_javabdd_BuDDyFactory * Method: setMinFreeNodes0 * Signature: (I)I *************** *** 912,915 **** --- 935,956 ---- /* * Class: net_sf_javabdd_BuDDyFactory + * Method: getCacheSize0 + * Signature: ()I + */ + JNIEXPORT jint JNICALL Java_net_sf_javabdd_BuDDyFactory_getCacheSize0 + (JNIEnv *env, jclass c) + { + int result; + bddStat stats; + #if defined(TRACE_BUDDYLIB) + printf("bdd_stats(%p)\n", &stats); + #endif + bdd_stats(&stats); + result = stats.cachesize; + return result; + } + + /* + * Class: net_sf_javabdd_BuDDyFactory * Method: getNodeNum0 * Signature: ()I |
From: John W. <joe...@us...> - 2004-10-19 11:11:48
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28180/net/sf/javabdd Modified Files: CALFactory.java TestBDDFactory.java JFactory.java JDDFactory.java BuDDyFactory.java CUDDFactory.java BDDFactory.java TypedBDDFactory.java BDD.java Log Message: Updates to support more features. Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDD.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BDD.java 16 Oct 2004 02:58:57 -0000 1.1 --- BDD.java 19 Oct 2004 11:11:35 -0000 1.2 *************** *** 6,15 **** import java.util.Arrays; import java.util.HashMap; - import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; - import java.util.Random; - import java.util.Set; import java.io.PrintStream; import java.math.BigInteger; --- 6,12 ---- *************** *** 692,696 **** * @return array of levels */ ! static int[] varset2levels(BDD r) { int size = 0; BDD p = r.id(); --- 689,693 ---- * @return array of levels */ ! private static int[] varset2levels(BDD r) { int size = 0; BDD p = r.id(); *************** *** 1363,1370 **** } ! static void fdd_printset_helper(OutputBuffer sb, ! BigInteger value, int i, ! int[] set, int[] var, ! int maxSkip) { if (i == maxSkip) { //_assert(set[var[i]] == 0); --- 1360,1367 ---- } ! private static void fdd_printset_helper(OutputBuffer sb, ! BigInteger value, int i, ! int[] set, int[] var, ! int maxSkip) { if (i == maxSkip) { //_assert(set[var[i]] == 0); *************** *** 1381,1385 **** } ! static void fdd_printset_rec(BDDFactory bdd, StringBuffer sb, BDDToString ts, BDD r, int[] set) { int fdvarnum = bdd.numberOfDomains(); --- 1378,1382 ---- } ! private static void fdd_printset_rec(BDDFactory bdd, StringBuffer sb, BDDToString ts, BDD r, int[] set) { int fdvarnum = bdd.numberOfDomains(); *************** *** 1515,1576 **** protected BDD() { } - public static void main(String[] args) { - BDDFactory bdd = BDDFactory.init(1000, 1000); - int domainSize = 1024; - bdd.extDomain(new int[] { domainSize, domainSize }); - BDDDomain d = bdd.getDomain(0); - BDDDomain d2 = bdd.getDomain(1); - Random r = new Random(); - int times = 1000; - int combine = 400; - for (int i = 0; i < times; ++i) { - int count = r.nextInt(combine); - BDD b = bdd.zero(); - for (int j = 0; j < count; ++j) { - int varNum = r.nextInt(domainSize); - BDD c = d.ithVar(varNum); //.andWith(d2.ithVar(domainSize - varNum - 1)); - b.orWith(c); - } - BDD var = d.set(); - Iterator i1 = b.iterator(var); - Iterator i2 = b.iterator2(var); - b.free(); - Set s1 = new HashSet(); - Set s2 = new HashSet(); - while (i1.hasNext()) { - BDD b1 = (BDD) i1.next(); - double sc = b1.satCount(var); - if (sc != 1.) { - System.out.println("Error, iterator() returned BDD with satcount "+sc+" : "+b1); - } - s1.add(b1); - } - while (i2.hasNext()) { - BDD b2 = (BDD) i2.next(); - double sc = b2.satCount(var); - if (sc != 1.) { - System.out.println("Error, iterator2() returned BDD with satcount "+sc+" : "+b2); - } - s2.add(b2); - } - var.free(); - if (!s1.equals(s2)) { - Set s1_minus_s2 = new HashSet(s1); - s1_minus_s2.removeAll(s2); - Set s2_minus_s1 = new HashSet(s2); - s2_minus_s1.removeAll(s1); - System.out.println("iterator() contains these extras: "+s1_minus_s2); - System.out.println("iterator2() contains these extras: "+s2_minus_s1); - } - for (Iterator k = s1.iterator(); k.hasNext(); ) { - BDD q = (BDD) k.next(); - q.free(); - } - for (Iterator k = s2.iterator(); k.hasNext(); ) { - BDD q = (BDD) k.next(); - q.free(); - } - } - } - } --- 1512,1514 ---- Index: TestBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/TestBDDFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestBDDFactory.java 18 Oct 2004 09:45:43 -0000 1.3 --- TestBDDFactory.java 19 Oct 2004 11:11:35 -0000 1.4 *************** *** 862,865 **** --- 862,875 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getCacheSize() + */ + public int getCacheSize() { + int r1 = f1.getCacheSize(); + int r2 = f2.getCacheSize(); + assertSame(r1 == r2, "getCacheSize"); + return r1; + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#reorderGain() */ Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/JFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JFactory.java 19 Oct 2004 04:34:48 -0000 1.4 --- JFactory.java 19 Oct 2004 11:11:35 -0000 1.5 *************** *** 41,47 **** */ public static BDDFactory init(int nodenum, int cachesize) { ! BDDFactory INSTANCE = new JFactory(); ! INSTANCE.initialize(nodenum, cachesize); ! return INSTANCE; } --- 41,47 ---- */ public static BDDFactory init(int nodenum, int cachesize) { ! BDDFactory f = new JFactory(); ! f.initialize(nodenum, cachesize); ! return f; } *************** *** 2981,2986 **** } - newsize = bdd_prime_lte(newsize); - return doResize(doRehash, oldsize, newsize); } --- 2981,2984 ---- *************** *** 2997,3003 **** int doResize(boolean doRehash, int oldsize, int newsize) { ! if (oldsize > newsize) { ! return bdd_error(BDD_RANGE); ! } bddnodesize = newsize; --- 2995,3001 ---- int doResize(boolean doRehash, int oldsize, int newsize) { ! newsize = bdd_prime_lte(newsize); ! ! if (oldsize > newsize) return 0; bddnodesize = newsize; *************** *** 5453,5456 **** --- 5451,5461 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getCacheSize() + */ + public int getCacheSize() { + return cachesize; + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#reorderGain() */ Index: BDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDDFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BDDFactory.java 19 Oct 2004 04:34:48 -0000 1.3 --- BDDFactory.java 19 Oct 2004 11:11:35 -0000 1.4 *************** *** 160,165 **** protected BDDFactory() { String s = this.getClass().toString(); ! s = s.substring(s.lastIndexOf('.')+1); ! System.out.println("Using BDD package: "+s); } --- 160,167 ---- protected BDDFactory() { String s = this.getClass().toString(); ! if (false) { ! s = s.substring(s.lastIndexOf('.')+1); ! System.out.println("Using BDD package: "+s); ! } } *************** *** 257,262 **** /** ! * <p>Resets the BDD package. This function frees all memory used by the BDD ! * package and resets the package to its initial state.</p> * * <p>Compare to bdd_done.</p> --- 259,277 ---- /** ! * <p>Reset the BDD factory to its initial state. Everything ! * is reallocated from scratch. This is like calling done() ! * followed by initialize().</p> ! */ ! public void reset() { ! int nodes = getNodeTableSize(); ! int cache = getCacheSize(); ! done(); ! initialize(nodes, cache); ! } ! ! /** ! * <p>This function frees all memory used by the BDD ! * package and resets the package to its uninitialized state. ! * The BDD package is no longer usable after this call.</p> * * <p>Compare to bdd_done.</p> *************** *** 977,980 **** --- 992,1002 ---- /** + * <p>Get the current size of the cache, in entries.</p> + * + * @return size of cache + */ + public abstract int getCacheSize(); + + /** * <p>Calculate the gain in size after a reordering. The value returned is * (100*(A-B))/A, where A is previous number of used nodes and B is current Index: TypedBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/TypedBDDFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TypedBDDFactory.java 18 Oct 2004 09:45:43 -0000 1.3 --- TypedBDDFactory.java 19 Oct 2004 11:11:35 -0000 1.4 *************** *** 364,367 **** --- 364,374 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getCacheSize() + */ + public int getCacheSize() { + return factory.getCacheSize(); + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#reorderGain() */ Index: JDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/JDDFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JDDFactory.java 18 Oct 2004 09:38:18 -0000 1.3 --- JDDFactory.java 19 Oct 2004 11:11:35 -0000 1.4 *************** *** 31,36 **** */ public static BDDFactory init(int nodenum, int cachesize) { ! BDDFactory INSTANCE = new JDDFactory(nodenum, cachesize); ! return INSTANCE; } --- 31,36 ---- */ public static BDDFactory init(int nodenum, int cachesize) { ! BDDFactory f = new JDDFactory(nodenum, cachesize); ! return f; } *************** *** 605,608 **** --- 605,616 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getCacheSize() + */ + public int getCacheSize() { + // TODO Implement this. + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ Index: BuDDyFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BuDDyFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BuDDyFactory.java 19 Oct 2004 09:13:59 -0000 1.4 --- BuDDyFactory.java 19 Oct 2004 11:11:35 -0000 1.5 *************** *** 8,11 **** --- 8,15 ---- import java.util.Iterator; import java.util.List; + import java.io.File; + import java.io.FileInputStream; + import java.io.FileOutputStream; + import java.io.IOException; import java.math.BigInteger; *************** *** 36,47 **** public static BDDFactory init(int nodenum, int cachesize) { ! if (INSTANCE != null) { ! throw new InternalError("Error: BDDFactory already initialized."); ! } ! INSTANCE = new BuDDyFactory(); ! INSTANCE.initialize(nodenum, cachesize); ! return INSTANCE; } private static BuDDyFactory INSTANCE; --- 40,51 ---- public static BDDFactory init(int nodenum, int cachesize) { ! BuDDyFactory f = new BuDDyFactory(); ! f.initialize(nodenum, cachesize); ! return f; } + /** + * Single factory instance. Only one factory object is enabled at a time. + */ private static BuDDyFactory INSTANCE; *************** *** 55,68 **** String currentdir = System.getProperty("user.dir"); String sep = System.getProperty("file.separator"); ! System.load(currentdir+sep+libname); } registerNatives(); } private static native void registerNatives(); private BuDDyFactory() {} ! static final boolean USE_FINALIZER = false; private static BuDDyBDD makeBDD(int id) { --- 59,100 ---- String currentdir = System.getProperty("user.dir"); String sep = System.getProperty("file.separator"); ! String filename = currentdir+sep+libname; ! try { ! System.load(filename); ! } catch (java.lang.UnsatisfiedLinkError y) { ! File f = new File(filename); ! if (!f.exists()) throw y; ! // Try to make a copy and use that. ! try { ! File f2 = File.createTempFile("buddy", ".dll"); ! copyFile(f, f2); ! f2.deleteOnExit(); ! System.out.println("buddy.dll is in use, linking temporary copy "+f2); ! System.load(f2.getAbsolutePath()); ! } catch (IOException z) { ! throw y; ! } ! } } registerNatives(); } + private static void copyFile(File in, File out) throws IOException { + FileInputStream fis = new FileInputStream(in); + FileOutputStream fos = new FileOutputStream(out); + byte[] buf = new byte[1024]; + int i = 0; + while ((i = fis.read(buf)) != -1) { + fos.write(buf, 0, i); + } + fis.close(); + fos.close(); + } + private static native void registerNatives(); private BuDDyFactory() {} ! private static final boolean USE_FINALIZER = false; private static BuDDyBDD makeBDD(int id) { *************** *** 139,142 **** --- 171,177 ---- */ protected void initialize(int nodenum, int cachesize) { + if (INSTANCE != null) + throw new InternalError("Error: BDDFactory already initialized."); + INSTANCE = this; initialize0(nodenum, cachesize); } *************** *** 165,168 **** --- 200,214 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#reset() + */ + public void reset() { + if (USE_FINALIZER) { + System.gc(); + System.runFinalization(); + } + super.reset(); + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setError(int) */ *************** *** 488,491 **** --- 534,545 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getCacheSize() + */ + public int getCacheSize() { + return getCacheSize0(); + } + private static native int getCacheSize0(); + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getNodeNum() */ Index: CUDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/CUDDFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CUDDFactory.java 18 Oct 2004 09:45:43 -0000 1.3 --- CUDDFactory.java 19 Oct 2004 11:11:35 -0000 1.4 *************** *** 39,48 **** public static BDDFactory init(int nodenum, int cachesize) { ! if (INSTANCE != null) { ! throw new InternalError("Error: CUDDFactory already initialized."); ! } ! INSTANCE = new CUDDFactory(); ! INSTANCE.initialize(nodenum/256, cachesize); ! return INSTANCE; } --- 39,45 ---- public static BDDFactory init(int nodenum, int cachesize) { ! CUDDFactory f = new CUDDFactory(); ! f.initialize(nodenum/256, cachesize); ! return f; } *************** *** 88,91 **** --- 85,92 ---- */ protected void initialize(int nodenum, int cachesize) { + if (INSTANCE != null) { + throw new InternalError("Error: CUDDFactory already initialized."); + } + INSTANCE = this; initialize0(nodenum, cachesize); } *************** *** 404,407 **** --- 405,416 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getCacheSize() + */ + public int getCacheSize() { + // TODO Implement this. + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#reorderGain() */ Index: CALFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/CALFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CALFactory.java 18 Oct 2004 09:45:43 -0000 1.3 --- CALFactory.java 19 Oct 2004 11:11:34 -0000 1.4 *************** *** 39,48 **** public static BDDFactory init(int nodenum, int cachesize) { ! if (INSTANCE != null) { ! throw new InternalError("Error: CALFactory already initialized."); ! } ! INSTANCE = new CALFactory(); ! INSTANCE.initialize(nodenum/256, cachesize); ! return INSTANCE; } --- 39,45 ---- public static BDDFactory init(int nodenum, int cachesize) { ! CALFactory f = new CALFactory(); ! f.initialize(nodenum/256, cachesize); ! return f; } *************** *** 88,91 **** --- 85,92 ---- */ protected void initialize(int nodenum, int cachesize) { + if (INSTANCE != null) { + throw new InternalError("Error: CALFactory already initialized."); + } + INSTANCE = this; initialize0(nodenum, cachesize); } *************** *** 369,372 **** --- 370,381 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getCacheSize() + */ + public int getCacheSize() { + // TODO Implement this. + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getNodeNum() */ |
From: John W. <joe...@us...> - 2004-10-19 11:11:31
|
Update of /cvsroot/javabdd/JavaBDD/buddy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28139/buddy/src Modified Files: kernel.c bdd.h Log Message: Support for more features. Index: kernel.c =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/buddy/src/kernel.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kernel.c 1 Oct 2004 02:17:20 -0000 1.3 --- kernel.c 19 Oct 2004 11:11:21 -0000 1.4 *************** *** 1442,1447 **** int bdd_noderesize(int doRehash) { - BddNode *newnodes; int oldsize = bddnodesize; int n; --- 1442,1447 ---- int bdd_noderesize(int doRehash) { int oldsize = bddnodesize; + int newsize; int n; *************** *** 1449,1461 **** return -1; ! bddnodesize = bddnodesize << 1; ! if (bddnodesize > oldsize + bddmaxnodeincrease) ! bddnodesize = oldsize + bddmaxnodeincrease; ! if (bddnodesize > bddmaxnodesize && bddmaxnodesize > 0) ! bddnodesize = bddmaxnodesize; ! bddnodesize = bdd_prime_lte(bddnodesize); if (resize_handler != NULL) --- 1449,1473 ---- return -1; ! newsize = bddnodesize << 1; ! if (newsize > oldsize + bddmaxnodeincrease) ! newsize = oldsize + bddmaxnodeincrease; ! if (newsize > bddmaxnodesize && bddmaxnodesize > 0) ! newsize = bddmaxnodesize; ! ! return bdd_noderesize2(doRehash, oldsize, newsize); ! } ! int bdd_noderesize2(int doRehash, int oldsize, int newsize) ! { ! int n; ! ! newsize = bdd_prime_lte(newsize); ! ! if (oldsize > newsize) { ! return 0; ! } ! bddnodesize = newsize; if (resize_handler != NULL) Index: bdd.h =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/buddy/src/bdd.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bdd.h 29 Sep 2004 10:00:49 -0000 1.2 --- bdd.h 19 Oct 2004 11:11:21 -0000 1.3 *************** *** 237,240 **** --- 237,241 ---- extern int bdd_getnodenum(void); extern int bdd_getallocnum(void); + extern int bdd_noderesize2(int, int, int); extern char* bdd_versionstr(void); extern int bdd_versionnum(void); |
From: John W. <joe...@us...> - 2004-10-19 09:14:21
|
Update of /cvsroot/javabdd/JavaBDD In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2418 Modified Files: buddy_jni.c Log Message: Index: buddy_jni.c =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/buddy_jni.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** buddy_jni.c 16 Oct 2004 02:58:57 -0000 1.21 --- buddy_jni.c 19 Oct 2004 09:14:10 -0000 1.22 *************** *** 103,106 **** --- 103,138 ---- } + static JNIEnv *jnienv; + + static void bdd_gbchandler(int code, bddGbcStat *s) + { + jclass cls = (*jnienv)->FindClass(jnienv, "net/sf/javabdd/BuDDyFactory"); + jmethodID mid = (*jnienv)->GetStaticMethodID(jnienv, cls, "gc_callback", "(I)V"); + if (mid == 0) { + return; + } + (*jnienv)->CallStaticVoidMethod(jnienv, cls, mid, code); + } + + static void bdd_resizehandler(int a, int b) + { + jclass cls = (*jnienv)->FindClass(jnienv, "net/sf/javabdd/BuDDyFactory"); + jmethodID mid = (*jnienv)->GetStaticMethodID(jnienv, cls, "resize_callback", "(II)V"); + if (mid == 0) { + return; + } + (*jnienv)->CallStaticVoidMethod(jnienv, cls, mid, a, b); + } + + static void bdd_reorderhandler(int a) + { + jclass cls = (*jnienv)->FindClass(jnienv, "net/sf/javabdd/BuDDyFactory"); + jmethodID mid = (*jnienv)->GetStaticMethodID(jnienv, cls, "reorder_callback", "(I)V"); + if (mid == 0) { + return; + } + (*jnienv)->CallStaticVoidMethod(jnienv, cls, mid, a); + } + /**** START OF NATIVE METHOD IMPLEMENTATIONS ****/ *************** *** 125,128 **** --- 157,161 ---- jint width, r; jint* a; + jnienv = env; width = (*env)->GetArrayLength(env, arr); *************** *** 148,151 **** --- 181,185 ---- jint width, r; jint* a; + jnienv = env; width = (*env)->GetArrayLength(env, arr); *************** *** 171,174 **** --- 205,209 ---- jint width, r; jint* a; + jnienv = env; width = (*env)->GetArrayLength(env, arr); *************** *** 200,203 **** --- 235,250 ---- #endif bdd_error_hook(bdd_errhandler); + #if defined(TRACE_BUDDYLIB) + printf("bdd_resize_hook(%p)\n", bdd_resizehandler); + #endif + bdd_resize_hook(bdd_resizehandler); + #if defined(TRACE_BUDDYLIB) + printf("bdd_gbc_hook(%p)\n", bdd_gbchandler); + #endif + bdd_gbc_hook(bdd_gbchandler); + #if defined(TRACE_BUDDYLIB) + printf("bdd_reorder_hook(%p)\n", bdd_reorderhandler); + #endif + bdd_reorder_hook(bdd_reorderhandler); check_error(env); } *************** *** 225,228 **** --- 272,276 ---- (JNIEnv *env, jclass cl) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_done()\n"); *************** *** 271,274 **** --- 319,323 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_setmaxnodenum(%d)\n", size); *************** *** 282,295 **** * Class: net_sf_javabdd_BuDDyFactory * Method: setMinFreeNodes0 ! * Signature: (I)V */ ! JNIEXPORT void JNICALL Java_net_sf_javabdd_BuDDyFactory_setMinFreeNodes0 (JNIEnv *env, jclass cl, jint n) { #if defined(TRACE_BUDDYLIB) printf("bdd_setminfreenodes(%d)\n", n); #endif ! bdd_setminfreenodes(n); check_error(env); } --- 331,347 ---- * Class: net_sf_javabdd_BuDDyFactory * Method: setMinFreeNodes0 ! * Signature: (I)I */ ! JNIEXPORT jint JNICALL Java_net_sf_javabdd_BuDDyFactory_setMinFreeNodes0 (JNIEnv *env, jclass cl, jint n) { + int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_setminfreenodes(%d)\n", n); #endif ! result = bdd_setminfreenodes(n); check_error(env); + return result; } *************** *** 303,306 **** --- 355,359 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_setmaxincrease(%d)\n", size); *************** *** 320,323 **** --- 373,377 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_setcacheratio(%d)\n", r); *************** *** 337,340 **** --- 391,395 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_varnum()\n"); *************** *** 354,357 **** --- 409,413 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_setvarnum(%d)\n", num); *************** *** 371,374 **** --- 427,431 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_extvarnum(%d)\n", num); *************** *** 388,391 **** --- 445,449 ---- { BDD b; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_ithvar(%d)\n", var); *************** *** 405,408 **** --- 463,467 ---- { BDD b; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_nithvar(%d)\n", var); *************** *** 421,424 **** --- 480,484 ---- (JNIEnv *env, jclass cl, jint v1, jint v2) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_swapvar(%d, %d)\n", v1, v2); *************** *** 438,441 **** --- 498,502 ---- bddPair* pair; jlong r; + jnienv = env; #if defined(TRACE_BUDDYLIB) *************** *** 455,458 **** --- 516,520 ---- (JNIEnv *env, jclass cl) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_printall()\n"); *************** *** 471,474 **** --- 533,537 ---- (JNIEnv *env, jclass cl, jint bdd) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_printtable(%d)\n", bdd); *************** *** 490,493 **** --- 553,557 ---- int rc; char *str; + jnienv = env; str = (char*) (*env)->GetStringUTFChars(env, fname, NULL); *************** *** 512,515 **** --- 576,580 ---- int rc; char *str; + jnienv = env; str = (char*) (*env)->GetStringUTFChars(env, fname, NULL); *************** *** 532,535 **** --- 597,601 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_level2var(%d)\n", level); *************** *** 549,552 **** --- 615,619 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_var2level(%d)\n", var); *************** *** 565,568 **** --- 632,636 ---- (JNIEnv * env, jclass cl, jint method) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_reorder(%d)\n", method); *************** *** 580,583 **** --- 648,652 ---- (JNIEnv *env, jclass cl, jint method) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_autoreorder(%d)\n", method); *************** *** 595,598 **** --- 664,668 ---- (JNIEnv *env, jclass cl, jint method, jint n) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_autoreorder_times(%d, %d)\n", method, n); *************** *** 611,614 **** --- 681,685 ---- { int method; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_getreorder_method()\n"); *************** *** 628,631 **** --- 699,703 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_getreorder_times()\n"); *************** *** 644,647 **** --- 716,720 ---- (JNIEnv *env, jclass cl) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_disable_reorder()\n"); *************** *** 659,662 **** --- 732,736 ---- (JNIEnv *env, jclass cl) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_enable_reorder()\n"); *************** *** 675,678 **** --- 749,753 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_reorder_verbose(%d)\n", level); *************** *** 693,696 **** --- 768,772 ---- jint *a; jint size, varnum; + jnienv = env; size = (*env)->GetArrayLength(env, arr); varnum = bdd_varnum(); *************** *** 719,722 **** --- 795,799 ---- (JNIEnv *env, jclass cl, jint var, jboolean fixed) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_addvarblock(%d, %d)\n", var , fixed); *************** *** 734,737 **** --- 811,815 ---- (JNIEnv *env, jclass cl, jint first, jint last, jboolean fixed) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_intaddvarblock(%d, %d, %d)\n", first, last, fixed); *************** *** 749,752 **** --- 827,831 ---- (JNIEnv *env, jclass cl) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_varblockall()\n"); *************** *** 764,767 **** --- 843,847 ---- (JNIEnv *env, jclass cl) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_clrvarblocks()\n"); *************** *** 779,782 **** --- 859,863 ---- (JNIEnv *env, jclass cl) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_printorder()\n"); *************** *** 798,801 **** --- 879,883 ---- jint size; int result; + jnienv = env; size = (*env)->GetArrayLength(env, arr); a = (*env)->GetIntArrayElements(env, arr, 0); *************** *** 819,822 **** --- 901,905 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_getallocnum()\n"); *************** *** 836,839 **** --- 919,923 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_getnodenum()\n"); *************** *** 853,856 **** --- 937,941 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_reorder_gain()\n"); *************** *** 869,872 **** --- 954,958 ---- (JNIEnv *env, jclass c) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_printstat()\n"); *************** *** 886,889 **** --- 972,976 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_var(%d)\n", b); *************** *** 903,906 **** --- 990,994 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_high(%d)\n", b); *************** *** 920,923 **** --- 1008,1012 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_low(%d)\n", b); *************** *** 936,939 **** --- 1025,1029 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_not(%d)\n", b); *************** *** 953,956 **** --- 1043,1047 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_ite(%d, %d, %d)\n", b, c, d); *************** *** 970,973 **** --- 1061,1065 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_relprod(%d, %d, %d)\n", b, c, d); *************** *** 987,990 **** --- 1079,1083 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_compose(%d, %d, %d)\n", b, c, v); *************** *** 1004,1007 **** --- 1097,1101 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_constrain(%d, %d)\n", b, c); *************** *** 1021,1024 **** --- 1115,1119 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_exist(%d, %d)\n", b, c); *************** *** 1038,1041 **** --- 1133,1137 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_forall(%d, %d)\n", b, c); *************** *** 1055,1058 **** --- 1151,1155 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_unique(%d, %d)\n", b, c); *************** *** 1072,1075 **** --- 1169,1173 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_restrict(%d, %d)\n", b, c); *************** *** 1089,1092 **** --- 1187,1191 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_simplify(%d, %d)\n", b, c); *************** *** 1106,1109 **** --- 1205,1209 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_support(%d)\n", b); *************** *** 1123,1126 **** --- 1223,1227 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_apply(%d, %d, %d)\n", b, c, operation); *************** *** 1140,1143 **** --- 1241,1245 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_appall(%d, %d, %d, %d)\n", b, c, operation, d); *************** *** 1157,1160 **** --- 1259,1263 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_appex(%d, %d, %d, %d)\n", b, c, operation, d); *************** *** 1174,1177 **** --- 1277,1281 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_appuni(%d, %d, %d, %d)\n", b, c, operation, d); *************** *** 1191,1194 **** --- 1295,1299 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_satone(%d)\n", b); *************** *** 1208,1211 **** --- 1313,1317 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_fullsatone(%d)\n", b); *************** *** 1225,1228 **** --- 1331,1335 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_satoneset(%d, %d, %d)\n", b, c, d); *************** *** 1256,1259 **** --- 1363,1367 ---- jclass c; int size; + jnienv = env; c = (*env)->FindClass(env, "[B"); #if defined(TRACE_BUDDYLIB) *************** *** 1285,1288 **** --- 1393,1397 ---- (JNIEnv *env, jclass cl, jint b) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_printset(%d)\n", b); *************** *** 1301,1304 **** --- 1410,1414 ---- (JNIEnv *env, jclass cl, jint b) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_printdot(%d)\n", b); *************** *** 1318,1321 **** --- 1428,1432 ---- { int result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_nodecount(%d)\n", b); *************** *** 1335,1338 **** --- 1446,1450 ---- { double result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_pathcount(%d)\n", b); *************** *** 1352,1355 **** --- 1464,1468 ---- { double result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_satcount(%d)\n", b); *************** *** 1369,1372 **** --- 1482,1486 ---- { double result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_satcountset(%d, %d)\n", b, c); *************** *** 1386,1389 **** --- 1500,1504 ---- { double result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_satcountln(%d)\n", b); *************** *** 1403,1406 **** --- 1518,1522 ---- { double result; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_satcountlnset(%d, %d)\n", b, c); *************** *** 1422,1425 **** --- 1538,1542 ---- int size; int* arr; + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_varnum()\n"); *************** *** 1447,1450 **** --- 1564,1568 ---- (JNIEnv *env, jclass cl, jint b) { + jnienv = env; #if defined(TRACE_BUDDYLIB) printf("bdd_addref(%d)\n", b); *************** *** 1462,1465 **** --- 1580,1584 ---- (JNIEnv *env, jclass cl, jint b) { + jnienv = env; if (b != INVALID_BDD) { #if defined(TRACE_BUDDYLIB) *************** *** 1481,1484 **** --- 1600,1604 ---- int result; bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; #if defined(TRACE_BUDDYLIB) *************** *** 1500,1503 **** --- 1620,1624 ---- int result; bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; #if defined(TRACE_BUDDYLIB) *************** *** 1520,1523 **** --- 1641,1645 ---- { bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; #if defined(TRACE_BUDDYLIB) *************** *** 1540,1543 **** --- 1662,1666 ---- jint *a2; bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; size1 = (*env)->GetArrayLength(env, arr1); *************** *** 1573,1576 **** --- 1696,1700 ---- { bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; #if defined(TRACE_BUDDYLIB) *************** *** 1593,1596 **** --- 1717,1721 ---- bdd *a2; bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; size1 = (*env)->GetArrayLength(env, arr1); *************** *** 1626,1629 **** --- 1751,1755 ---- { bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; #if defined(TRACE_BUDDYLIB) *************** *** 1643,1646 **** --- 1769,1773 ---- { bddPair* p; + jnienv = env; p = (bddPair*) (intptr_cast_type) pair; if (p) { |
From: John W. <joe...@us...> - 2004-10-19 09:14:08
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2345/net/sf/javabdd Modified Files: BuDDyFactory.java Log Message: Index: BuDDyFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BuDDyFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BuDDyFactory.java 18 Oct 2004 09:45:43 -0000 1.3 --- BuDDyFactory.java 19 Oct 2004 09:13:59 -0000 1.4 *************** *** 1088,1090 **** --- 1088,1101 ---- private static native String getVersion0(); + private static void gc_callback(int i) { + INSTANCE.doCallbacks(INSTANCE.gc_callbacks, i); + } + + private static void reorder_callback(int i) { + INSTANCE.doCallbacks(INSTANCE.reorder_callbacks, i); + } + + private static void resize_callback(int i, int j) { + INSTANCE.doCallbacks(INSTANCE.resize_callbacks, i); + } } |
From: John W. <joe...@us...> - 2004-10-19 06:52:17
|
Update of /cvsroot/javabdd/JavaBDD_tests/bdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7406/bdd Added Files: BasicTests.java Log Message: Some tests of basic functionality. --- NEW FILE: BasicTests.java --- // BasicTests.java, created Oct 18, 2004 10:42:34 PM by jwhaley // Copyright (C) 2004 jwhaley // Licensed under the terms of the GNU LGPL; see COPYING for details. package bdd; import junit.framework.Assert; import net.sf.javabdd.BDD; import net.sf.javabdd.BDDException; import net.sf.javabdd.BDDFactory; /** * BasicTests * * @author jwhaley * @version $Id: BasicTests.java,v 1.1 2004/10/19 06:52:08 joewhaley Exp $ */ public class BasicTests extends BDDTestCase { public static void main(String[] args) { junit.textui.TestRunner.run(BasicTests.class); } public void testIsZeroOne() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); BDD x = bdd.zero(); BDD y = bdd.one(); if (bdd.varNum() < 5) bdd.setVarNum(5); BDD z = bdd.ithVar(1); Assert.assertEquals(true, x.isZero()); Assert.assertEquals(false, x.isOne()); Assert.assertEquals(false, y.isZero()); Assert.assertEquals(true, y.isOne()); Assert.assertEquals(false, z.isZero()); Assert.assertEquals(false, z.isOne()); x.free(); y.free(); z.free(); } } public void testVar() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); bdd.setVarOrder(new int[] { 0, 1, 2, 3, 4 }); BDD a = bdd.ithVar(1); BDD b = bdd.ithVar(2); BDD c = bdd.ithVar(3); BDD d = bdd.one(); BDD e = bdd.zero(); Assert.assertEquals(1, a.var()); Assert.assertEquals(2, b.var()); Assert.assertEquals(3, c.var()); try { d.var(); Assert.fail(); } catch (BDDException x) { } try { e.var(); Assert.fail(); } catch (BDDException x) { } BDD f = a.and(b); Assert.assertEquals(1, f.var()); a.free(); b.free(); c.free(); d.free(); e.free(); f.free(); } } public void testVarOrder() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); bdd.setVarOrder(new int[] { 0, 1, 2, 3, 4 }); BDD a = bdd.ithVar(0); BDD b = bdd.ithVar(1); BDD c = bdd.ithVar(2); BDD d = bdd.ithVar(3); BDD e = bdd.ithVar(4); Assert.assertEquals(0, a.var()); Assert.assertEquals(1, b.var()); Assert.assertEquals(2, c.var()); Assert.assertEquals(3, d.var()); Assert.assertEquals(4, e.var()); bdd.setVarOrder(new int[] { 2, 3, 4, 0, 1 }); Assert.assertEquals(0, a.var()); Assert.assertEquals(1, b.var()); Assert.assertEquals(2, c.var()); Assert.assertEquals(3, d.var()); Assert.assertEquals(4, e.var()); Assert.assertEquals(3, a.level()); Assert.assertEquals(4, b.level()); Assert.assertEquals(0, c.level()); Assert.assertEquals(1, d.level()); Assert.assertEquals(2, e.level()); a.free(); b.free(); c.free(); d.free(); e.free(); } } public void testLowHigh() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); bdd.setVarOrder(new int[] { 0, 1, 2, 3, 4 }); BDD a, b, c; a = bdd.ithVar(0); a.andWith(bdd.ithVar(1)); a.andWith(bdd.nithVar(2)); Assert.assertEquals(0, a.var()); b = a.low(); Assert.assertEquals(true, b.isZero()); b.free(); b = a.high(); Assert.assertEquals(1, b.var()); c = b.high(); b.free(); Assert.assertEquals(2, c.var()); b = c.low(); Assert.assertEquals(true, b.isOne()); a.free(); b.free(); c.free(); } } public void testNot() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); BDD a, b, c; a = bdd.ithVar(0); b = a.not(); c = bdd.nithVar(0); Assert.assertEquals(b, c); c.free(); c = b.high(); Assert.assertEquals(true, c.isZero()); c.free(); c = b.low(); Assert.assertEquals(true, c.isOne()); a.free(); b.free(); c.free(); } } public void testId() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); BDD a, b; a = bdd.ithVar(1); b = a.id(); a.andWith(bdd.ithVar(0)); Assert.assertTrue(!a.equals(b)); Assert.assertTrue(a.var() == 0); Assert.assertTrue(b.var() == 1); b.andWith(bdd.zero()); Assert.assertTrue(b.isZero()); Assert.assertTrue(!a.isZero()); a.free(); b.free(); } } void testApply(BDDFactory bdd, BDDFactory.BDDOp op, boolean b1, boolean b2, boolean b3, boolean b4) { BDD a; Assert.assertEquals(b1, (a = bdd.zero().applyWith(bdd.zero(), op)).isOne()); a.free(); Assert.assertEquals(b2, (a = bdd.zero().applyWith(bdd.one(), op)).isOne()); a.free(); Assert.assertEquals(b3, (a = bdd.one().applyWith(bdd.zero(), op)).isOne()); a.free(); Assert.assertEquals(b4, (a = bdd.one().applyWith(bdd.one(), op)).isOne()); a.free(); } public void testOr() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); BDD a, b, c; a = bdd.ithVar(1); b = bdd.ithVar(2); c = bdd.nithVar(1); c.orWith(a); Assert.assertTrue(c.isOne()); a = bdd.zero(); a.orWith(bdd.zero()); Assert.assertTrue(a.isZero()); b.orWith(b); Assert.assertEquals(2, b.var()); a.free(); b.free(); c.free(); testApply(bdd, BDDFactory.or, false, true, true, true); } } public void testXor() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); BDD a, b, c; a = bdd.ithVar(1); b = bdd.ithVar(2); c = bdd.nithVar(1); c.xorWith(a); Assert.assertTrue(c.isOne()); a = bdd.zero(); a.orWith(bdd.zero()); Assert.assertTrue(a.isZero()); b.xorWith(b); Assert.assertTrue(b.isZero()); a.free(); b.free(); c.free(); testApply(bdd, BDDFactory.xor, false, true, true, false); } } public void testImp() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); // TODO: more tests testApply(bdd, BDDFactory.imp, true, true, false, true); } } public void testBiimp() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); // TODO: more tests testApply(bdd, BDDFactory.biimp, true, false, false, true); } } public void testDiff() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); // TODO: more tests testApply(bdd, BDDFactory.diff, false, false, true, false); } } public void testLess() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); // TODO: more tests testApply(bdd, BDDFactory.less, false, true, false, false); } } public void testInvImp() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); // TODO: more tests testApply(bdd, BDDFactory.invimp, true, false, true, true); } } public void testNand() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); // TODO: more tests testApply(bdd, BDDFactory.nand, true, true, true, false); } } public void testNor() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); // TODO: more tests testApply(bdd, BDDFactory.nor, true, false, false, false); } } public void testIte() { reset(); Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); if (bdd.varNum() < 5) bdd.setVarNum(5); BDD a, b, c, d, e; a = bdd.ithVar(1); b = bdd.one(); c = bdd.zero(); d = a.ite(b, c); Assert.assertEquals(a, d); d.free(); d = a.ite(c, b); e = d.not(); Assert.assertEquals(a, e); d.free(); e.free(); e = bdd.ithVar(2); d = e.ite(a, a); Assert.assertEquals(a, d); // TODO: more tests. a.free(); b.free(); c.free(); d.free(); e.free(); } } } |
From: John W. <joe...@us...> - 2004-10-19 06:51:52
|
Update of /cvsroot/javabdd/JavaBDD_tests/regression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7312/regression Modified Files: R2.java Log Message: Assert that we have at least one BDD factory. Index: R2.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/regression/R2.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** R2.java 16 Oct 2004 04:31:28 -0000 1.3 --- R2.java 19 Oct 2004 06:51:43 -0000 1.4 *************** *** 21,24 **** --- 21,25 ---- public void testR2() { + Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); |
From: John W. <joe...@us...> - 2004-10-19 06:51:30
|
Update of /cvsroot/javabdd/JavaBDD_tests/regression In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7251/regression Modified Files: R1.java Log Message: Assert that we have at least one BDD factory. Index: R1.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/regression/R1.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** R1.java 16 Oct 2004 04:31:28 -0000 1.4 --- R1.java 19 Oct 2004 06:51:21 -0000 1.5 *************** *** 22,25 **** --- 22,26 ---- public void testR1() { + Assert.assertTrue(hasNext()); while (hasNext()) { BDDFactory bdd = nextFactory(); |
From: John W. <joe...@us...> - 2004-10-19 06:50:55
|
Update of /cvsroot/javabdd/JavaBDD_tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7115 Modified Files: NQueensTest.java Log Message: Assert that we have at least one BDD factory. Index: NQueensTest.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/NQueensTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NQueensTest.java 28 Jul 2004 10:20:53 -0000 1.3 --- NQueensTest.java 19 Oct 2004 06:50:45 -0000 1.4 *************** *** 24,27 **** --- 24,28 ---- public void testNQueens() { + Assert.assertTrue(hasNext()); while (hasNext()) { NQueens.B = nextFactory(); |
From: John W. <joe...@us...> - 2004-10-19 06:50:18
|
Update of /cvsroot/javabdd/JavaBDD_tests/bdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7038/bdd Modified Files: BDDTestCase.java Log Message: Index: BDDTestCase.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD_tests/bdd/BDDTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BDDTestCase.java 16 Oct 2004 04:31:27 -0000 1.2 --- BDDTestCase.java 19 Oct 2004 06:50:09 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- // Licensed under the terms of the GNU LGPL; see COPYING for details. package bdd; + import java.util.Collection; import java.util.Iterator; *************** *** 50,54 **** public BDDTestCase(int nodenum, int cachesize) { initFactories(nodenum, cachesize); ! i = factories.iterator(); } public BDDTestCase() { --- 51,55 ---- public BDDTestCase(int nodenum, int cachesize) { initFactories(nodenum, cachesize); ! reset(); } public BDDTestCase() { *************** *** 72,74 **** --- 73,78 ---- } + public void reset() { + i = factories.iterator(); + } } |
From: John W. <joe...@us...> - 2004-10-19 04:34:58
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14629/net/sf/javabdd Modified Files: JFactory.java TryVarOrder.java BDDFactory.java Removed Files: CUDDFactory$1.class CALFactory$1.class BuDDyFactory$1.class JDDFactory$1.class BDDFactory$1.class Log Message: Small updates. --- BDDFactory$1.class DELETED --- Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/JFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JFactory.java 18 Oct 2004 09:45:43 -0000 1.3 --- JFactory.java 19 Oct 2004 04:34:48 -0000 1.4 *************** *** 2463,2467 **** void gbc_handler(boolean pre, GCStats s) { ! bdd_default_gbchandler(pre, s); } --- 2463,2471 ---- void gbc_handler(boolean pre, GCStats s) { ! if (gc_callbacks == null) { ! bdd_default_gbchandler(pre, s); ! } else { ! doCallbacks(gc_callbacks, pre?1:0); ! } } *************** *** 4212,4215 **** --- 4216,4224 ---- void reorder_handler(boolean b) { + if (reorder_callbacks == null) { + bdd_default_reohandler(b?1:0); + } else { + doCallbacks(reorder_callbacks, b?1:0); + } } --- BuDDyFactory$1.class DELETED --- Index: BDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDDFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- BDDFactory.java 19 Oct 2004 04:34:48 -0000 1.3 *************** *** 1593,1597 **** Method m = (Method) cb[1]; try { ! m.invoke(o, new Object[] { Integer.valueOf(val) } ); } catch (IllegalArgumentException e) { e.printStackTrace(); --- 1593,1597 ---- Method m = (Method) cb[1]; try { ! m.invoke(o, new Object[] { new Integer(val) } ); } catch (IllegalArgumentException e) { e.printStackTrace(); Index: TryVarOrder.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/TryVarOrder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TryVarOrder.java 16 Oct 2004 02:58:57 -0000 1.1 --- TryVarOrder.java 19 Oct 2004 04:34:48 -0000 1.2 *************** *** 89,93 **** try { Method m = c.getMethod("setError", new Class[] { int.class }); ! m.invoke(bdd, new Object[] { Integer.valueOf(code) }); } catch (Exception x) { System.err.println("Exception occurred while setting error for BDD factory: "+x.getLocalizedMessage()); --- 89,93 ---- try { Method m = c.getMethod("setError", new Class[] { int.class }); ! m.invoke(bdd, new Object[] { new Integer(code) }); } catch (Exception x) { System.err.println("Exception occurred while setting error for BDD factory: "+x.getLocalizedMessage()); --- JDDFactory$1.class DELETED --- --- CUDDFactory$1.class DELETED --- --- CALFactory$1.class DELETED --- |
From: John W. <joe...@us...> - 2004-10-18 09:45:55
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22165/net/sf/javabdd Modified Files: CALFactory.java TestBDDFactory.java JFactory.java BuDDyFactory.java CUDDFactory.java TypedBDDFactory.java Log Message: Fixed $Revision$ tags. Index: TestBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/TestBDDFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestBDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- TestBDDFactory.java 18 Oct 2004 09:45:43 -0000 1.3 *************** *** 975,978 **** --- 975,979 ---- } + public static final String REVISION = "$Revision$"; /* (non-Javadoc) *************** *** 980,984 **** */ public String getVersion() { ! return "TestBDD $Revision$ of ("+f1.getVersion()+","+f1.getVersion()+")"; } } --- 981,986 ---- */ public String getVersion() { ! return "TestBDD "+REVISION.substring(11, REVISION.length()-2)+ ! " of ("+f1.getVersion()+","+f1.getVersion()+")"; } } Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/JFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- JFactory.java 18 Oct 2004 09:45:43 -0000 1.3 *************** *** 29,36 **** static final boolean VERIFY_ASSERTIONS = false; ! static final String VERSION = "JFactory $Revision$"; public String getVersion() { ! return VERSION; } --- 29,36 ---- static final boolean VERIFY_ASSERTIONS = false; ! public static final String REVISION = "$Revision$"; public String getVersion() { ! return "JFactory "+REVISION.substring(11, REVISION.length()-2); } Index: TypedBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/TypedBDDFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypedBDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- TypedBDDFactory.java 18 Oct 2004 09:45:43 -0000 1.3 *************** *** 1165,1168 **** --- 1165,1169 ---- } + public static final String REVISION = "$Revision$"; /* (non-Javadoc) *************** *** 1170,1174 **** */ public String getVersion() { ! return "TypedBDD $Revision$ with "+factory.getVersion(); } } --- 1171,1176 ---- */ public String getVersion() { ! return "TypedBDD "+REVISION.substring(11, REVISION.length()-2)+ ! " with "+factory.getVersion(); } } Index: BuDDyFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BuDDyFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BuDDyFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- BuDDyFactory.java 18 Oct 2004 09:45:43 -0000 1.3 *************** *** 471,482 **** /* (non-Javadoc) - * @see net.sf.javabdd.BDDFactory#getVersion() - */ - public String getVersion() { - return getVersion0(); - } - private static native String getVersion0(); - - /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#nodeCount(java.util.Collection) */ --- 471,474 ---- *************** *** 1086,1088 **** --- 1078,1090 ---- } + public static final String REVISION = "$Revision$"; + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getVersion() + */ + public String getVersion() { + return getVersion0()+" rev"+REVISION.substring(11, REVISION.length()-2); + } + private static native String getVersion0(); + } Index: CUDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/CUDDFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CUDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- CUDDFactory.java 18 Oct 2004 09:45:43 -0000 1.3 *************** *** 930,938 **** } /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getVersion() */ public String getVersion() { ! return "CUDD r$Revision$"; } --- 930,940 ---- } + public static final String REVISION = "$Revision$"; + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getVersion() */ public String getVersion() { ! return "CUDD "+REVISION.substring(11, REVISION.length()-2); } Index: CALFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/CALFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CALFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- CALFactory.java 18 Oct 2004 09:45:43 -0000 1.3 *************** *** 888,896 **** } /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getVersion() */ public String getVersion() { ! return "CAL r$Revision$"; } --- 888,898 ---- } + public static final String REVISION = "$Revision$"; + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getVersion() */ public String getVersion() { ! return "CAL "+REVISION.substring(11, REVISION.length()-2); } |
From: John W. <joe...@us...> - 2004-10-18 09:38:34
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20489/net/sf/javabdd Modified Files: JDDFactory.java Log Message: Index: JDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/JDDFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 --- JDDFactory.java 18 Oct 2004 09:38:18 -0000 1.3 *************** *** 921,930 **** } ! /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getVersion() */ public String getVersion() { ! return "JDD r$Revision$"; } } --- 921,931 ---- } ! public static final String REVISION = "$Revision$"; ! /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#getVersion() */ public String getVersion() { ! return "JDD "+REVISION.substring(11, REVISION.length()-2); } } |
From: John W. <joe...@us...> - 2004-10-18 09:35:36
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19737/net/sf/javabdd Modified Files: CALFactory.java TestBDDFactory.java JFactory.java BDDBitVector.java JDDFactory.java BuDDyFactory.java BDDDomain.java CUDDFactory.java BDDFactory.java TypedBDDFactory.java Log Message: Updates to API to approach 1.0 release. Index: TestBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/TestBDDFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestBDDFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- TestBDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 4,12 **** package net.sf.javabdd; - import java.io.IOException; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; /** --- 4,13 ---- package net.sf.javabdd; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; + import java.io.IOException; + import java.math.BigInteger; /** *************** *** 557,568 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public void setMinFreeNodes(int x) { ! f1.setMinFreeNodes(x); ! f2.setMinFreeNodes(x); } /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setMaxIncrease(int) */ --- 558,581 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(double) */ ! public double setMinFreeNodes(double x) { ! double r1 = f1.setMinFreeNodes(x); ! double r2 = f2.setMinFreeNodes(x); ! assertSame(r1 == r2, "setMinFreeNodes"); ! return r1; } /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setIncreaseFactor(double) + */ + public double setIncreaseFactor(double x) { + double r1 = f1.setIncreaseFactor(x); + double r2 = f2.setIncreaseFactor(x); + assertSame(r1 == r2, "setIncreaseFactor"); + return r1; + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setMaxIncrease(int) */ *************** *** 575,583 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public int setCacheRatio(int x) { ! int r1 = f1.setCacheRatio(x); ! int r2 = f2.setCacheRatio(x); assertSame(r1 == r2, "setCacheRatio"); return r1; --- 588,596 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(double) */ ! public double setCacheRatio(double x) { ! double r1 = f1.setCacheRatio(x); ! double r2 = f2.setCacheRatio(x); assertSame(r1 == r2, "setCacheRatio"); return r1; *************** *** 585,588 **** --- 598,621 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setNodeTableSize(int) + */ + public int setNodeTableSize(int size) { + int r1 = f1.setNodeTableSize(size); + int r2 = f2.setNodeTableSize(size); + assertSame(r1 == r2, "setNodeTableSize"); + return r1; + } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setCacheSize(int) + */ + public int setCacheSize(int size) { + int r1 = f1.setCacheSize(size); + int r2 = f2.setCacheSize(size); + assertSame(r1 == r2, "setCacheSize"); + return r1; + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#varNum() */ *************** *** 809,818 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getAllocNum() */ ! public int getAllocNum() { ! int r1 = f1.getAllocNum(); ! int r2 = f2.getAllocNum(); ! assertSame(r1 == r2, "getAllocNum"); return r1; } --- 842,851 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getNodeTableSize() */ ! public int getNodeTableSize() { ! int r1 = f1.getNodeTableSize(); ! int r2 = f2.getNodeTableSize(); ! assertSame(r1 == r2, "getNodeTableSize"); return r1; } *************** *** 864,870 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, long) */ ! protected BDDDomain createDomain(int a, long b) { return new TestBDDDomain(a, b); } --- 897,903 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, BigInteger) */ ! protected BDDDomain createDomain(int a, BigInteger b) { return new TestBDDDomain(a, b); } *************** *** 914,918 **** private class TestBDDDomain extends BDDDomain { ! TestBDDDomain(int a, long b) { super(a, b); } --- 947,951 ---- private class TestBDDDomain extends BDDDomain { ! private TestBDDDomain(int a, BigInteger b) { super(a, b); } *************** *** 942,944 **** --- 975,984 ---- } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getVersion() + */ + public String getVersion() { + return "TestBDD $Revision$ of ("+f1.getVersion()+","+f1.getVersion()+")"; + } } Index: BDDDomain.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDDDomain.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BDDDomain.java 16 Oct 2004 02:58:57 -0000 1.1 --- BDDDomain.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 42,47 **** * @param range size of this domain */ - protected BDDDomain(int index, long range) { - } protected BDDDomain(int index, BigInteger range) { BigInteger calcsize = BigInteger.valueOf(2L); --- 42,45 ---- Index: JFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/JFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- JFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 11,15 **** import java.util.List; import java.util.Random; - import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.BufferedWriter; --- 11,14 ---- *************** *** 30,33 **** --- 29,37 ---- [...1306 lines suppressed...] INSTANCE.bddrunning = this.bddrunning; --- 6104,6108 ---- INSTANCE.rng = new Random(); INSTANCE.verbose = this.verbose; ! INSTANCE.cachestats.copyFrom(this.cachestats); INSTANCE.bddrunning = this.bddrunning; *************** *** 6161,6165 **** public BDD copyNode(BDD that) { bdd b = (bdd) that; ! return new bdd(b._index); } } --- 6152,6156 ---- public BDD copyNode(BDD that) { bdd b = (bdd) that; ! return makeBDD(b._index); } } Index: BDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDDFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BDDFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- BDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- import java.util.HashMap; import java.util.Iterator; + import java.util.LinkedList; import java.util.List; import java.util.Map; *************** *** 18,24 **** import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; [...1769 lines suppressed...] + Object o = cb[0]; + Method m = (Method) cb[1]; + try { + m.invoke(o, new Object[] { Integer.valueOf(val) } ); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + if (e.getTargetException() instanceof RuntimeException) + throw (RuntimeException) e.getTargetException(); + if (e.getTargetException() instanceof Error) + throw (Error) e.getTargetException(); + e.printStackTrace(); + } + } + } + } + } Index: TypedBDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/TypedBDDFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypedBDDFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- TypedBDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 106,116 **** /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public void setMinFreeNodes(int x) { ! factory.setMinFreeNodes(x); } /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setMaxIncrease(int) */ --- 106,137 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setNodeTableSize(int) + */ + public int setNodeTableSize(int size) { + return factory.setNodeTableSize(size); + } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setCacheSize(int) + */ + public int setCacheSize(int size) { + return factory.setCacheSize(size); + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public double setMinFreeNodes(double x) { ! return factory.setMinFreeNodes(x); } /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setIncreaseFactor(double) + */ + public double setIncreaseFactor(double x) { + return factory.setIncreaseFactor(x); + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setMaxIncrease(int) */ *************** *** 120,126 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public int setCacheRatio(int x) { return factory.setCacheRatio(x); } --- 141,147 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(double) */ ! public double setCacheRatio(double x) { return factory.setCacheRatio(x); } *************** *** 331,336 **** * @see net.sf.javabdd.BDDFactory#getAllocNum() */ ! public int getAllocNum() { ! return factory.getAllocNum(); } --- 352,357 ---- * @see net.sf.javabdd.BDDFactory#getAllocNum() */ ! public int getNodeTableSize() { ! return factory.getNodeTableSize(); } *************** *** 371,377 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, long) */ ! protected BDDDomain createDomain(int a, long b) { return new TypedBDDDomain(factory.getDomain(a), a, b); } --- 392,398 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, BigInteger) */ ! protected BDDDomain createDomain(int a, BigInteger b) { return new TypedBDDDomain(factory.getDomain(a), a, b); } *************** *** 1029,1033 **** * @param range */ ! protected TypedBDDDomain(BDDDomain domain, int index, long range) { super(index, range); this.domain = domain; --- 1050,1054 ---- * @param range */ ! protected TypedBDDDomain(BDDDomain domain, int index, BigInteger range) { super(index, range); this.domain = domain; *************** *** 1143,1145 **** --- 1164,1174 ---- } + + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getVersion() + */ + public String getVersion() { + return "TypedBDD $Revision$ with "+factory.getVersion(); + } } Index: JDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/JDDFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JDDFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- JDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- import java.util.Collection; import java.util.List; + import java.math.BigInteger; /** *************** *** 562,569 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public void setMinFreeNodes(int x) { ! jdd.util.Configuration.minFreeNodesProcent = x; } --- 563,580 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(double) */ ! public double setMinFreeNodes(double x) { ! int old = jdd.util.Configuration.minFreeNodesProcent; ! jdd.util.Configuration.minFreeNodesProcent = (int)(x * 100); ! return (double) old / 100.; ! } ! ! /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setIncreaseFactor(double) ! */ ! public double setIncreaseFactor(double x) { ! // TODO. ! return 0.; } *************** *** 578,584 **** /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public int setCacheRatio(int x) { // TODO Auto-generated method stub return 0; --- 589,611 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setNodeTableSize(int) + */ + public int setNodeTableSize(int x) { + // TODO. + return getNodeTableSize(); + } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setCacheSize(int) + */ + public int setCacheSize(int x) { + // TODO. + return 0; + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public double setCacheRatio(double x) { // TODO Auto-generated method stub return 0; *************** *** 811,817 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getAllocNum() */ ! public int getAllocNum() { // todo. return bdd.countRootNodes(); --- 838,844 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getNodeTableSize() */ ! public int getNodeTableSize() { // todo. return bdd.countRootNodes(); *************** *** 855,861 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, long) */ ! protected BDDDomain createDomain(int a, long b) { return new bddDomain(a, b); } --- 882,888 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, BigInteger) */ ! protected BDDDomain createDomain(int a, BigInteger b) { return new bddDomain(a, b); } *************** *** 870,874 **** private class bddDomain extends BDDDomain { ! private bddDomain(int a, long b) { super(a, b); } --- 897,901 ---- private class bddDomain extends BDDDomain { ! private bddDomain(int a, BigInteger b) { super(a, b); } *************** *** 894,896 **** --- 921,930 ---- } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getVersion() + */ + public String getVersion() { + return "JDD r$Revision$"; + } } Index: BuDDyFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BuDDyFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BuDDyFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- BuDDyFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- import java.util.Iterator; import java.util.List; + import java.math.BigInteger; /** *************** *** 190,197 **** * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public void setMinFreeNodes(int x) { ! setMinFreeNodes0(x); } ! private static native void setMinFreeNodes0(int x); /* (non-Javadoc) --- 191,198 ---- * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public double setMinFreeNodes(double x) { ! return setMinFreeNodes0((int)(x * 100.)) / 100.; } ! private static native int setMinFreeNodes0(int x); /* (non-Javadoc) *************** *** 204,215 **** /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public int setCacheRatio(int x) { ! return setCacheRatio0(x); } private static native int setCacheRatio0(int x); /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#varNum() */ --- 205,240 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setIncreaseFactor(double) + */ + public double setIncreaseFactor(double x) { + return setIncreaseFactor0(x); + } + private static native double setIncreaseFactor0(double x); + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public double setCacheRatio(double x) { ! return setCacheRatio0((int)(x * 100.)) / 100.; } private static native int setCacheRatio0(int x); /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setNodeTableSize(int) + */ + public int setNodeTableSize(int x) { + return setNodeTableSize0(x); + } + private static native int setNodeTableSize0(int x); + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setCacheSize(int) + */ + public int setCacheSize(int x) { + return setCacheSize0(x); + } + private static native int setCacheSize0(int x); + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#varNum() */ *************** *** 446,449 **** --- 471,482 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getVersion() + */ + public String getVersion() { + return getVersion0(); + } + private static native String getVersion0(); + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#nodeCount(java.util.Collection) */ *************** *** 455,461 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getAllocNum() */ ! public int getAllocNum() { return getAllocNum0(); } --- 488,494 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getNodeTableSize() */ ! public int getNodeTableSize() { return getAllocNum0(); } *************** *** 487,493 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, long) */ ! protected BDDDomain createDomain(int a, long b) { return new BuDDyBDDDomain(a, b); } --- 520,526 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, java.math.BigInteger) */ ! protected BDDDomain createDomain(int a, BigInteger b) { return new BuDDyBDDDomain(a, b); } *************** *** 950,954 **** private static class BuDDyBDDDomain extends BDDDomain { ! private BuDDyBDDDomain(int a, long b) { super(a, b); } --- 983,987 ---- private static class BuDDyBDDDomain extends BDDDomain { ! private BuDDyBDDDomain(int a, BigInteger b) { super(a, b); } *************** *** 1017,1026 **** * @see java.lang.Object#finalize() */ - /* protected void finalize() throws Throwable { super.finalize(); ! this.free(); } - */ /** --- 1050,1058 ---- * @see java.lang.Object#finalize() */ protected void finalize() throws Throwable { super.finalize(); ! if (_ptr != 0) free0(_ptr); ! _ptr = 0; } /** Index: CUDDFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/CUDDFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CUDDFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- CUDDFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- import java.util.Collection; import java.util.List; + import java.math.BigInteger; /** *************** *** 132,140 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public void setMinFreeNodes(int x) { // TODO Implement this. System.err.println("Warning: setMinFreeNodes() not yet implemented"); } --- 133,160 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setNodeTableSize(int) */ ! public int setNodeTableSize(int size) { ! // TODO Implement this. ! System.err.println("Warning: setNodeTableSize() not yet implemented"); ! return getNodeTableSize(); ! } ! ! /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheSize(int) ! */ ! public int setCacheSize(int size) { ! // TODO Implement this. ! System.err.println("Warning: setCacheSize() not yet implemented"); ! return 0; ! } ! ! /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(double) ! */ ! public double setMinFreeNodes(double x) { // TODO Implement this. System.err.println("Warning: setMinFreeNodes() not yet implemented"); + return 0; } *************** *** 149,155 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public int setCacheRatio(int x) { // TODO Implement this. System.err.println("Warning: setCacheRatio() not yet implemented"); --- 169,175 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(double) */ ! public double setCacheRatio(double x) { // TODO Implement this. System.err.println("Warning: setCacheRatio() not yet implemented"); *************** *** 158,161 **** --- 178,190 ---- /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setIncreaseFactor(double) + */ + public double setIncreaseFactor(double x) { + // TODO Implement this. + System.err.println("Warning: setIncreaseFactor() not yet implemented"); + return 0; + } + + /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#varNum() */ *************** *** 359,365 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getAllocNum() */ ! public int getAllocNum() { return getAllocNum0(); } --- 388,394 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getNodeTableSize() */ ! public int getNodeTableSize() { return getAllocNum0(); } *************** *** 391,397 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, long) */ ! protected BDDDomain createDomain(int a, long b) { return new CUDDBDDDomain(a, b); } --- 420,426 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, BigInteger) */ ! protected BDDDomain createDomain(int a, BigInteger b) { return new CUDDBDDDomain(a, b); } *************** *** 788,792 **** private static class CUDDBDDDomain extends BDDDomain { ! private CUDDBDDDomain(int index, long range) { super(index, range); } --- 817,821 ---- private static class CUDDBDDDomain extends BDDDomain { ! private CUDDBDDDomain(int index, BigInteger range) { super(index, range); } *************** *** 901,903 **** --- 930,939 ---- } + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getVersion() + */ + public String getVersion() { + return "CUDD r$Revision$"; + } + } Index: CALFactory.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/CALFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CALFactory.java 16 Oct 2004 02:58:57 -0000 1.1 --- CALFactory.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- import java.util.Collection; import java.util.List; + import java.math.BigInteger; /** *************** *** 132,140 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(int) */ ! public void setMinFreeNodes(int x) { // TODO Implement this. System.err.println("Warning: setMinFreeNodes() not yet implemented"); } --- 133,142 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setMinFreeNodes(double) */ ! public double setMinFreeNodes(double x) { // TODO Implement this. System.err.println("Warning: setMinFreeNodes() not yet implemented"); + return 0.; } *************** *** 149,155 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(int) */ ! public int setCacheRatio(int x) { // TODO Implement this. System.err.println("Warning: setCacheRatio() not yet implemented"); --- 151,157 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#setCacheRatio(double) */ ! public double setCacheRatio(double x) { // TODO Implement this. System.err.println("Warning: setCacheRatio() not yet implemented"); *************** *** 359,365 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getAllocNum() */ ! public int getAllocNum() { // TODO Implement this. throw new UnsupportedOperationException(); --- 361,367 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#getNodeTableSize() */ ! public int getNodeTableSize() { // TODO Implement this. throw new UnsupportedOperationException(); *************** *** 391,397 **** /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, long) */ ! protected BDDDomain createDomain(int a, long b) { return new CALBDDDomain(a, b); } --- 393,399 ---- /* (non-Javadoc) ! * @see net.sf.javabdd.BDDFactory#createDomain(int, BigInteger) */ ! protected BDDDomain createDomain(int a, BigInteger b) { return new CALBDDDomain(a, b); } *************** *** 785,789 **** private static class CALBDDDomain extends BDDDomain { ! private CALBDDDomain(int index, long range) { super(index, range); } --- 787,791 ---- private static class CALBDDDomain extends BDDDomain { ! private CALBDDDomain(int index, BigInteger range) { super(index, range); } *************** *** 861,864 **** --- 863,897 ---- } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setIncreaseFactor(double) + */ + public double setIncreaseFactor(double x) { + System.err.println("Warning: setIncreaseFactor() not yet implemented"); + return 0; + } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setNodeTableSize(int) + */ + public int setNodeTableSize(int n) { + System.err.println("Warning: setNodeTableSize() not yet implemented"); + return 0; + } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#setCacheSize(int) + */ + public int setCacheSize(int n) { + System.err.println("Warning: setCacheSize() not yet implemented"); + return 0; + } + + /* (non-Javadoc) + * @see net.sf.javabdd.BDDFactory#getVersion() + */ + public String getVersion() { + return "CAL r$Revision$"; + } } Index: BDDBitVector.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDDBitVector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BDDBitVector.java 16 Oct 2004 02:58:57 -0000 1.1 --- BDDBitVector.java 18 Oct 2004 09:35:20 -0000 1.2 *************** *** 4,7 **** --- 4,9 ---- package net.sf.javabdd; + import java.math.BigInteger; + /** * <p>Bit vector implementation for BDDs.</p> *************** *** 49,52 **** --- 51,65 ---- } + protected void initialize(BigInteger val) { + BDDFactory bdd = getFactory(); + for (int n = 0; n < bitvec.length; n++) { + if (val.testBit(0)) + bitvec[n] = bdd.one(); + else + bitvec[n] = bdd.zero(); + val = val.shiftRight(1); + } + } + protected void initialize(int offset, int step) { BDDFactory bdd = getFactory(); |
From: John W. <joe...@us...> - 2004-10-18 04:38:07
|
Update of /cvsroot/javabdd/JavaBDD/buddy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26903/buddy/src Modified Files: .cvsignore Log Message: Added "*.o" Index: .cvsignore =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/buddy/src/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 29 Sep 2004 09:50:25 -0000 1.1.1.1 --- .cvsignore 18 Oct 2004 04:37:51 -0000 1.2 *************** *** 7,8 **** --- 7,9 ---- bddtest + *.o |