bugGNU Octave - Bugs: bug #34778, norm fails when OPT argument is...

 
 

bug #34778: norm fails when OPT argument is given

Submitted by:  Juan Pablo Carbajal <juanpi>
Submitted on:  Tue 08 Nov 2011 05:37:49 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.4.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 01 Aug 2013 03:39:57 AM UTC, comment #5:

The Matlab documentation doesn't have a 3-argument form with the "rows" or "cols" options. AFAICT those are an Octave extension so there's no problem with compatibility there. All I did was come up with rules that made sense to prevent things like norm(x,"cols","rows").

Mike Miller <mtmiller>
Project Administrator
Wed 31 Jul 2013 02:58:19 PM UTC, comment #4:

Great! Did you check Matlab compatibility o those forbidden str combinations?

Thanks

Juan Pablo Carbajal <juanpi>
Project Member
Wed 31 Jul 2013 01:41:21 AM UTC, comment #3:

Hi, I pushed the following fix for this bug:

http://hg.savannah.gnu.org/hgweb/octave/rev/00985134145e

I heavily modified your patch to handle different possible combinations of arguments, hopefully this meets your needs. Also implementing the "inf" case wasn't too hard.

Mike Miller <mtmiller>
Project Administrator
Wed 15 May 2013 12:15:57 PM UTC, comment #2:

Hello all,

I am pinging this issue. Still there in
> hg summ
parent: 16666:af7287d567dc tip
minor change to wording for previous change
branch: default
commit: 4639 unknown (clean)
update: (current)

Is the patch still valid?

Juan Pablo Carbajal <juanpi>
Project Member
Tue 08 Nov 2011 07:37:18 PM UTC, comment #1:

Ok,
I made a patch.
The "inf" case is not implemented when rows and cols are given, but an error is reported

I added some tests, two of them checking for the failure.

When run make test and got

src/data.cc ............................................ PASS 629/629

PASS 7063
FAIL 0

There were 2 expected failures (see fntests.log for details).

(file #24330)

Juan Pablo Carbajal <juanpi>
Project Member
Tue 08 Nov 2011 05:37:49 PM UTC, original submission:

In function ./src/xnorm.cc line 97 and 138 the function to calculate norms along rows or columns are defined.

This functions are not working if the type of norm is selected.

> norm(rand(4,3),"fro","cols")

error: invalid conversion from string to real scalar

> norm(rand(4,3),"fro","rows")

error: invalid conversion from string to real scalar

I think the problem is an incorrect handling of the 2 string arguments case:

Built-in Function: norm (A, P, OPT)

Because

> norm(rand(4,3),"rows")

and

> norm(rand(4,3),"cols")


work fine applying the l2 norm ("fro").

I tried to generate a patch but Ia m not yet successful.

Juan Pablo Carbajal <juanpi>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #24330:  changeset.patch added by juanpi (5KiB - text/x-patch - patch to norm when 3 arguments are given)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by juanpi (Submitted the item)
  •  

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 31 Jul 2013 01:41:21 AM UTCmtmillerCategoryNone=>Octave Function
      StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Tue 08 Nov 2011 09:25:20 PM UTCjordighStatusNone=>Patch Submitted
    Tue 08 Nov 2011 07:37:18 PM UTCjuanpiAttached File-=>Added changeset.patch, #24330

    Back to the top


    Powered by Savane 3.1-cleanup1