blob: 2f81d76a02764f6a0f6f1161e0f82ce287e807a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// <-- Non-regression test for bug 2435 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2435
//
// <-- Short Description -->
// The following "optim based" function mades scilab hangs
// Scilab Project - Serge Steer
// Copyright INRIA 2007
// Date : June 2007
BugNumber=2435;
function [f,g,ind]=cost(x,ind)
xref=[1;2;3];
f=0.5*norm(x-xref)^2
g=x-xref;
endfunction
x0=[1;-1;1];
T=execstr('[f,xopt]=optim(cost,,''b'',-2*ones(x0),2*ones(x0),x0);','errcatch')==54
affich_result(T,BugNumber) ;
|