changeset 9715:e64a80eab168 octave-forge

ga: comment all demos-yet-tests in demo_ga Avoid people complaining about the unit test suit after running "test demo_ga" instead of executing "test_ga".
author slackydeb
date Thu, 15 Mar 2012 02:27:43 +0000
parents 84e9e09b3e77
children 61e87dd2d3d4
files main/ga/inst/demo_ga.m
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/main/ga/inst/demo_ga.m	Thu Mar 15 02:24:25 2012 +0000
+++ b/main/ga/inst/demo_ga.m	Thu Mar 15 02:27:43 2012 +0000
@@ -32,30 +32,30 @@
 
 ## This code is a simple example of the usage of ga
                                 # TODO: convert to demo
-%!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3)
+# %!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3)
 
 
 ## This code shows that ga optimizes also functions whose minimum is not
 ## in zero
                                 # TODO: convert to demo
-%!xtest
-%! min = [-1, 2];
-%! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5)
+# %!xtest
+# %! min = [-1, 2];
+# %! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5)
 
 
 ## This code shows that the "Vectorize" option usually speeds up execution
                                 # TODO: convert to demo
-%!test
-%!
-%! tic ();
-%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200)));
-%! elapsed_time = toc ();
-%!
-%! tic ();
-%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on")));
-%! elapsed_time_with_vectorized = toc ();
-%!
-%! assert (elapsed_time > elapsed_time_with_vectorized);
+# %!test
+# %!
+# %! tic ();
+# %! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200)));
+# %! elapsed_time = toc ();
+# %!
+# %! tic ();
+# %! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on")));
+# %! elapsed_time_with_vectorized = toc ();
+# %!
+# %! assert (elapsed_time > elapsed_time_with_vectorized);
 
 ## The "UseParallel" option should speed up execution
                                 # TODO: write demo (after implementing