Mercurial > forge
annotate main/optim/inst/fminsearch.m @ 9930:d30cfca46e8a octave-forge
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
author | carandraug |
---|---|
date | Fri, 30 Mar 2012 15:14:48 +0000 |
parents | 2de537641f94 |
children | ab87d5eb13f2 |
rev | line source |
---|---|
9930
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
1 ## Copyright (C) 2006 Sylvain Pelissier <sylvain.pelissier@gmail.com> |
2748 | 2 ## |
9930
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
3 ## This program is free software; you can redistribute it and/or modify it under |
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
4 ## the terms of the GNU General Public License as published by the Free Software |
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
5 ## Foundation; either version 3 of the License, or (at your option) any later |
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
6 ## version. |
2748 | 7 ## |
9930
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
8 ## This program is distributed in the hope that it will be useful, but WITHOUT |
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
11 ## details. |
2748 | 12 ## |
9930
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
13 ## You should have received a copy of the GNU General Public License along with |
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
14 ## this program; if not, see <http://www.gnu.org/licenses/>. |
2748 | 15 |
16 ## -*- texinfo -*- | |
9930
d30cfca46e8a
optim: upgrade license to GPLv3+ and mention on DESCRIPTION the other package licenses
carandraug
parents:
4404
diff
changeset
|
17 ## @deftypefn {Function File} {[@var{x}] =} fminsearch(@var{f},@var{X0},@var{options},@var{grad},@var{P1},@var{P2}, @dots{}) |
2748 | 18 ## |
19 ## Find the minimum of a funtion of several variables. | |
20 ## By default the method used is the Nelder&Mead Simplex algorithm | |
21 ## @seealso{fmin,fmins,nmsmax} | |
22 ## @end deftypefn | |
23 | |
24 function [x fval] = fminsearch(funfun, X0, options, grad, varargin) | |
25 if (nargin == 0); usage('[x fval] = fminsearch(funfun, X0, options, grad, varargin)'); end | |
26 if (nargin < 3); options=[]; end | |
27 if (nargin < 4); grad=[]; end | |
4064 | 28 if (nargin < 5); varargin={}; end |
29 x = fmins(funfun, X0, options, grad, varargin{:}); | |
30 fval = feval(funfun, x, varargin{:}); | |
31 endfunction; |