[Rcpp-commits] r2328 - in pkg/RcppDE: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Oct 17 01:08:47 CEST 2010


Author: edd
Date: 2010-10-17 01:08:47 +0200 (Sun, 17 Oct 2010)
New Revision: 2328

Modified:
   pkg/RcppDE/ChangeLog
   pkg/RcppDE/benchmark.txt
   pkg/RcppDE/src/de4_0.cpp
Log:
some changelog entries and some editing


Modified: pkg/RcppDE/ChangeLog
===================================================================
--- pkg/RcppDE/ChangeLog	2010-10-16 22:54:33 UTC (rev 2327)
+++ pkg/RcppDE/ChangeLog	2010-10-16 23:08:47 UTC (rev 2328)
@@ -1,3 +1,10 @@
+2010-10-16  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/de4_0.cpp: converted to Armadillo use throughout
+
+	* R/DEoptim.R: changed to send and receive matrices rather than
+	  vectors that need to be recast to matrix
+
 2010-10-15  Dirk Eddelbuettel  <edd at debian.org>
 
 	* src/de4_0.cpp (permute): temp. urn vector now allocated above and passed

Modified: pkg/RcppDE/benchmark.txt
===================================================================
--- pkg/RcppDE/benchmark.txt	2010-10-16 22:54:33 UTC (rev 2327)
+++ pkg/RcppDE/benchmark.txt	2010-10-16 23:08:47 UTC (rev 2328)
@@ -254,3 +254,19 @@
 Genrose20   0.898667 0.909056           1.0116      -1.15603
 Genrose50   2.523167 2.603778           1.0319      -3.19484
 MEANS       0.564717 0.577228           1.0222      -2.21547
+
+
+# At  2010-10-16 18:07:26.014139
+# SVN  2327M 
+             DEoptim   RcppDE ratioRcppToBasic pctGainOfRcpp
+Rastrigin2  0.040556 0.041333           1.0192      -1.91781
+Rastrigin5  0.105278 0.108500           1.0306      -3.06069
+Rastrigin20 0.538611 0.549111           1.0195      -1.94946
+Wild2       0.066611 0.067722           1.0167      -1.66806
+Wild5       0.180556 0.184944           1.0243      -2.43077
+Wild20      1.035056 1.051333           1.0157      -1.57265
+Genrose2    0.070889 0.071333           1.0063      -0.62696
+Genrose5    0.185444 0.186833           1.0075      -0.74895
+Genrose20   0.900778 0.897722           0.9966       0.33921
+Genrose50   2.522278 2.598667           1.0303      -3.02857
+MEANS       0.564606 0.575750           1.0197      -1.97385

Modified: pkg/RcppDE/src/de4_0.cpp
===================================================================
--- pkg/RcppDE/src/de4_0.cpp	2010-10-16 22:54:33 UTC (rev 2327)
+++ pkg/RcppDE/src/de4_0.cpp	2010-10-16 23:08:47 UTC (rev 2328)
@@ -154,7 +154,7 @@
 	    for (j = 0; j < i_D; j++) {
 		ta_popP.at(i,j) = fa_minbound[j] + unif_rand() * (fa_maxbound[j] - fa_minbound[j]);
 	    }
-	} else { /* or user-specified initial member */
+	} else { 				// or user-specified initial member 
 	    ta_popP.row(i) = initialpop.row(i);
 	} 
 	ta_popC[i] = evaluate(l_nfeval, ta_popP.row(i), par, fcall, rho);
@@ -180,7 +180,7 @@
 		    popcnt++;
 		}
 	    }
-	} /* end store pop */
+	} // end store pop 
       
 	d_bestmemit.row(i_iter) = t_bestP;	// store the best member
 	d_bestvalit[i_iter] = t_bestC;		// store the best value 
@@ -200,8 +200,8 @@
 	    t_tmpP = ta_oldP.row(i);		// t_tmpP is the vector to mutate and eventually select
 	    t_tmpC = ta_oldC[i];
 
-	    permute(ia_urn2, urn_depth, i_NP, i, ia_urntmp.begin()); /* Pick 4 random and distinct */
-	    i_r1 = ia_urn2[1];  /* population members */
+	    permute(ia_urn2, urn_depth, i_NP, i, ia_urntmp.begin()); // Pick 4 random and distinct 
+	    i_r1 = ia_urn2[1];  // population members 
 	    i_r2 = ia_urn2[2];
 	    i_r3 = ia_urn2[3];
 	    i_r4 = ia_urn2[4];
@@ -212,7 +212,7 @@
 		j = (int)(unif_rand() * i_D); 	// random parameter 
 		k = 0;
 		do {
-		    /* add fluctuation to random target */
+		    // add fluctuation to random target 
 		    t_tmpP[j] = ta_oldP.at(i_r1,j) + f_weight * (ta_oldP.at(i_r2,j) - ta_oldP.at(i_r3,j));
 		    j = (j + 1) % i_D;
 		    k++;
@@ -223,7 +223,7 @@
 		j = (int)(unif_rand() * i_D); 	// random parameter 
 		k = 0;
 		do {
-		    /* add fluctuation to random target */
+		    // add fluctuation to random target 
 		    t_tmpP[j] = t_tmpP[j] + f_weight * (t_bestitP[j] - t_tmpP[j]) + f_weight * (ta_oldP.at(i_r2,j) - ta_oldP.at(i_r3,j));
 		    j = (j + 1) % i_D;
 		    k++;
@@ -253,7 +253,7 @@
 
 	    } else if (i_strategy == 5) {	// ---DE/rand/1/bin with per-generation-dither---------------------------------
 	  
-		j = (int)(unif_rand() * i_D); /* random parameter */
+		j = (int)(unif_rand() * i_D); 	// random parameter 
 		k = 0;
 		do {
 		    // add fluctuation to random target 



More information about the Rcpp-commits mailing list