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

scipy-svn@scip... scipy-svn@scip...
Mon Nov 24 23:07:34 CST 2008


Author: damian.eads
Date: 2008-11-24 23:07:33 -0600 (Mon, 24 Nov 2008)
New Revision: 5191

Modified:
   trunk/scipy/cluster/hierarchy.py
Log:
Minor changes to hierarchy.to_tree.

Modified: trunk/scipy/cluster/hierarchy.py
===================================================================
--- trunk/scipy/cluster/hierarchy.py	2008-11-25 04:51:40 UTC (rev 5190)
+++ trunk/scipy/cluster/hierarchy.py	2008-11-25 05:07:33 UTC (rev 5191)
@@ -827,21 +827,6 @@
     # Create a list full of None's to store the node objects
     d = [None] * (n*2-1)
 
-    # If we encounter a cluster being combined more than once, the matrix
-    # must be corrupt.
-    if len(np.unique(Z[:, 0:2].reshape((2 * (n - 1),)))) != 2 * (n - 1):
-        raise ValueError('Corrupt matrix Z. Some clusters are more than once.')
-    # If a cluster index is out of bounds, report an error.
-    if (Z[:, 0:2] >= 2 * n - 1).any():
-        raise ValueError('Corrupt matrix Z. Some cluster indices (first and second) are out of bounds.')
-    if (Z[:, 0:2] < 0).any():
-        raise ValueError('Corrupt matrix Z. Some cluster indices (first and second columns) are negative.')
-    if (Z[:, 2] < 0).any():
-        raise ValueError('Corrupt matrix Z. Some distances (third column) are negative.')
-
-    if (Z[:, 3] < 0).any():
-        raise ValueError('Some counts (fourth column) are negative.')
-
     # Create the nodes corresponding to the n original objects.
     for i in xrange(0, n):
         d[i] = ClusterNode(i)



More information about the Scipy-svn mailing list