[Scipy-svn] r2500 - trunk/Lib/sparse

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Jan 6 04:00:05 CST 2007


Author: timl
Date: 2007-01-06 03:59:58 -0600 (Sat, 06 Jan 2007)
New Revision: 2500

Modified:
   trunk/Lib/sparse/sparse.py
Log:
fix 64 bit bugs in sparse.py

Modified: trunk/Lib/sparse/sparse.py
===================================================================
--- trunk/Lib/sparse/sparse.py	2007-01-06 07:56:20 UTC (rev 2499)
+++ trunk/Lib/sparse/sparse.py	2007-01-06 09:59:58 UTC (rev 2500)
@@ -532,11 +532,11 @@
                         if copy:
                             self.data = array(s)
                             self.rowind = array(rowind)
-                            self.indptr = array(indptr)
+                            self.indptr = array(indptr, dtype=intc)
                         else:
                             self.data = asarray(s)
                             self.rowind = asarray(rowind)
-                            self.indptr = asarray(indptr)
+                            self.indptr = asarray(indptr, dtype=intc)
                     except:
                         raise ValueError, "unrecognized form for csc_matrix constructor"
                 else:
@@ -1078,11 +1078,11 @@
                         if copy:
                             self.data = array(s, dtype=self.dtype)
                             self.colind = array(colind)
-                            self.indptr = array(indptr)
+                            self.indptr = array(indptr, dtype=intc)
                         else:
                             self.data = asarray(s, dtype=self.dtype)
                             self.colind = asarray(colind)
-                            self.indptr = asarray(indptr)
+                            self.indptr = asarray(indptr, dtype=intc)
                 else:
                     # (data, ij) format
                     self.dtype = getdtype(dtype, s)
@@ -2704,7 +2704,7 @@
         diags = diags.astype('d')
     if not hasattr(offsets, '__len__' ):
         offsets = (offsets,)
-    offsets = array(offsets, copy=False)
+    offsets = array(offsets, copy=False, dtype=numpy.intc)
     assert(len(offsets) == diags.shape[0])
     indptr,rowind,data = sparsetools.spdiags(M,N,len(offsets),offsets,diags)
     return csc_matrix((data,rowind,indptr),(M,N))



More information about the Scipy-svn mailing list