[Yt-svn] yt-commit r1308 - trunk/yt/lagos/hop

sskory at wrangler.dreamhost.com sskory at wrangler.dreamhost.com
Tue May 19 10:25:09 PDT 2009


Author: sskory
Date: Tue May 19 10:25:09 2009
New Revision: 1308
URL: http://yt.spacepope.org/changeset/1308

Log:
Adding fix that prevents pairs of particles from identifying each other as densest nearest neighbors.

Modified:
   trunk/yt/lagos/hop/hop_hop.c

Modified: trunk/yt/lagos/hop/hop_hop.c
==============================================================================
--- trunk/yt/lagos/hop/hop_hop.c	(original)
+++ trunk/yt/lagos/hop/hop_hop.c	Tue May 19 10:25:09 2009
@@ -225,6 +225,15 @@
 	}
     }
     smx->kd->p[pi].iHop = -1-pList[max];
+
+    /* check to see if the particle we link to doesn't link back
+       to ourselves, pi. If it does, connect this particle (pi) to itself.
+       This can only happen if pList[max] < pi*/    
+    if (pList[max] < pi) {
+        if (smx->kd->p[pList[max]].iHop == -1-pi) {
+            smx->kd->p[pi].iHop = -1-pi;
+        }
+    }
  
     /* If a sort was done, then we can save time in the Merge step by
     recording the new Ball radius. */



More information about the yt-svn mailing list