comparison scripts/optimization/fminbnd.m @ 13027:b9a89ca0fb75

prevent optimization functions from setting ans in workspace at startup * fminbnd.m, fminunc.m, fsolve.m, fzero.m, lsqnonneg.m, pqpnonneg.m, qp.m: Discard result from call to __all_opt__ in PKG_ADD command.
author John W. Eaton <jwe@octave.org>
date Mon, 29 Aug 2011 13:07:22 -0400
parents c792872f8942
children 72c96de7a403
comparison
equal deleted inserted replaced
13026:9a2a6054460f 13027:b9a89ca0fb75
47 ## @end deftypefn 47 ## @end deftypefn
48 48
49 ## This is patterned after opt/fmin.f from Netlib, which in turn is taken from 49 ## This is patterned after opt/fmin.f from Netlib, which in turn is taken from
50 ## Richard Brent: Algorithms For Minimization Without Derivatives, Prentice-Hall (1973) 50 ## Richard Brent: Algorithms For Minimization Without Derivatives, Prentice-Hall (1973)
51 51
52 ## PKG_ADD: __all_opts__ ("fminbnd"); 52 ## PKG_ADD: ## Discard result to avoid polluting workspace with ans at startup.
53 ## PKG_ADD: [~] = __all_opts__ ("fminbnd");
53 54
54 function [x, fval, info, output] = fminbnd (fun, xmin, xmax, options = struct ()) 55 function [x, fval, info, output] = fminbnd (fun, xmin, xmax, options = struct ())
55 56
56 ## Get default options if requested. 57 ## Get default options if requested.
57 if (nargin == 1 && ischar (fun) && strcmp (fun, 'defaults')) 58 if (nargin == 1 && ischar (fun) && strcmp (fun, 'defaults'))