[Scipy-svn] r4411 - trunk/scipy/cluster

scipy-svn@scip... scipy-svn@scip...
Tue Jun 3 12:53:26 CDT 2008


Author: damian.eads
Date: 2008-06-03 12:53:23 -0500 (Tue, 03 Jun 2008)
New Revision: 4411

Modified:
   trunk/scipy/cluster/hierarchy.py
Log:
Changed allocation of result arrays in hierarchy so np.int is used instead of np.int32. Will assume np.int corresponds to the int data type in C on the host machine.

Modified: trunk/scipy/cluster/hierarchy.py
===================================================================
--- trunk/scipy/cluster/hierarchy.py	2008-06-03 17:50:47 UTC (rev 4410)
+++ trunk/scipy/cluster/hierarchy.py	2008-06-03 17:53:23 UTC (rev 4411)
@@ -2078,7 +2078,7 @@
     is_valid_linkage(Z, throw=True, name='Z')
 
     n = Z.shape[0] + 1
-    T = np.zeros((n,), dtype=np.int32)
+    T = np.zeros((n,), dtype=np.int)
 
     # Since the C code does not support striding using strides.
     # The dimensions are used instead.
@@ -2182,7 +2182,7 @@
     Z = np.asarray(Z)
     is_valid_linkage(Z, throw=True, name='Z')
     n = Z.shape[0] + 1
-    ML = np.zeros((n,), dtype=np.int32)
+    ML = np.zeros((n,), dtype=np.int)
     [Z] = _copy_arrays_if_base_present([Z])
     _hierarchy_wrap.prelist_wrap(Z, ML, int(n))
     return ML
@@ -3107,8 +3107,8 @@
 
     Cl = np.unique(T)
     kk = len(Cl)
-    L = np.zeros((kk,), dtype=np.int32)
-    M = np.zeros((kk,), dtype=np.int32)
+    L = np.zeros((kk,), dtype=np.int)
+    M = np.zeros((kk,), dtype=np.int)
     n = Z.shape[0] + 1
     [Z, T] = _copy_arrays_if_base_present([Z, T])
     s = _hierarchy_wrap.leaders_wrap(Z, T, L, M, int(kk), int(n))



More information about the Scipy-svn mailing list