[Vegan-commits] r1811 - in pkg/vegan: inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 9 11:50:21 CEST 2011


Author: jarioksa
Date: 2011-09-09 11:50:21 +0200 (Fri, 09 Sep 2011)
New Revision: 1811

Modified:
   pkg/vegan/inst/ChangeLog
   pkg/vegan/src/nestedness.c
Log:
bugfix in C code of permatswap: sX was always 0

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-09-09 09:16:55 UTC (rev 1810)
+++ pkg/vegan/inst/ChangeLog	2011-09-09 09:50:21 UTC (rev 1811)
@@ -7,6 +7,11 @@
 	* New major version opened with the release of vegan_2.0-0 on
 	September 8, 2011.
 
+	* permatswap: there was a bug in internal C routine, and therefore
+	not all permissible swaps were performed. We have not yet analysed
+	the effects of this bug, and do not know its severity. It is
+	recommended to re-run all analyses.
+
 Version 2.0-0 (released September 8, 2011)
 
 	* opened the release candidate ov vegan_2.0-0 on September 3,

Modified: pkg/vegan/src/nestedness.c
===================================================================
--- pkg/vegan/src/nestedness.c	2011-09-09 09:16:55 UTC (rev 1810)
+++ pkg/vegan/src/nestedness.c	2011-09-09 09:50:21 UTC (rev 1811)
@@ -175,7 +175,7 @@
     double choose[2];
 
     /* sX: number of non-zero cells */
-    for (i = 0, sX = 0; i++; i < 4)
+    for (i = 0, sX = 0; i < 4; i++)
 	    if (sm[i] > 0)
 		    sX++;
 
@@ -316,7 +316,7 @@
     int i, sX;
 
     /* sX: number of non-zero cells */
-    for (i = 0, sX = 0; i++; i < 4)
+    for (i = 0, sX = 0; i < 4; i++)
 	if (sm[i] > 0)
 	    sX++;
 
@@ -348,7 +348,7 @@
 	 ij[1] = INDX(row[1], col[0], *nr);
 	 ij[2] = INDX(row[0], col[1], *nr);
 	 ij[3] = INDX(row[1], col[1], *nr);
-	 for (k = 0; k < 4; k ++)
+	 for (k = 0; k < 4; k++)
 	      sm[k] = m[ij[k]];
 	 ev = isDiagSimple(sm);
 	 /* Swap */



More information about the Vegan-commits mailing list