[Javabdd-checkins] JavaBDD/net/sf/javabdd BDDDomain.java,1.8,1.9
Brought to you by:
joewhaley
From: John W. <joe...@us...> - 2005-05-21 10:15:25
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22232/net/sf/javabdd Modified Files: BDDDomain.java Log Message: Use BDDIterator.nextValue(). Index: BDDDomain.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDDDomain.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BDDDomain.java 21 May 2005 04:37:24 -0000 1.8 --- BDDDomain.java 21 May 2005 10:15:07 -0000 1.9 *************** *** 4,9 **** package net.sf.javabdd; - import java.util.Iterator; import java.math.BigInteger; /** --- 4,9 ---- package net.sf.javabdd; import java.math.BigInteger; + import net.sf.javabdd.BDD.BDDIterator; /** *************** *** 354,358 **** * of entries, as it allocates a BigInteger[] array of dimension k. * ! * @param bdd bdd that is the disjunction of domain indices * @see #getVarIndices(BDD,int) * @see #ithVar(BigInteger) --- 354,358 ---- * of entries, as it allocates a BigInteger[] array of dimension k. * ! * @param bdd bdd that is the disjunction of domain indices * @see #getVarIndices(BDD,int) * @see #ithVar(BigInteger) *************** *** 374,388 **** public BigInteger[] getVarIndices(BDD bdd, int max) { BDD myvarset = set(); // can't use var here, must respect subclass a factory may provide ! int n = (int)bdd.satCount(myvarset); if (max != -1 && n > max) n = max; BigInteger[] res = new BigInteger[n]; ! Iterator it = bdd.iterator(myvarset); for (int i = 0; i < n; i++) { ! BDD bi = (BDD) it.next(); ! res[i] = bi.scanVar(this); ! bi.free(); } - myvarset.free(); return res; } --- 374,386 ---- public BigInteger[] getVarIndices(BDD bdd, int max) { BDD myvarset = set(); // can't use var here, must respect subclass a factory may provide ! int n = (int) bdd.satCount(myvarset); if (max != -1 && n > max) n = max; BigInteger[] res = new BigInteger[n]; ! BDDIterator it = bdd.iterator(myvarset); ! myvarset.free(); for (int i = 0; i < n; i++) { ! res[i] = it.nextValue(this); } return res; } |