bugGNU Octave - Bugs: bug #56954, fzero.m does not implement...

 
 

bug #56954: fzero.m does not implement optimset option "Display"

Submitted by:  None
Submitted on:  Wed 25 Sep 2019 11:26:23 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  Kai Torben Ohlhus <siko1056>
Originator Name:  Huy Ngo Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  dev
Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Thu 17 Oct 2019 02:58:52 AM UTC, comment #6: 

You are right.  Sorry for having such a bad template in the fminsearch function.  If you want to work on a patch, I suggest to move any further discussion to a new bug report titled something like "fminsearch.m should follow the Octave style guide".  And to first write an "easy" patch, just concentrating on the variable names line "trace" etc. Maybe later one can change the program flow, which also looks quite inefficient and stuck to the 2003 shape by its original author N.J. Higham.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Wed 16 Oct 2019 10:39:51 AM UTC, comment #5: 

comment #4:

> Thank you for your patch McSinyx.  I made some modifications regarding more Matlab compatible output (that is for me easier to understand) and pushed it under your name to the default development branch:
>
> https://hg.savannah.gnu.org/hgweb/octave/rev/9d3c895cbe38
>
> In patches for Octave, please mind the Style-Guide https://wiki.octave.org/Octave_style_guide Do not use variables, that are functions as well (like "display" and "trace"), easily check by "which blabla".  And please use "if .. endif" not just "if .. end".  Just minor assertions.  Your patch (and hopefully many more) is pretty welcome =)


Thank you for the merge and the tips!  As of the style (and incompatibility with MatLab output), I was almost copy-pasting from fminsearch.  Should we fix the output and style of fminsearch accordingly or should we leave it as is?

Nguyễn Gia Phong <mcsinyx>
Wed 16 Oct 2019 04:43:23 AM UTC, comment #4: 

Thank you for your patch McSinyx.  I made some modifications regarding more Matlab compatible output (that is for me easier to understand) and pushed it under your name to the default development branch:

https://hg.savannah.gnu.org/hgweb/octave/rev/9d3c895cbe38

In patches for Octave, please mind the Style-Guide https://wiki.octave.org/Octave_style_guide Do not use variables, that are functions as well (like "display" and "trace"), easily check by "which blabla".  And please use "if .. endif" not just "if .. end".  Just minor assertions.  Your patch (and hopefully many more) is pretty welcome =)

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Fri 27 Sep 2019 03:10:13 PM UTC, comment #3: 

Hi,

I've just made a patch for this.  If there's any room for improvement, please let me know.

McSinyx

Nguyễn Gia Phong <mcsinyx>
Thu 26 Sep 2019 03:43:35 PM UTC, comment #2: 

comment #1:

> The display option is not implemented, judging from this snippet from the fzero.m code
>

>   ## FIXME: Display is not yet implemented
>   ## displev = optimget (options, "Display", "notify");
>   funvalchk = strcmpi (optimget (options, "FunValCheck", "off"), "on");
>   maxfev = optimget (options, "MaxFunEvals", Inf);
>   maxiter = optimget (options, "MaxIter", Inf);
>   outfcn = optimget (options, "OutputFcn");
>   tolx = optimget (options, "TolX", eps);


comment #1:

> The display option is not implemented, judging from this snippet from the fzero.m code
>

>   ## FIXME: Display is not yet implemented
>   ## displev = optimget (options, "Display", "notify");
>   funvalchk = strcmpi (optimget (options, "FunValCheck", "off"), "on");
>   maxfev = optimget (options, "MaxFunEvals", Inf);
>   maxiter = optimget (options, "MaxIter", Inf);
>   outfcn = optimget (options, "OutputFcn");
>   tolx = optimget (options, "TolX", eps);


comment #1:

> The display option is not implemented, judging from this snippet from the fzero.m code
>

>   ## FIXME: Display is not yet implemented
>   ## displev = optimget (options, "Display", "notify");
>   funvalchk = strcmpi (optimget (options, "FunValCheck", "off"), "on");
>   maxfev = optimget (options, "MaxFunEvals", Inf);
>   maxiter = optimget (options, "MaxIter", Inf);
>   outfcn = optimget (options, "OutputFcn");
>   tolx = optimget (options, "TolX", eps);

Anonymous
Thu 26 Sep 2019 08:04:57 AM UTC, comment #1: 

The display option is not implemented, judging from this snippet from the fzero.m code

  ## FIXME: Display is not yet implemented
  ## displev = optimget (options, "Display", "notify");
  funvalchk = strcmpi (optimget (options, "FunValCheck", "off"), "on");
  maxfev = optimget (options, "MaxFunEvals", Inf);
  maxiter = optimget (options, "MaxIter", Inf);
  outfcn = optimget (options, "OutputFcn");
  tolx = optimget (options, "TolX", eps);

A.R. Burgers <arb>
Wed 25 Sep 2019 11:26:23 PM UTC, original submission:  

When I use `optimset` with displaying iteration parameter as option for `fzero`, it doesn't show any iteration at all.

Attached are the .m file and the screenshot of the command window. I have tried these alternatives:

- Defining f in a separate file
- Writing on the command instead of the file
- Defining f and optimset directly within fzero
- Not assigning fzero to any variable
- Assigning fzero to all four variables

My friend who uses MATLAB write the same code and it worked - it shows the table as it should (attached file).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47581:  fzero-display.patch added by mcsinyx (4KiB - text/x-patch - patch implementing display option for fzero)
file #47575:  Screenshot_3.png added by None (2KiB - image/png)
file #47576:  bug_report.png added by None (137KiB - image/png)
file #47574:  labwork1.m added by None (95B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by mcsinyx (Updated the item)
  • -email is unavailable- added by mcsinyx (Studying the solution)
  • -email is unavailable- added by arb (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-10-16 siko1056 StatusPatch Submitted => Fixed
        Assigned toNone => siko1056
        Open/ClosedOpen => Closed
    2019-09-27 rik5 Summaryfzero.m does not implement optimset option Display" => fzero.m does not implement optimset option "Display"
    2019-09-27 rik5 Item GroupInaccurate Result => Matlab Compatibility
        StatusNone => Patch Submitted
        Release5.1.0 => dev
        Operating SystemMicrosoft Windows => Any
        Summaryoptimset option ('Display', 'iter') doesn't work => fzero.m does not implement optimset option Display"
    2019-09-27 mcsinyx Attached File- => Added fzero-display.patch, #47581
    2019-09-27 mcsinyx Carbon-Copy- => Added mcsinyx
    2019-09-25 None Attached File- => Added labwork1.m, #47574
        Attached File- => Added Screenshot_3.png, #47575
        Attached File- => Added bug_report.png, #47576

    Back to the top


    Powered by Savane 3.5