1 ## Copyright (C) 2009-2012 VZLU Prague
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {@var{names} =} __all_opts__ (@dots{})
21 ## Undocumented internal function.
24 ## Query all options from all known optimization functions and return a
25 ## list of possible values.
27 function names = __all_opts__ (varargin)
29 persistent saved_names = {};
31 ## do not clear this function
34 ## guard against recursive calls.
35 persistent recursive = false;
42 ## query all options from all known functions. These will call optimset,
43 ## which will in turn call us, but we won't answer.
48 opts = optimset (varargin{i});
49 fn = fieldnames (opts).';
52 # throw the error as a warning.
56 names = unique (names);
57 [lnames, idx] = unique (tolower (names));
58 if (length (lnames) < length (names))
60 error ("__all_opts__: duplicate options with inconsistent case");
71 ## No test needed for internal helper function.