[Javabdd-checkins] SF.net SVN: javabdd: [456] trunk/JavaBDD
Brought to you by:
joewhaley
From: <joe...@us...> - 2006-07-17 05:20:01
|
Revision: 456 Author: joewhaley Date: 2006-07-16 22:19:54 -0700 (Sun, 16 Jul 2006) ViewCVS: http://svn.sourceforge.net/javabdd/?rev=456&view=rev Log Message: ----------- Upgraded to latest JavaBDD 2.0 and jwutil libraries. Modified Paths: -------------- trunk/JavaBDD/Makefile trunk/JavaBDD/net/sf/javabdd/BDD.java trunk/JavaBDD/net/sf/javabdd/BDDFactory.java trunk/JavaBDD/net/sf/javabdd/BDDVarSet.java trunk/JavaBDD/net/sf/javabdd/BuDDyFactory.java trunk/JavaBDD/net/sf/javabdd/JFactory.java trunk/JavaBDD/net/sf/javabdd/MicroFactory.java trunk/JavaBDD/net/sf/javabdd/TypedBDDFactory.java Modified: trunk/JavaBDD/Makefile =================================================================== --- trunk/JavaBDD/Makefile 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/Makefile 2006-07-17 05:19:54 UTC (rev 456) @@ -12,7 +12,7 @@ BUDDY_SRC = buddy/src CUDD_SRC = cudd-2.4.1 CAL_SRC = cal-2.1 -VER = 1.0b2 +VER = 2.0 ifeq (${OS},Windows_NT) JDK_ROOT = $(firstword $(wildcard c:/j2sdk*)) Modified: trunk/JavaBDD/net/sf/javabdd/BDD.java =================================================================== --- trunk/JavaBDD/net/sf/javabdd/BDD.java 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/net/sf/javabdd/BDD.java 2006-07-17 05:19:54 UTC (rev 456) @@ -646,95 +646,6 @@ } /** - * <p>Scans this BDD to find all occurrences of BDD variables and returns an - * array that contains the indices of the possible found BDD variables.</p> - * - * <p>Compare to bdd_scanset.</p> - * - * @return int[] containing indices of the possible found BDD variables - */ - public int[] scanSet() { - if (isOne() || isZero()) { - return null; - } - - int num = 0; - BDD n = this.id(); - do { - num++; - BDD n2 = n.high(); - n.free(); n = n2; - } while (!n.isZero() && !n.isOne()); - - int[] varset = new int[num]; - - num = 0; - n = this.id(); - do { - varset[num++] = n.var(); - BDD n2 = n.high(); - n.free(); n = n2; - } while (!n.isZero() && !n.isOne()); - - return varset; - } - - /** - * <p>Scans this BDD and copies the stored variables into a integer array of - * BDDDomain variable numbers. The numbers returned are guaranteed to be in - * ascending order.</p> - * - * <p>Compare to fdd_scanset.</p> - * - * @return int[] - */ - public int[] scanSetDomains() { - int[] fv; - int[] varset; - int fn; - int num, n, m, i; - - fv = this.scanSet(); - if (fv == null) - return null; - fn = fv.length; - - BDDFactory factory = getFactory(); - - for (n = 0, num = 0; n < factory.numberOfDomains(); n++) { - BDDDomain dom = factory.getDomain(n); - int[] ivar = dom.vars(); - boolean found = false; - for (m = 0; m < dom.varNum() && !found; m++) { - for (i = 0; i < fn && !found; i++) { - if (ivar[m] == fv[i]) { - num++; - found = true; - } - } - } - } - - varset = new int[num]; - - for (n = 0, num = 0; n < factory.numberOfDomains(); n++) { - BDDDomain dom = factory.getDomain(n); - int[] ivar = dom.vars(); - boolean found = false; - for (m = 0; m < dom.varNum() && !found; m++) { - for (i = 0; i < fn && !found; i++) { - if (ivar[m] == fv[i]) { - varset[num++] = n; - found = true; - } - } - } - } - - return varset; - } - - /** * <p>Finds one satisfying assignment of the domain <tt>d</tt> in this BDD * and returns that value.</p> * Modified: trunk/JavaBDD/net/sf/javabdd/BDDFactory.java =================================================================== --- trunk/JavaBDD/net/sf/javabdd/BDDFactory.java 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/net/sf/javabdd/BDDFactory.java 2006-07-17 05:19:54 UTC (rev 456) @@ -4,13 +4,13 @@ package net.sf.javabdd; import java.util.Arrays; +import java.util.BitSet; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.StringTokenizer; -import java.util.BitSet; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; @@ -21,7 +21,6 @@ import java.lang.reflect.Modifier; import java.math.BigInteger; import java.security.AccessControlException; -import net.sf.javabdd.JFactory.BddTree; /** * <p>Interface for the creation and manipulation of BDDs.</p> Modified: trunk/JavaBDD/net/sf/javabdd/BDDVarSet.java =================================================================== --- trunk/JavaBDD/net/sf/javabdd/BDDVarSet.java 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/net/sf/javabdd/BDDVarSet.java 2006-07-17 05:19:54 UTC (rev 456) @@ -32,6 +32,58 @@ public abstract int[] toLevelArray(); /** + * <p>Scans this BDD and copies the stored variables into an array of BDDDomains. + * The domains returned are guaranteed to be in ascending order.</p> + * + * <p>Compare to fdd_scanset.</p> + * + * @return int[] + */ + public BDDDomain[] getDomains() { + int[] fv; + BDDDomain[] varset; + int fn; + int num, n, m, i; + + fv = this.toArray(); + fn = fv.length; + + BDDFactory factory = getFactory(); + + for (n = 0, num = 0; n < factory.numberOfDomains(); n++) { + BDDDomain dom = factory.getDomain(n); + int[] ivar = dom.vars(); + boolean found = false; + for (m = 0; m < dom.varNum() && !found; m++) { + for (i = 0; i < fn && !found; i++) { + if (ivar[m] == fv[i]) { + num++; + found = true; + } + } + } + } + + varset = new BDDDomain[num]; + + for (n = 0, num = 0; n < factory.numberOfDomains(); n++) { + BDDDomain dom = factory.getDomain(n); + int[] ivar = dom.vars(); + boolean found = false; + for (m = 0; m < dom.varNum() && !found; m++) { + for (i = 0; i < fn && !found; i++) { + if (ivar[m] == fv[i]) { + varset[num++] = dom; + found = true; + } + } + } + } + + return varset; + } + + /** * <p>Returns a new BDDVarSet that is the union of the current BDDVarSet * and the given BDDVarSet. This constructs a new set; neither the current * nor the given BDDVarSet is modified.</p> Modified: trunk/JavaBDD/net/sf/javabdd/BuDDyFactory.java =================================================================== --- trunk/JavaBDD/net/sf/javabdd/BuDDyFactory.java 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/net/sf/javabdd/BuDDyFactory.java 2006-07-17 05:19:54 UTC (rev 456) @@ -11,7 +11,6 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.math.BigInteger; /** * <p>An implementation of BDDFactory that relies on the BuDDy library through a Modified: trunk/JavaBDD/net/sf/javabdd/JFactory.java =================================================================== --- trunk/JavaBDD/net/sf/javabdd/JFactory.java 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/net/sf/javabdd/JFactory.java 2006-07-17 05:19:54 UTC (rev 456) @@ -16,8 +16,6 @@ import java.io.BufferedWriter; import java.io.IOException; import java.io.PrintStream; -import java.math.BigInteger; -import net.sf.javabdd.BDDFactory.BDDOp; /** * <p>This is a 100% Java implementation of the BDD factory. It is based on Modified: trunk/JavaBDD/net/sf/javabdd/MicroFactory.java =================================================================== --- trunk/JavaBDD/net/sf/javabdd/MicroFactory.java 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/net/sf/javabdd/MicroFactory.java 2006-07-17 05:19:54 UTC (rev 456) @@ -6008,14 +6008,6 @@ } /* (non-Javadoc) - * @see net.sf.javabdd.BDDFactory#addVarBlock(net.sf.javabdd.BDD, boolean) - */ - public void addVarBlock(BDD var, boolean fixed) { - int[] set = var.scanSet(); - bdd_addvarblock(set, fixed); - } - - /* (non-Javadoc) * @see net.sf.javabdd.BDDFactory#addVarBlock(int, int, boolean) */ public void addVarBlock(int first, int last, boolean fixed) { Modified: trunk/JavaBDD/net/sf/javabdd/TypedBDDFactory.java =================================================================== --- trunk/JavaBDD/net/sf/javabdd/TypedBDDFactory.java 2006-07-17 03:45:54 UTC (rev 455) +++ trunk/JavaBDD/net/sf/javabdd/TypedBDDFactory.java 2006-07-17 05:19:54 UTC (rev 456) @@ -1044,10 +1044,10 @@ } - private class TypedBDDVarSet extends BDDVarSet { + public class TypedBDDVarSet extends BDDVarSet { - BDDVarSet bdd; - Set dom; + final BDDVarSet bdd; + final Set dom; protected TypedBDDVarSet(BDDVarSet bdd, Set dom) { this.bdd = bdd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |