octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #31392] fix for case insensitivity of optimset


From: Olaf Till
Subject: [Octave-bug-tracker] [bug #31392] fix for case insensitivity of optimset options
Date: Thu, 21 Oct 2010 09:46:37 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.19) Gecko/2010091807 Iceweasel/3.0.6 (Debian-3.0.6-3)

URL:
  <http://savannah.gnu.org/bugs/?31392>

                 Summary: fix for case insensitivity of optimset options
                 Project: GNU Octave
            Submitted by: i7tiol
            Submitted on: Thu 21 Oct 2010 09:46:36 AM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Example of wrong behavior (option "Ab" should not be unrecognized after
registering):

octave:1> function ret = test_options (arg)
> ret = optimset ("Ab", 1, "aa", 2, "c", 3);
> endfunction
octave:2> __all_opts__ ("test_options");
octave:3> optimget (struct (), "aa")
ans = [](0x0)
octave:4> optimget (struct (), "Ab")
warning: unrecognized option: Ab
ans = [](0x0)
octave:5> 

Correct behavior with the attached changeset:

octave:1> function ret = test_options (arg)
> ret = optimset ("Ab", 1, "aa", 2, "c", 3);
> endfunction
octave:2> __all_opts__ ("test_options");
octave:3> optimget (struct (), "aa")
ans = [](0x0)
octave:4> optimget (struct (), "Ab")
ans = [](0x0)
octave:5> 

The reason is that __all_opts__.m, optimset.m, and optimget.m, when dealing
with the stored table of all options, use case insensitive lookup with
lookup(..., ..., "i"), which is not meaningful IMHO since lookup() requires a
sorted table, while case-insensitivity (option "i") makes the sorting criteria
undefined, so in general the stored options will not be correctly sorted for
this lookup (I'll open a thread for lookup(..., ..., "i") on the maintainers
list).

The changeset replaces the use of the "i" lookup option with maintaining an
additional stored set of all options sorted in lowercase.

(Note that, while __all_opts__.m, optimset.m, and optimget.m were tested from
current tip, the lookup() functionality used in testing was from 3.3.51; but
the decisive parts of lookup() have not changed up to current tip and the
principal objections against its "i" option remain valid for current tip.)



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 21 Oct 2010 09:46:36 AM GMT  Name:
optim_options_case_insensitivity.changeset  Size: 4kB   By: i7tiol

<http://savannah.gnu.org/bugs/download.php?file_id=21738>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31392>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]