[scilab-Users] Report of potential problems with the nelder-mead series of functions

Michaël Baudin michael.baudin at scilab.org
Fri Dec 11 12:12:11 CET 2009


Hi,

I created a bug report :
http://bugzilla.scilab.org/show_bug.cgi?id=5604
and fixed the source code in v5.2 branch :
http://gitweb.priv.scilab.org/?p=scilab.git;a=commitdiff;h=8e6a14e2189dde039afc67aaeef3e18aeb0cf869

Before, we had :
-->function y = rosenbrock (x)
-->  y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
-->endfunction
-->newobj = optimsimplex_new ( "axes" , [1 2] , rosenbrock , [1 2 3] );
 !--error 8
Inconsistent addition.
at line      39 of function optimsimplex_axes called by : 
at line      34 of function optimsimplex_new called by : 
newobj = optimsimplex_new ( "axes" , [1 2] , rosenbrock , [1 2 3] );

Now, you get the message :
optimsimplex_axes: The len vector is not consistent with the x0 point. 
Current shape of x0 is 1 x 2 while current shape of len is 1 x 3.
which is much clearer.
By the way, I improved the error messages of other scripts.
Thank you for reporting that problem.

Best regards,

Michaël

Sébastien Bihorel a écrit :
> Hi,
>
> I was reading through the code of the fminsearch function and its 
> wealth of related functions, and was wondering if there could be a 
> problem with the optimsimplex.axes function. At this point, I honestly 
> don't know what it is doing but I think there might be something wrong 
> with the code:
> 1- xlen1 is defined but never used. The check that is directly 
> following its definition is probably supposed to use it but doesn't
>     xlen1 = size(len,1)
>     if size(x0,1)<>1 then
>       errmsg = msprintf(gettext("%s: The len vector is expected to be 
> a row matrix, but current shape is %d x 
> %d"),"optimsimplex_axes",size(len,1),size(len,2));
>       error(errmsg);
>     end
>
> 2- nothing seems to prevent this call to crash, the dimensions of xlen 
> and the matrix newobj.x(,) are not cross-checked
>   newobj.x ( 2:nv , : ) = newobj.x ( 2:nv , : ) + diag(xlen);
>
> HIH
>
> Sebastien


-- 
Michaël Baudin
Ingénieur de développement
michael.baudin at scilab.org
-------------------------
Consortium Scilab - Digiteo
Domaine de Voluceau - Rocquencourt
B.P. 105 - 78153 Le Chesnay Cedex
Tel. : 01 39 63 56 87 - Fax : 01 39 63 55 94





More information about the users mailing list