Errors in example help pages 23/19023/2
Adeline CARNIS [Wed, 1 Feb 2017 13:52:25 +0000 (14:52 +0100)]
Change-Id: I23d460bd4a014e13d8e14985752fe73ed31ddbd8

scilab/modules/optimization/help/en_US/neldermead/neldermead_overview.xml
scilab/modules/optimization/help/en_US/neldermead/optimset.xml
scilab/modules/simulated_annealing/help/en_US/utilities/temp_law_csa.xml
scilab/modules/simulated_annealing/help/en_US/utilities/temp_law_fsa.xml
scilab/modules/simulated_annealing/help/en_US/utilities/temp_law_huang.xml

index 4ecb121..55b5752 100644 (file)
         </para>
         <programlisting role="example"><![CDATA[
 function [f, index]=rosenbrock(x, index)
-  y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
+  f = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
 endfunction
 
 nm = neldermead_new ();
@@ -243,6 +243,7 @@ nm = neldermead_configure(nm,"-simplex0length",0.1);
 nm = neldermead_configure(nm,"-method","variable");
 nm = neldermead_configure(nm,"-verbose",1);
 nm = neldermead_configure(nm,"-function",rosenbrock);
+nm = neldermead_configure(nm,"-storehistory",%t);
 nm = neldermead_search(nm, "off");
 xopt = neldermead_get(nm,"-xopt");
 fopt = neldermead_get(nm,"-fopt");
index 429a494..7323894 100644 (file)
@@ -333,6 +333,12 @@ op = optimset ()
             with all fields set to specific settings.
         </para>
         <programlisting role="example"><![CDATA[
+function y = myoutputfun (x)
+  y = x;
+endfunction
+function y = myplotfun (x)
+  y = x;
+endfunction
 op = optimset ("Display","iter",...
                "FunValCheck","on",...
                "MaxFunEvals",100,...
index 9f8a782..ef4efc7 100644 (file)
@@ -102,7 +102,11 @@ mprintf('SA: the CSA algorithm\n');
 T0 = compute_initial_temp(x0, rastrigin, Proba_start, It_Pre, neigh_func_default);
 mprintf('Initial temperature T0 = %f\n', T0);
 
-[x_opt, f_opt, sa_mean_list, sa_var_list, temp_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log = %T, temp_law_csa, neigh_func_csa);
+saparams = init_param();
+saparams = add_param(saparams, "neigh_func", neigh_func_csa);
+saparams = add_param(saparams, "temp_law", temp_law_csa);
+
+[x_opt, f_opt, sa_mean_list, sa_var_list, temp_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log = %T, saparams);
 
 mprintf('optimal solution:\n'); disp(x_opt);
 mprintf('value of the objective function = %f\n', f_opt);
index 47984dd..5c4eb7e 100644 (file)
@@ -101,7 +101,11 @@ mprintf('SA: the FSA algorithm\n');
 T0 = compute_initial_temp(x0, rastrigin, Proba_start, It_Pre, neigh_func_default);
 mprintf('Initial temperature T0 = %f\n', T0);
 
-[x_opt, f_opt, sa_mean_list, sa_var_list, temp_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log = %T, temp_law_fsa, neigh_func_fsa);
+saparams = init_param();
+saparams = add_param(saparams, "neigh_func", neigh_func_fsa);
+saparams = add_param(saparams, "temp_law", temp_law_fsa);
+
+[x_opt, f_opt, sa_mean_list, sa_var_list, temp_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log = %T, saparams);
 
 mprintf('optimal solution:\n'); disp(x_opt);
 mprintf('value of the objective function = %f\n', f_opt);
index 3ccc89f..ac402ca 100644 (file)
@@ -105,7 +105,11 @@ mprintf('SA: the Huang temperature decrease law\n');
 T0 = compute_initial_temp(x0, rastrigin, Proba_start, It_Pre, neigh_func_default);
 mprintf('Initial temperature T0 = %f\n', T0);
 
-[x_opt, f_opt, sa_mean_list, sa_var_list, temp_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log = %T, temp_law_huang, neigh_func_default);
+saparams = init_param();
+saparams = add_param(saparams, "neigh_func", neigh_func_default);
+saparams = add_param(saparams, "temp_law", temp_law_huang);
+
+[x_opt, f_opt, sa_mean_list, sa_var_list, temp_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log = %T, saparams);
 
 mprintf('optimal solution:\n'); disp(x_opt);
 mprintf('value of the objective function = %f\n', f_opt);