Thank Michael,<br><br>A follow-up report concerning the optimsimplex_pfeffer and optimsimplex_randbounds functions:<br>1- In optimsimplex_pfeffer function, could the following code<br><br>  //<br>  // Set 1st point<br>  //<br>

  newobj.x ( 1 , 1:n ) = x0 (1,1:n)<br>
  //<br>  // Set points #2 to #n+1<br>  //<br>  for j = 2 : newobj.n+1<br>    newobj.x ( j,1:n ) = x0 (1:n)<br>    if ( x0( j-1 ) == 0.0 ) then<br>      newobj.x ( j , j-1 ) = deltazero<br>    else<br>      newobj.x ( j , j-1 ) = newobj.x ( j , j-1 ) + deltausual * x0( j-1 )<br>


    end<br>  end<br><br>be replaced by<br><br>  //<br>  // Set 1st point<br>  //<br>  newobj.x ( 1:newobj.nbve , : ) = x0 (1:n) .*. ones(newobj.nbve ,1);<br>  //<br>  // Set points #2 to #n+1<br>  //<br>  for j = 2 :newobj.nbve <br>


    if ( x0( j-1 ) == 0.0 ) then<br>      newobj.x ( j , j-1 ) = deltazero<br>    else<br>      newobj.x ( j , j-1 ) = newobj.x ( j , j-1 ) + deltausual * x0( j-1 )<br>    end<br>  end<br><br>2-
in optimsimplex_randbounds, there is no check that boundsmin and
boundsmax have at least n elements before those calls are made<br>
    bminmat = boundsmin( 1,1:n ) .*. ones(nbve-1,1);<br>    bmaxmat = boundsmax( 1,1:n ) .*. ones(nbve-1,1);<br><br>also, should the line <br><br>newobj$nbve <- n + 1<br><br>not be <br><br>newobj$nbve <- nbve<br><br>


?<br><br>Sebastien<br><br><div class="gmail_quote">On Thu, Dec 10, 2009 at 12:02 PM, Michaël Baudin <span dir="ltr"><<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I agree on both points : I will commit a bug fix in branch 5.2 tomorrow.<br>
<br>
Best regards,<br>
<br>
Michaël<br>
<br>
Sébastien Bihorel a écrit :<div><div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
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:<br>
1- xlen1 is defined but never used. The check that is directly
following its definition is probably supposed to use it but doesn't<br>
    xlen1 = size(len,1)<br>
    if size(x0,1)<>1 then<br>
     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));<br>
      error(errmsg);<br>
    end<br>
<br>
2- nothing seems to prevent this call to crash, the dimensions of xlen and the matrix newobj.x(,) are not cross-checked<br>
  newobj.x ( 2:nv , : ) = newobj.x ( 2:nv , : ) + diag(xlen);<br>
<br>
HIH<br>
<br>
Sebastien<br>
</blockquote>
<br>
<br></div></div>
-- <br><font color="#888888">
Michaël Baudin<br>
Ingénieur de développement<br>
<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a><br>
-------------------------<br>
Consortium Scilab - Digiteo<br>
Domaine de Voluceau - Rocquencourt<br>
B.P. 105 - 78153 Le Chesnay Cedex<br>
Tel. : 01 39 63 56 87 - Fax : 01 39 63 55 94<br>
<br>
<br>
</font></blockquote></div><br>
<br><br><div class="gmail_quote">On Fri, Dec 11, 2009 at 6:12 AM, Michaël Baudin <span dir="ltr"><<a href="mailto:michael.baudin@scilab.org">michael.baudin@scilab.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

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


<br>
Before, we had :<br>
-->function y = rosenbrock (x)<br>
-->  y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;<br>
-->endfunction<br>
-->newobj = optimsimplex_new ( "axes" , [1 2] , rosenbrock , [1 2 3] );<br>
!--error 8<br>
Inconsistent addition.<br>
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] );<br>
<br>
Now, you get the message :<br>
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.<br>
which is much clearer.<br>
By the way, I improved the error messages of other scripts.<br>
Thank you for reporting that problem.<div class="im"><br>
<br>
Best regards,<br>
<br>
Michaël<br>
<br>
Sébastien Bihorel a écrit :<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<div><div></div><div class="h5"><br>
<br>
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:<br>


1- xlen1 is defined but never used. The check that is directly following its definition is probably supposed to use it but doesn't<br>
    xlen1 = size(len,1)<br>
    if size(x0,1)<>1 then<br>
      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));<br>
      error(errmsg);<br>
    end<br>
<br>
2- nothing seems to prevent this call to crash, the dimensions of xlen and the matrix newobj.x(,) are not cross-checked<br>
  newobj.x ( 2:nv , : ) = newobj.x ( 2:nv , : ) + diag(xlen);<br>
<br>
HIH<br>
<br>
Sebastien<br>
</div></div></blockquote>
<br><div><div></div><div class="h5">
<br>
-- <br>
Michaël Baudin<br>
Ingénieur de développement<br>
<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a><br>
-------------------------<br>
Consortium Scilab - Digiteo<br>
Domaine de Voluceau - Rocquencourt<br>
B.P. 105 - 78153 Le Chesnay Cedex<br>
Tel. : 01 39 63 56 87 - Fax : 01 39 63 55 94<br>
<br>
<br>
</div></div></blockquote></div><br>