Revision: 482
http://javabdd.svn.sourceforge.net/javabdd/?rev=482&view=rev
Author: gismo
Date: 2011-02-18 14:54:24 +0000 (Fri, 18 Feb 2011)
Log Message:
-----------
added CUDDBDD.restrict again - if the parameter is a cube, Coudert and Madre's restrict actually does exactly what we expect from the function
Modified Paths:
--------------
trunk/JavaBDD/net/sf/javabdd/CUDDFactory.java
Modified: trunk/JavaBDD/net/sf/javabdd/CUDDFactory.java
===================================================================
--- trunk/JavaBDD/net/sf/javabdd/CUDDFactory.java 2011-02-18 14:37:09 UTC (rev 481)
+++ trunk/JavaBDD/net/sf/javabdd/CUDDFactory.java 2011-02-18 14:54:24 UTC (rev 482)
@@ -617,29 +617,25 @@
* @see net.sf.javabdd.BDD#restrict(net.sf.javabdd.BDD)
*/
public BDD restrict(BDD var) {
-// CUDDBDD c = (CUDDBDD) var;
-// long b = cofactor0(_ddnode_ptr, c._ddnode_ptr);
-// return new CUDDBDD(b);
- // TODO Implement this.
- throw new UnsupportedOperationException();
+ CUDDBDD c = (CUDDBDD) var;
+ long b = restrict0(_ddnode_ptr, c._ddnode_ptr);
+ return new CUDDBDD(b);
}
/* (non-Javadoc)
* @see net.sf.javabdd.BDD#restrictWith(net.sf.javabdd.BDD)
*/
public BDD restrictWith(BDD var) {
-// CUDDBDD c = (CUDDBDD) var;
-// long b = cofactor0(_ddnode_ptr, c._ddnode_ptr);
-// addRef(b);
-// delRef(_ddnode_ptr);
-// if (this != c) {
-// delRef(c._ddnode_ptr);
-// c._ddnode_ptr = INVALID_BDD;
-// }
-// _ddnode_ptr = b;
-// return this;
- // TODO Implement this.
- throw new UnsupportedOperationException();
+ CUDDBDD c = (CUDDBDD) var;
+ long b = restrict0(_ddnode_ptr, c._ddnode_ptr);
+ addRef(b);
+ delRef(_ddnode_ptr);
+ if (this != c) {
+ delRef(c._ddnode_ptr);
+ c._ddnode_ptr = INVALID_BDD;
+ }
+ _ddnode_ptr = b;
+ return this;
}
// private static native long cofactor0(long b, long var);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|