[Picante-commits] r148 - branches/gsoc/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 23 05:58:00 CEST 2008


Author: skembel
Date: 2008-07-23 05:58:00 +0200 (Wed, 23 Jul 2008)
New Revision: 148

Modified:
   branches/gsoc/src/picante.c
Log:
Trial swap working properly now

Modified: branches/gsoc/src/picante.c
===================================================================
--- branches/gsoc/src/picante.c	2008-07-23 03:36:25 UTC (rev 147)
+++ branches/gsoc/src/picante.c	2008-07-23 03:58:00 UTC (rev 148)
@@ -60,12 +60,14 @@
       while((l=intrand(column))==k);
       if((m[i][k]>0.0 && m[j][l]>0.0 && m[i][l]+m[j][k]==0.0)||(m[i][k]+m[j][l]==0.0 && m[i][l]>0.0 && m[j][k]>0.0))
 		{
+			//currently swaps abundances within columns (=species)
+			//should have a switch to swap abundances within rows, columns, or random
 		  tmp = m[i][k];
-		  m[i][k] = m[j][l];
+		  m[i][k] = m[j][k];
+		  m[j][k] = tmp;
+		  tmp = m[i][l];
+		  m[i][l] = m[j][l];
 		  m[j][l] = tmp;
-		  tmp = m[j][k];
-		  m[j][k] = m[i][l];
-		  m[i][l] = tmp;
 		}
     }
   mattovec(v,m,row,column);



More information about the Picante-commits mailing list