bugGNU Octave - Bugs: bug #45138, Document difference between...

 
 

bug #45138: Document difference between Matrix::length() and interpreter length function

Submitted by:  Piotr Held <jsoh425>
Submitted on:  Tue 19 May 2015 01:30:09 AM UTC  
 
Category: DocumentationSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: None
Originator Name: Jsoh425Open/Closed: Closed
Release: 4.0.0Operating 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)

Tue 02 Jun 2015 04:51:26 PM UTC, comment #8:

Retagging release from 4.0.0-rc4 to 4.0.0.

John W. Eaton <jwe>
Project Administrator
Thu 21 May 2015 05:40:21 PM UTC, comment #7:

Sorry, I didn't notice the second patch. I have pushed after a few changes. Also, doxygen should use @ instead of / for commands, e.g., @c and @note instead of /c and /note. The idea is to be closer to texinfo. Thank you

Carnë Draug <carandraug>
Project Member
Thu 21 May 2015 02:27:51 PM UTC, comment #6:

@Mike thanks for doing all that for me, next time I will endeavor to do bettter.

@Carne I submitted two patches one that adds a note to Array.h (length.diff) and one that edits external.txi (external.diff).

Are there any other actions that could be taken to make this more apparent to the user?

Piotr Held <jsoh425>
Thu 21 May 2015 12:13:25 AM UTC, comment #5:

On his defence, savannah is specially bad in the aspect that attaching a patch does not trigger a comment on the discussion.

Anyway, about the patch, I had forgotten we have an introduction to liboctave on the appendix of the manual. Maybe we should reference doxygen there instead.

I don't think the attached patch is appropriate. The section on the manual is a very short introduction, and it doesn't reference length() which is the source of confusion. The note on this place would only cause problem. This note would be appropriate on Array.h instead, the place where people would Array::length().

Carnë Draug <carandraug>
Project Member
Wed 20 May 2015 11:17:25 PM UTC, comment #4:

So it looks like you want to repurpose this bug report for a documentation patch.

For future reference, it would be best to explicitly ask that this be reopened and the topic be updated.

Also for future reference, please add a comment to the "Discussion" section of the report when you attach a patch, otherwise it may get lost and forgotten at the bottom of the report.

I happened to notice the email, I'm taking the liberty of reopening, retitling, and updating the status for you.

Mike Miller <mtmiller>
Project Administrator
Wed 20 May 2015 04:02:10 AM UTC, comment #3:

Sure I will do that tomorrow.

Piotr Held <jsoh425>
Tue 19 May 2015 07:57:42 PM UTC, comment #2:

Might be worth to note this discrepancy in the C++ headers files. Piotr, could you supply a patch that documents this (doxygen)?

Carnë Draug <carandraug>
Project Member
Tue 19 May 2015 01:37:08 PM UTC, comment #1:

Thanks for looking into this. Yes, this is intentional. The length method for an Octave Array or Matrix class is the same as the numel method, i.e. the total number of elements in the container.

For compatibility with Matlab, the length function in the interpreter is the size of the largest dimension only.

Mike Miller <mtmiller>
Project Administrator
Tue 19 May 2015 01:30:09 AM UTC, original submission:

I am writing this because there is a discrepancy between how length() works in Octave and how it works in m-files. This might be intentional, but I still wanted to bring it up.

In the spirit of how Octave interprets length () in function wrng() that is above should return 5, but in fact it return 10 (all of the elements of 'a').

Piotr Held <jsoh425>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #34063:  external.diff added by jsoh425 (1KiB - text/x-patch - The external.diff contains modifications to doc/interpreter/external.txi to make a clear note that Array::length() is different from length() called in the interpreter. The other file (length.diff) has the fixes to the Array class headers.)
file #34064:  length.diff added by jsoh425 (2KiB - text/x-patch - The external.diff contains modifications to doc/interpreter/external.txi to make a clear note that Array::length() is different from length() called in the interpreter. The other file (length.diff) has the fixes to the Array class headers.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by jsoh425 (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 13 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Jun 2015 04:51:26 PM UTCjweRelease4.0.0-rc4=>4.0.0
    Thu 21 May 2015 05:40:21 PM UTCcarandraugStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Wed 20 May 2015 11:17:25 PM UTCmtmillerCategoryOctave Function=>Documentation
      Severity3 - Normal=>2 - Minor
      Item GroupIncorrect Result=>Other
      StatusInvalid=>Patch Submitted
      Open/ClosedClosed=>Open
      SummaryCalling length() on a matrix gives wrong result.=>Document difference between Matrix::length() and interpreter length function
    Wed 20 May 2015 04:25:14 PM UTCjsoh425Attached File-=>Added external.diff, #34063
      Attached File-=>Added length.diff, #34064
    Tue 19 May 2015 01:37:08 PM UTCmtmillerStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1