bugGNU Octave - Bugs: bug #50195, norm with "inf",...

 
 

bug #50195: norm with "inf", "-inf"

Submitter:  Ernst Reissner <ernstreissner>
Submitted:  Tue 31 Jan 2017 10:40:58 AM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 04 Feb 2017 05:31:48 PM UTC, comment #6: 

I checked in a cset that uses case insensitive matching for the string value input to norm (http://hg.savannah.gnu.org/hgweb/octave/rev/eb5a162c1342).  This also adds support for "-Inf".  Fixed.  Closing report.

Rik <rik5>
Group administrator
Fri 03 Feb 2017 07:12:41 PM UTC, comment #5: 

Good point.  As long as we must accept strings to support "fro", we might as well be nice and accept "inf", "-inf".  When making the change, I think we should also move to make this case insensitive so that "Inf", "inf", "INF" would all work.

Rik <rik5>
Group administrator
Fri 03 Feb 2017 06:27:41 PM UTC, comment #4: 

oh,... well... what about 'fro'?
I think octave's solution is superior.

Ernst Reissner <ernstreissner>
Fri 03 Feb 2017 03:35:38 PM UTC, comment #3: 

It's pretty easy to add support for the character string '-inf'.  But should we go the other way and just forbid string inputs for the p-value input?  That's what Matlab does and it seems fine.

Rik <rik5>
Group administrator
Tue 31 Jan 2017 05:51:02 PM UTC, comment #2: 

Please have a look at

https://de.mathworks.com/help/matlab/ref/norm.html

where we find the following table:


p Matrix Vector
1 max(sum(abs(X))) sum(abs(X))
2 max(svd(X))         sum(abs(X).^2)^(1/2)
 Inf max(sum(abs(X'))) max(abs(X))
-Inf —                       min(abs(X))

Ernst Reissner <ernstreissner>
Tue 31 Jan 2017 11:11:22 AM UTC, comment #1: 

Before making this change, I'd like to understand why it is not possible for you to solve your problem by doing something like


if (strcmpi (opt, "-inf"))
  opt = "inf";
end
norm (x, opt);


John W. Eaton <jwe>
Group administrator
Tue 31 Jan 2017 10:40:58 AM UTC, original submission:  

I know, matlab does not support norm(x,'inf').
Instead one has to write norm(x,Inf).
Octave supports norm(x,'inf') but not norm(x,'-inf'),
although both norm(x,Inf) and norm(x,-Inf).

This is inconsistent.

Well, I ask for that extension because there is a good reason,
too difficult to explain here,
why i cannot use Inf in this context.

Ernst Reissner <ernstreissner>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by ernstreissner (Submitted the item)
  • -email is unavailable- added by ernstreissner
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-04 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
        Release4.2.0 dev
    2017-02-03 mtmiller Severity3 - Normal 2 - Minor
        StatusNone Need Info
    2017-01-31 ernstreissner Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code