Hi Micheal,<br><br>Sorry for the late reply<br><br>About issue #1: the purpose was to replaced multiple calls by a single one, which I believe should in most case make any code faster... <br><br>About issue #3: the line of interest was line 497 (or 492 in the beta version).... but I realize now that I was really tired when I wrote this email, because of the typo and the lack of rationale of this #3 issue. Sorry about that!<br>
<br>Sebastien<br><br><div class="gmail_quote">On Thu, Dec 17, 2009 at 5:25 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 Sébastien,<br>
<br>
1- I do not clearly understand the purpose of the fix you suggest.<br>
The only effect that I see is to initialize all the points in the simplex instead<br>
of just the first point. Since these datas are overwritten in the other loop,<br>
this is useless to me. I do not see your point here.<br>
<br>
2- You are right. I created the bug report #5669:<br>
<a href="http://bugzilla.scilab.org/show_bug.cgi?id=5669" target="_blank">http://bugzilla.scilab.org/show_bug.cgi?id=5669</a><br>
fixed the bug and added a unit test in the v5.2 branch.<br>
(This was a minor problem, though.)<br>
<br>
3- I do not find any such line "newobj$nbve <- n + 1"<br>
What is the line number that you are interested in ?<br>
<br>
Best regards,<br>
<br>
Michaël<br>
<br>
PS<br>
Do not hesitate to create bug reports by yourself if you find<br>
other problems. Whatever the problem, we closely look at them.<div class="im"><br>
<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>
<br></div>
Sébastien Bihorel a écrit :<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
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></div><div><div></div><div class="h5">
On Thu, Dec 10, 2009 at 12:02 PM, Michaël Baudin <<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a> <mailto:<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a>>> wrote:<br>
<br>
Hi,<br>
<br>
I agree on both points : I will commit a bug fix in branch 5.2<br>
tomorrow.<br>
<br>
Best regards,<br>
<br>
Michaël<br>
<br>
Sébastien Bihorel a écrit :<br>
<br>
Hi,<br>
<br>
I was reading through the code of the fminsearch function and<br>
its wealth of related functions, and was wondering if there<br>
could be a problem with the optimsimplex.axes function. At<br>
this point, I honestly don't know what it is doing but I think<br>
there might be something wrong with the code:<br>
1- xlen1 is defined but never used. The check that is directly<br>
following its definition is probably supposed to use it but<br>
doesn't<br>
xlen1 = size(len,1)<br>
if size(x0,1)<>1 then<br>
errmsg = msprintf(gettext("%s: The len vector is expected<br>
to be a row matrix, but current shape is %d x<br>
%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<br>
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>
<br>
<br>
<br>
-- Michaël Baudin<br>
Ingénieur de développement<br></div></div>
<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a> <mailto:<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a>><div class="im"><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>
<br>
<br>
<br></div><div><div></div><div class="h5">
On Fri, Dec 11, 2009 at 6:12 AM, Michaël Baudin <<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a> <mailto:<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a>>> wrote:<br>
<br>
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<br>
3] );<br>
!--error 8<br>
Inconsistent addition.<br>
at line 39 of function optimsimplex_axes called by : at line<br>
34 of function optimsimplex_new called by : newobj =<br>
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<br>
point. Current shape of x0 is 1 x 2 while current shape of len is<br>
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.<br>
<br>
<br>
Best regards,<br>
<br>
Michaël<br>
<br>
Sébastien Bihorel a écrit :<br>
<br>
Hi,<br>
<br>
<br>
I was reading through the code of the fminsearch function and<br>
its wealth of related functions, and was wondering if there<br>
could be a problem with the optimsimplex.axes function. At<br>
this point, I honestly don't know what it is doing but I think<br>
there might be something wrong with the code:<br>
1- xlen1 is defined but never used. The check that is directly<br>
following its definition is probably supposed to use it but<br>
doesn't<br>
xlen1 = size(len,1)<br>
if size(x0,1)<>1 then<br>
errmsg = msprintf(gettext("%s: The len vector is expected<br>
to be a row matrix, but current shape is %d x<br>
%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<br>
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>
<br>
<br>
<br>
-- Michaël Baudin<br>
Ingénieur de développement<br></div></div>
<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a> <mailto:<a href="mailto:michael.baudin@scilab.org" target="_blank">michael.baudin@scilab.org</a>><div class="im"><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>
<br>
</div></blockquote>
<br>
<br>
</blockquote></div><br>