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

 
 

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

Submitted by:  Ernst Reissner <ernstreissner>
Submitted on:  Tue 31 Jan 2017 10:40:58 AM UTC  
 
Category: Octave FunctionSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Feature Request
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating 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 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>
Project 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>
Project 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>
Project 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

John W. Eaton <jwe>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 04 Feb 2017 05:31:48 PM UTCrik5StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
      Release4.2.0=>dev
    Fri 03 Feb 2017 01:18:48 AM UTCmtmillerSeverity3 - Normal=>2 - Minor
      StatusNone=>Need Info
    Tue 31 Jan 2017 10:40:58 AM UTCernstreissnerCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1