From: <sla...@us...> - 2010-02-16 02:56:39
|
Revision: 6907 http://octave.svn.sourceforge.net/octave/?rev=6907&view=rev Author: slackydeb Date: 2010-02-16 02:56:32 +0000 (Tue, 16 Feb 2010) Log Message: ----------- Test that 'Vectorized' option speeds up execution. Modified Paths: -------------- trunk/octave-forge/main/ga/inst/ga.m Modified: trunk/octave-forge/main/ga/inst/ga.m =================================================================== --- trunk/octave-forge/main/ga/inst/ga.m 2010-02-16 02:42:06 UTC (rev 6906) +++ trunk/octave-forge/main/ga/inst/ga.m 2010-02-16 02:56:32 UTC (rev 6907) @@ -170,5 +170,16 @@ %!xtest ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "UseParallel", "always"))); - #TODO: test that Vectorized speeds up execution +%!test ## Vectorized option speeds up execution +%! +%! 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); + #TODO: test that UseParallel speeds up execution \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |