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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
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
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
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
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
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
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
15
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
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
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
18 ##
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
19 ## Find the minimum of a funtion of several variables.
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
20 ## By default the method used is the Nelder&Mead Simplex algorithm
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
21 ## @seealso{fmin,fmins,nmsmax}
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
22 ## @end deftypefn
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
23
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
24 function [x fval] = fminsearch(funfun, X0, options, grad, varargin)
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
25 if (nargin == 0); usage('[x fval] = fminsearch(funfun, X0, options, grad, varargin)'); end
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
26 if (nargin < 3); options=[]; end
3e922cb85d6a Initial commint into CVS.
sis-sou
parents:
diff changeset
27 if (nargin < 4); grad=[]; end
4064
854205b47727 Add varargin to final feval (For Gilles Fay)
adb014
parents: 3883
diff changeset
28 if (nargin < 5); varargin={}; end
854205b47727 Add varargin to final feval (For Gilles Fay)
adb014
parents: 3883
diff changeset
29 x = fmins(funfun, X0, options, grad, varargin{:});
854205b47727 Add varargin to final feval (For Gilles Fay)
adb014
parents: 3883
diff changeset
30 fval = feval(funfun, x, varargin{:});
854205b47727 Add varargin to final feval (For Gilles Fay)
adb014
parents: 3883
diff changeset
31 endfunction;