changeset 9848:3c079f238951 octave-forge

ga: test error when function requires more nvars than specified Trivial error.
author slackydeb
date Sat, 24 Mar 2012 16:34:23 +0000
parents d0a89bfd8417
children bd71d3f1e0ba
files main/ga/inst/ga.m
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/ga/inst/ga.m	Sat Mar 24 16:34:10 2012 +0000
+++ b/main/ga/inst/ga.m	Sat Mar 24 16:34:23 2012 +0000
@@ -130,6 +130,9 @@
 # TODO
 
 ## type of arguments
+%!function f = ff (nvars)
+%!  f = @(x) sum (x(:, 1:nvars) .** 2, 2);
+%!error x = ga (ff (3), 2);
 # TODO
 # TODO: test that each field in the user-specified "problem" structure is checked