# HG changeset patch # User Jaroslav Hajek # Date 1292187510 -3600 # Node ID 30f54b3b99532cfc9503d4fdfa33d0d7c632df72 # Parent 488f07b65b1dbef04e2fd711a4f23af09c15aae2 drop support of 'i' option in lookup diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2010-12-12 Jaroslav Hajek + + * optimization/optimget.m: Use explicit toupper conversion rather than + lookup(..., "i"). + * optimization/optimset.m: Ditto. + * miscellaneous/parseparams.m: Ditto. + 2010-12-12 Kai Habel * plot/view.m: Fix bugs with respect to number if inputs and argument diff --git a/scripts/miscellaneous/parseparams.m b/scripts/miscellaneous/parseparams.m --- a/scripts/miscellaneous/parseparams.m +++ b/scripts/miscellaneous/parseparams.m @@ -88,7 +88,7 @@ if (! size_equal (pnames, values) || ! all (strs(i:2:end))) error_as_caller ("options must be given as name-value pairs"); endif - idx = lookup (names, pnames, "mi"); + idx = lookup (toupper(names), toupper(pnames), "mi); if (! all (idx)) error_as_caller ("unrecognized option: %s", pnames{find (idx == 0, 1)}); else diff --git a/scripts/optimization/optimget.m b/scripts/optimization/optimget.m --- a/scripts/optimization/optimget.m +++ b/scripts/optimization/optimget.m @@ -33,7 +33,7 @@ endif opts = __all_opts__ (); - idx = lookup (opts, parname, "im"); + idx = lookup (toupper(opts), toupper(parname), "m"); if (idx) parname = opts{idx}; diff --git a/scripts/optimization/optimset.m b/scripts/optimization/optimset.m --- a/scripts/optimization/optimset.m +++ b/scripts/optimization/optimset.m @@ -59,10 +59,11 @@ fnames = fieldnames (old); ## skip validation if we're in the internal query validation = ! isempty (opts); + uopts = toupper(opts); for [val, key] = new if (validation) ## Case insensitive lookup in all options. - i = lookup (opts, key, "i"); + i = lookup (uopts, toupper(key), "i"); ## Validate option. if (i > 0 && strcmpi (opts{i}, key)) ## Use correct case. diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-12-12 Jaroslav Hajek + + * DLD-FUNCTIONS/lookup.cc (Flookup): Drop support for the "i" option. + 2010-12-09 Marco Atzeri * mappers.cc: In test for gamma, expect Inf for gamma(-1), not NaN. diff --git a/src/DLD-FUNCTIONS/lookup.cc b/src/DLD-FUNCTIONS/lookup.cc --- a/src/DLD-FUNCTIONS/lookup.cc +++ b/src/DLD-FUNCTIONS/lookup.cc @@ -232,9 +232,6 @@ For numeric lookups\n\ the rightmost subinterval shall be extended to infinity (i.e., all indices\n\ at most n-1).\n\ -\n\ -@item i\n\ -For string lookups, use case-insensitive comparison.\n\ @end table\n\ @end deftypefn") { @@ -259,14 +256,12 @@ bool right_inf = false; bool match_idx = false; bool match_bool = false; - bool icase = false; if (nargin == 3) { std::string opt = args(2).string_value (); left_inf = contains_char (opt, 'l'); right_inf = contains_char (opt, 'r'); - icase = contains_char (opt, 'i'); match_idx = contains_char (opt, 'm'); match_bool = contains_char (opt, 'b'); } @@ -277,8 +272,6 @@ error ("lookup: only one of m, b can be specified"); else if (str_case && (left_inf || right_inf)) error ("lookup: l,r not recognized for string lookups"); - else if (num_case && icase) - error ("lookup: i not recognized for numeric lookups"); if (error_state) return retval; @@ -325,13 +318,6 @@ } else if (str_case) { - // FIXME: this should be handled directly. - if (icase) - { - table = table.xtoupper (); - y = y.xtoupper (); - } - Array str_table = table.cellstr_value (); Array str_y (1, 1);