bugGNU Octave - Bugs: bug #42688, isdiag, isbanded, istril, istriu...

 
 

bug #42688: isdiag, isbanded, istril, istriu functions missing in Octave

Submitted by:  Massimiliano Fasi <mfasi>
Submitted on:  Sat 05 Jul 2014 08:26:20 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
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)

Tue 08 Jul 2014 12:32:56 PM UTC, comment #8:

Thank you. I was already working on the bandwidth function but wanted some feedback on the easiest ones before submitting. I've opened another bug (https://savannah.gnu.org/bugs/?42703) on the topic and submitted a patch.

Massimiliano Fasi <mfasi>
Mon 07 Jul 2014 06:08:28 PM UTC, comment #7:

Thanks for checking. I'll close this report now.

If you're feeling inspired, the bandwidth function is probably also easy to implement in an m-file. It seems that the function was added in 2014a along with isbanded, istril, istriu, and isdiag.

Rik <rik5>
Project Administrator
Mon 07 Jul 2014 05:55:01 PM UTC, comment #6:

I've just asked on IRC.

Massimiliano Fasi <mfasi>
Mon 07 Jul 2014 05:16:09 PM UTC, comment #5:

@Rik: Thank you. Unfortunately, I cannot run such tests as I don't have access to the latest Matlab version, where these functions were introduced.

Massimiliano Fasi <mfasi>
Mon 07 Jul 2014 04:19:11 PM UTC, comment #4:

@Massimliano: I committed your changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/49961d67e4b9). I changed '~' to '!' for logical not as that is the Octave convention. I also removed the third return argument from find() function calls since you weren't using it. I changed isnumeric() to isreal() when checking whether LOWER and UPPER are acceptable inputs to isbanded().

Do you have access to Matlab to run a few more tests? Right now we are checking whether the matrix is numeric or logical. Often Matlab will accept character matrices as well. Does this code return true?

Also, if the test is only for structure Matlab often accepts cell arrays as well. What does Matlab return for

Rik <rik5>
Project Administrator
Mon 07 Jul 2014 03:56:37 PM UTC, comment #3:

I think it is okay to leave these as m-files. The functions like isvector were promoted because they are used so frequently in input validation. I think these will be used less frequently and so a few milliseconds penalty for being an interpreted file is fine.

Rik <rik5>
Project Administrator
Mon 07 Jul 2014 01:39:03 PM UTC, comment #2:

Hi Pantxo,

thank you for your feedback. I've submitted a patch that addresses the second and third bullets of your list. I'm not sure about the first, as the other matrix structure test functions are m-files located in scripts/linear-algebra (issymmetric, ishermitian).

(file #31686)

Massimiliano Fasi <mfasi>
Mon 07 Jul 2014 10:36:53 AM UTC, comment #1:

Hi Massimiliano,

I have a few remarks:

  • some shape validations functions like isvector, isrow ... were recently translated from .m to C++ for performance (see changeset http://hg.savannah.gnu.org/hgweb/octave/rev/4f0e4f20a33f). I wonder if the new ones you propose shouldn't have the same performance constraint. Anyways, a preliminary (or definite) .m implementation is valuable
  • the new functions should eventually return true only for 2 dimensional matrices (see "ndims")
  • in order to return a boolean, a cleaner approach would be using "all" in place of "min".
Pantxo Diribarne <pantxo>
Project Member
Sat 05 Jul 2014 08:26:20 AM UTC, original submission:

MATLAB 8.3 (R2014a) introduces some new functions to test matrix structure. The patch I attach adds isdiag, isbanded, istril and istriu.

Massimiliano Fasi <mfasi>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #31686:  structure.patch added by mfasi (8KiB - text/x-diff)
file #31678:  structure.patch added by mfasi (8KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by mfasi (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Jul 2014 06:08:28 PM UTCrik5StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Mon 07 Jul 2014 04:19:11 PM UTCrik5StatusPatch Submitted=>In Progress
    Mon 07 Jul 2014 01:39:03 PM UTCmfasiAttached File-=>Added structure.patch, #31686
    Sat 05 Jul 2014 07:27:18 PM UTCrik5SummaryBunch of functions for testing matrix structure missing in Octave=>isdiag, isbanded, istril, istriu functions missing in Octave
    Sat 05 Jul 2014 12:57:56 PM UTCmtmillerStatusNone=>Patch Submitted
    Sat 05 Jul 2014 08:26:20 AM UTCmfasiAttached File-=>Added structure.patch, #31678

    Back to the top


    Powered by Savane 3.1-cleanup1