  CUDDVER     = 0x020400
  PYTHON_LOC  := /usr
  # Change the following to lib64 for 64-bit architectures
-@@ -39,7 +40,7 @@ PYCUDD_DEBUG =
-
- ##
- ## For internal use only
--TESTING =
-+TESTING =
-
- #######
- ##
-@@ -64,16 +65,16 @@ SWIG_FLAGS  := -c++ -python -o $(MOD)_wr
- #FLAGS       := -malign-double -DCUDDVER=$(CUDDVER)
- #
- # For AMD64:
--# -malign-double is meaningless.
-+# -malign-double is meaningless.
- FLAGS       := -DCUDDVER=$(CUDDVER) -fPIC
- #
- ifdef PYCUDD_DEBUG
- FLAGS       := $(FLAGS) -g -DPYCUDD_DEBUG
- SWIG_FLAGS  := $(SWIG_FLAGS) -DPYCUDD_DEBUG -v -Wall
- else
--FLAGS       := $(FLAGS) -O2
-+FLAGS       := $(FLAGS) -O2
- endif
--LFLAGS      := -Xlinker -rpath $(CUDD)/lib
-+LFLAGS      := -Xlinker -rpath $(CUDD)/lib
-
- #######
- ##
-@@ -86,7 +87,7 @@ BREL_INCL   := -I$(BREL_LOC) -I$(BREL_LO
- INCLUDES    := $(INCLUDES) $(BREL_INCL)
- DEP_INCL    := $(DEP_INCL) $(BREL_INCL)
- LDFLAGS     := $(LDFLAGS) -L$(BREL_LOC) -lbrel
--FLAGS       := $(FLAGS) -DBREL_R_THERE
-+FLAGS       := $(FLAGS) -DBREL_R_THERE
- LFLAGS      := $(LFLAGS) -Xlinker -rpath $(BREL_LOC)
- SWIG_FLAGS  := $(SWIG_FLAGS) -DBREL_R_THERE
- endif
-@@ -128,11 +129,11 @@ $(MOD)_wrap.cpp:$(SWG)
- clean:
- 	rm -f *.o *_wrap* *.pyc *.pyo _$(MOD).so $(MOD).py $(MOD)tmp.py docstring.h;
-
--depend:
-+depend:
- 	@sed "/^# DO NOT CHANGE THIS OR ANY SUCCEEDING LINE -- AUTOGENERATED DEPS/, $$ d" Makefile > mktemp
- 	@echo "# DO NOT CHANGE THIS OR ANY SUCCEEDING LINE -- AUTOGENERATED DEPS" >> mktemp
- 	@$(CCPLUS) $(FLAGS) $(DEP_INCL) -E -MM $(MOD).cpp >> mktemp
--# The next line tries to get the C++ dependencies for the SWIG interface files
-+# The next line tries to get the C++ dependencies for the SWIG interface files
- # First sed prints out the raw C++ code between %{...%}. Second sed removes those markers and any #error directives. Finally, generate a rule for our wrapper cpp file
- 	@sed -n "/^%{/,/%}/ p" $(SWG) | sed -e "s/^%[{}].*\|#error.*//" | $(CCPLUS) -x c++ $(FLAGS) $(DEP_INCL) -E -MM -MQ "$(MOD)_wrap.cpp" - >> mktemp
- 	@mv -f mktemp Makefile
-diff -rupN pycudd2.0.2/pycudd/pycudd.cpp pycudd2.0.2.patched/pycudd/pycudd.cpp
+diff -Naurw pycudd2.0.2/pycudd/pycudd.cpp pycudd2.0.2.working/pycudd/pycudd.cpp
 --- pycudd2.0.2/pycudd/pycudd.cpp	2012-03-30 22:47:57.000000000 +0200
-+++ pycudd2.0.2.patched/pycudd/pycudd.cpp	2015-02-27 18:10:20.363051228 +0100
-@@ -17,8 +17,8 @@ IntArray::IntArray(int size) {
-   if (size < 0)
-     sz = Cudd_ReadSize(mgr);
-   else
--    sz = size;
--  vec = new int[sz];
-+    sz = size;
-+  vec = new int[sz];
-   memset( vec, 0, sz * sizeof(int));
- }
-
-@@ -27,10 +27,10 @@ IntArray::~IntArray() {
- }
-
- void IntArray::AssignVect(int* cuddvec, int size) {
--
--  sz = size;
-+
-+  sz = size;
-   delete [] vec;
--  vec = new int[sz];
-+  vec = new int[sz];
-   memcpy( vec, cuddvec, sz * sizeof(int));
- }
-
-@@ -44,9 +44,9 @@ void IntArray::AssignComplVect(int* cudd
-   temp[size] = univ;
-   qsort( temp, size, sizeof(int), IntCompareFunc);
-   int *iptr = temp;
--  sz = univ - size;
-+  sz = univ - size;
-   delete [] vec;
--  vec = new int[sz];
-+  vec = new int[sz];
-   int *nptr = vec;
-   for (int i=0; i < univ; i++) {
-     if (i < *iptr) *nptr++ = i;
-@@ -58,8 +58,8 @@ void IntArray::AssignComplVect(int* cudd
- }
-
- StringArray::StringArray(int size) {
--  sz = size;
--  vec = new char *[sz];
-+  sz = size;
-+  vec = new char *[sz];
-   memset( vec, 0, sz * sizeof(char *));
- }
-
-@@ -76,17 +76,17 @@ DoubleArray::DoubleArray(int size) {
-   if (size < 0)
-     sz = Cudd_ReadSize(mgr);
-   else
--    sz = size;
--  vec = new double[sz];
--  for(int j=0; j<sz; j++)
--    vec[j] = 0;
-+    sz = size;
-+  vec = new double[sz];
-+  for(int j=0; j<sz; j++)
-+    vec[j] = 0;
- }
-
- DoubleArray::~DoubleArray() {
-   delete [] vec;
- }
-
--DdArray::DdArray(int size) {
-+DdArray::DdArray(int size) {
-
- #ifdef PYCUDD_DEBUG
-   cerr << endl << "Constructor for DdArray called" << endl;
-@@ -94,54 +94,54 @@ DdArray::DdArray(int size) {
-   if (size < 0)
-     sz = Cudd_ReadSize(mgr);
-   else
--    sz = size;
--  i = 0;
--  vec = new DdNode*[sz];
--  for(int j=0; j<sz; j++)
--    vec[j] = NULL;
-+    sz = size;
-+  i = 0;
-+  vec = new DdNode*[sz];
-+  for(int j=0; j<sz; j++)
-+    vec[j] = NULL;
- }
-
--DdArray::~DdArray() {
-+DdArray::~DdArray() {
-
- #ifdef PYCUDD_DEBUG
-   cerr << endl << "Deleting DdArray" << endl;
- #endif
-   if (mgr) {
-      for(int j=0; j<sz; j++) {
--       if(vec[j]!=NULL)
--         Cudd_RecursiveDeref(mgr,vec[j]);
-+       if(vec[j]!=NULL)
-+         Cudd_RecursiveDeref(mgr,vec[j]);
-        vec[j] = NULL;
-      }
--  }
--  delete [] vec;
-+  }
-+  delete [] vec;
- }
-
- DdNode*
- DdArray::Pop() {
-   if (i!=0) {
--    DdNode* result=vec[--i];
--    vec[i]=NULL;
--    if (result!=NULL) Cudd_RecursiveDeref(mgr,result);
-+    DdNode* result=vec[--i];
-+    vec[i]=NULL;
-+    if (result!=NULL) Cudd_RecursiveDeref(mgr,result);
-     return result;
-   }
-   return NULL;
- }
-
- void
--DdArray::Push(DdNode* val) {
--  if (i<sz) {
-+DdArray::Push(DdNode* val) {
-+  if (i<sz) {
-     if (vec[i]!=NULL) Cudd_RecursiveDeref(mgr,vec[i]);
--    vec[i++]=val;
--    Cudd_Ref(val);
--  }
-+    vec[i++]=val;
-+    Cudd_Ref(val);
-+  }
- }
-
--DdNode*
--DdArray::And() {
-+DdNode*
-+DdArray::And() {
-   DdNode *result;
-   DdNode *tmp;
-   int i;
--
-+
-   OrderVector(0, sz-1);
-   result = vec[0];
-   Cudd_Ref(result);
-@@ -156,18 +156,18 @@ DdArray::And() {
-
-   return result;
- }
--
--DdNode*
-+
-+DdNode*
- DdArray::Or() {
-   DdNode *tmp;
-   DdNode *result;
-   int i;
--
-+
-   OrderVector(0, sz-1);
-   result = vec[0];
-   Cudd_Ref(result);
-
--  for (i=1; i<sz; i++) {
-+  for (i=1; i<sz; i++) {
-     tmp = Cudd_bddOr(mgr,vec[i],result);
-     Cudd_Ref(tmp);
-     Cudd_RecursiveDeref(mgr,result);
-@@ -206,7 +206,7 @@ DdArray::AtLeastN(int n) {
-     Cudd_RecursiveDeref(mgr,temp[0]);
-     temp[0]= tmp;
-
--    for( j=1; j < max_width; j++) {
-+    for( j=1; j < max_width; j++) {
-       tmp = Cudd_bddIte( mgr, vec[i+j], temp[j], temp[j-1]);
-       Cudd_Ref(tmp);
-       Cudd_RecursiveDeref(mgr,temp[j]);
-@@ -256,7 +256,7 @@ DdArray::UpToN( int n ) {
-       Cudd_RecursiveDeref(mgr,temp[j]);
-       temp[j]= tmp;
-     }
--
-+
-   tmp = temp[0];
-   for ( i=1; i<=max_width; i++)
-     Cudd_RecursiveDeref(mgr, temp[i]);
-@@ -271,7 +271,7 @@ DdArray::SwapNodes( int i, int j) {
-   DdNode *tmp = vec[i];
-   vec[i] = vec[j];
-   vec[j] = tmp;
--}
-+}
-
- DdNode*
- DdArray::ExactlyN( int n ) {
-@@ -360,7 +360,7 @@ DdArray::Constraint(int low, int high) {
- }
-
- DdNode*
--DdArray::Compose(DdNode* term) {
-+DdArray::Compose(DdNode* term) {
-   if (sz != Cudd_ReadSize(mgr)) {
-     cerr << "Can't compose without representative bdd for each index in the vector\n" << sz << "  " << Cudd_ReadSize(mgr);
-     return term;
-@@ -374,7 +374,7 @@ void
- DdArray::Fill(int offset, int mod) {
-
-   int j=offset;
--  for (int i=0; i<sz; i++,j+=mod)
-+  for (int i=0; i<sz; i++,j+=mod)
-       __setitem__(i,Cudd_bddIthVar(mgr,j));
- }
-
-@@ -382,8 +382,8 @@ void
- DdArray::FillWithIntArray( IntArray *a) {
-   delete [] vec;
-   sz = a->__len__();
--  vec = new DdNode*[sz];
--  for(int j=0; j<sz; j++)
-+  vec = new DdNode*[sz];
-+  for(int j=0; j<sz; j++)
-     vec[j] = Cudd_bddIthVar(mgr,a->vec[j]);
- }
-
-@@ -396,7 +396,7 @@ DdArray::OrderVector( int left, int righ
-
-   if (left >= right) return;
-   tmp=vec[left]; vec[left]=vec[(left+right)/2]; vec[(left+right)/2]=tmp;
--
-+
-   last = left;
-
-   for (i=left+1; i<=right; i++)
-@@ -416,7 +416,7 @@ DdArray::SupportVector( DdNode* term ) {
-   Cudd_Ref(support);
-   sz = Cudd_DagSize(support)-1;
-   delete [] vec;
--  vec = new DdNode*[sz];
-+  vec = new DdNode*[sz];
-   memset( vec, 0, sz * sizeof(DdNode*));
-   int vectindex = 0;
-   while ((support != Cudd_Regular(Cudd_ReadOne(mgr))) && (support != Cudd_Regular(Cudd_ReadZero(mgr)))) {
-@@ -439,9 +439,9 @@ DdArray::SetVarMap( DdArray* other ) {
-
- DdNode*
- DdArray::VectorSupport() {
--  DdNode* result = Cudd_VectorSupport(mgr,vec,sz);
--  Cudd_Ref(result);
--  return result;
-+  DdNode* result = Cudd_VectorSupport(mgr,vec,sz);
-+  Cudd_Ref(result);
-+  return result;
- }
-
- int
-@@ -459,19 +459,19 @@ DdArray::PickOneMinterm( DdNode* term )
-   return result;
- }
-
--DdNode*
-+DdNode*
- DdArray::HoldTR( DdArray* other ) {
-   DdNode *tmp1,*tmp2;
-   DdNode *result;
-   int i;
--
-+
-   result = Cudd_bddXnor(mgr,vec[0],other->vec[0]);
-   Cudd_Ref(result);
-
--  for (i=1; i<sz; i++) {
-+  for (i=1; i<sz; i++) {
-     tmp1 = Cudd_bddXnor(mgr,vec[i],other->vec[i]);
-     Cudd_Ref(tmp1);
--
-+
-     tmp2 = Cudd_bddAnd(mgr,result,tmp1);
-     Cudd_Ref(tmp2);
-     Cudd_RecursiveDeref(mgr,result);
-@@ -531,13 +531,13 @@ DdArray::Load( char* filename ) {
- 				     DDDMP_VAR_MATCHIDS,
- 				     NULL,
- 				     NULL,
--				     NULL,
-+				     NULL,
- 				     DDDMP_MODE_BINARY,
- 				     filename,
- 				     NULL,
- 				     &vec);
-   sz = roots;
--  DdNode **p = new DdNode*[ sz];
-+  DdNode **p = new DdNode*[ sz];
-   memcpy( p, vec, sz * sizeof( DdArray *));
-   delete [] vec;
-   vec = p;
-@@ -550,7 +550,7 @@ DdArray::LoadText( char* filename ) {
-
-   if (sz != 0)
-     return -1;
--
-+
-   delete [] vec;
-
-   int roots = Dddmp_cuddBddArrayLoad(mgr,
-@@ -559,7 +559,7 @@ DdArray::LoadText( char* filename ) {
- 				     DDDMP_VAR_MATCHIDS,
- 				     NULL,
- 				     NULL,
--				     NULL,
-+				     NULL,
- 				     DDDMP_MODE_TEXT,
- 				     filename,
- 				     NULL,
-@@ -572,28 +572,40 @@ DdArray::LoadText( char* filename ) {
-
- }
-
--int
--DdArray::ArrayLoad( int rootmatchmode, StringArray *rootmatchnames, int varmatchmode,
--	       StringArray *varmatchnames, IntArray *varmatchauxids,
--	       IntArray *varcomposeids, int mode, char *filename, FILE *fp)
--{
--  int roots = Dddmp_cuddBddArrayLoad( mgr, (Dddmp_RootMatchType) rootmatchmode,
--				 (char **) ( rootmatchnames ? rootmatchnames->vec : NULL),
--				 (Dddmp_VarMatchType) varmatchmode,
--				 (char **) ( varmatchnames ? varmatchnames->vec : NULL),
--				 (int *) ( varmatchauxids ? varmatchauxids->vec : NULL),
--				 (int *) ( varcomposeids ? varcomposeids->vec : NULL),
--				 mode, filename, fp, &vec);
-+int
-+DdArray::ArrayLoad( int rootmatchmode, StringArray *rootmatchnames, int varmatchmode,
-+	       StringArray *varmatchnames, IntArray *varmatchauxids,
-+	       IntArray *varcomposeids, int mode, char *filename, FILE *fp)
-+{
-+  int roots = Dddmp_cuddBddArrayLoad( mgr, (Dddmp_RootMatchType) rootmatchmode,
-+				 (char **) ( rootmatchnames ? rootmatchnames->vec : NULL),
-+				 (Dddmp_VarMatchType) varmatchmode,
-+				 (char **) ( varmatchnames ? varmatchnames->vec : NULL),
-+				 (int *) ( varmatchauxids ? varmatchauxids->vec : NULL),
-+				 (int *) ( varcomposeids ? varcomposeids->vec : NULL),
-+				 mode, filename, fp, &vec);
-   return roots;
- }
--int
--DdArray::ArrayStore( char *ddname, StringArray *rootnames, StringArray *varnames, IntArray *auxids,
--		     int mode, int varinfo, char *filename, FILE *fp)
--{
--  int roots =  Dddmp_cuddBddArrayStore( mgr, ddname, sz, vec,
--				  (char **) ( rootnames ? rootnames->vec : NULL),
--				  (char **) ( varnames ? varnames->vec : NULL),
--				  (int *) ( auxids ? auxids->vec : NULL), mode,
--				  (Dddmp_VarInfoType) varinfo, filename, fp);
-+int
-+DdArray::ArrayStore( char *ddname, StringArray *rootnames, StringArray *varnames, IntArray *auxids,
-+		     int mode, int varinfo, char *filename, FILE *fp)
-+{
-+  int roots =  Dddmp_cuddBddArrayStore( mgr, ddname, sz, vec,
-+				  (char **) ( rootnames ? rootnames->vec : NULL),
-+				  (char **) ( varnames ? varnames->vec : NULL),
-+				  (int *) ( auxids ? auxids->vec : NULL), mode,
-+				  (Dddmp_VarInfoType) varinfo, filename, fp);
++++ pycudd2.0.2.working/pycudd/pycudd.cpp	2015-02-27 18:54:15.447134904 +0100
+@@ -597,3 +597,15 @@
+ 				  (Dddmp_VarInfoType) varinfo, filename, fp); 
    return roots;
  }
 +

diff -rupN pycudd2.0.2/cudd-2.4.2/Makefile_64bit pycudd2.0.2.patched/cudd-2.4.2/Makefile_64bit
--- pycudd2.0.2/cudd-2.4.2/Makefile_64bit	1970-01-01 01:00:00.000000000 +0100
+++ pycudd2.0.2.patched/cudd-2.4.2/Makefile_64bit	2015-02-26 15:21:40.906737759 +0100
@@ -0,0 +1,331 @@
+# $Id$
+#

+  }
+
+
   // This takes a long int representing the address of a DdNode and 
   // derefs it. Use with caution!!
   void KillNode(long int num) {
 #ifdef PYCUDD_DEBUG
