[Rcpp-commits] r2698 - pkg/RcppDE/inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 3 22:31:20 CET 2010


Author: edd
Date: 2010-12-03 22:31:19 +0100 (Fri, 03 Dec 2010)
New Revision: 2698

Modified:
   pkg/RcppDE/inst/doc/RcppDE.tex
Log:
minor edit


Modified: pkg/RcppDE/inst/doc/RcppDE.tex
===================================================================
--- pkg/RcppDE/inst/doc/RcppDE.tex	2010-12-03 21:18:15 UTC (rev 2697)
+++ pkg/RcppDE/inst/doc/RcppDE.tex	2010-12-03 21:31:19 UTC (rev 2698)
@@ -1401,7 +1401,7 @@
 
     \begin{CodeChunk}
       \begin{CodeInput}
-	    case 5: {				// ---DE/rand/1/bin with per-generation-dither------------------------
+	    casee 5: {				// ---DE/rand/1/bin with per-generation-dither---------------
 		int j = static_cast<int>(::unif_rand() * i_D); 	// random parameter 
 		do {				// add fluctuation to random target 
 		    t_tmpP[j] = ta_oldP.at(j,ia_urn2[1]) + f_dither 
@@ -1410,8 +1410,9 @@
 		} while ((::unif_rand() < f_cross) && (++k < i_D));
 		break;
 	    }
-	    case 6: {				// ---DE/current-to-p-best/1 (JADE)-----------------------------------
-		int i_pbest = sortIndex[static_cast<int>(::unif_rand() * p_NP)]; // select from [0, 1, 2, ..., (pNP-1)] 
+	    case 6: {				// ---DE/current-to-p-best/1 (JADE)--------------------------
+                // select from [0, 1, 2, ..., (pNP-1)] 
+		int i_pbest = sortIndex[static_cast<int>(::unif_rand() * p_NP)]; 
 		int j = static_cast<int>(::unif_rand() * i_D); 	// random parameter 
 		do {				// add fluctuation to random target 
 		    t_tmpP[j] = ta_oldP.at(j,i) + f_weight * (ta_oldP.at(j,i_pbest) - ta_oldP.at(j,i)) + 
@@ -1420,11 +1421,12 @@
 		} while ((::unif_rand() < f_cross) && (++k < i_D));
 		break;
 	    }
-	    default: {				// ---variation to DE/rand/1/bin: either-or-algorithm------------------
+	    default: {				// ---variation to DE/rand/1/bin: either-or-algorithm--------
 		int j = static_cast<int>(::unif_rand() * i_D); 	// random parameter 
 		if (::unif_rand() < 0.5) { 	// differential mutation, Pmu = 0.5 
 		    do {			// add fluctuation to random target */
-			t_tmpP[j] = ta_oldP.at(j,ia_urn2[1]) + f_weight * (ta_oldP.at(j,ia_urn2[2]) - ta_oldP.at(j,ia_urn2[3]));
+			t_tmpP[j] = ta_oldP.at(j,ia_urn2[1]) + f_weight *
+                                        (ta_oldP.at(j,ia_urn2[2]) - ta_oldP.at(j,ia_urn2[3]));
 			j = (j + 1) % i_D;
 		    } while ((::unif_rand() < f_cross) && (++k < i_D));
 



More information about the Rcpp-commits mailing list