bugGNU Octave - Bugs: bug #38874, ellipj should work for arrays with...


bug #38874: ellipj should work for arrays with any number of dimensions

Submitted by:  John W. Eaton <jwe>
Submitted on:  Fri 03 May 2013 05:53:15 AM UTC  
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  John W. Eaton Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Wed 04 Sep 2013 11:44:50 PM UTC, comment #1: 

Fixed to handle N-D arrays in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/991c7c812e38).

Rik <rik5>
Project Administrator
Fri 03 May 2013 05:53:15 AM UTC, original submission:  

The new ellipj function looks like a 2 argument mapper, so is there any reason that it is restricted to 2D arrays?  It seems that it should handle arrays of arbitrary dimensions as long as the sizes agree.  I tagged this as a compatibility item because that's what it looks like Matlab does.  If not, change this report to a feature request.

If so, then the loops should probably also be rewritten something like this, which should be somewhat faster than using the () indexing operators because the () indexing operators will check reference counts each time they are called, but using fortran_vec will only require one reference count check.

Matrix u = u_arg.array_value ();
Matrix m = m_arg.array_value ();

NDArray sn (dims);
NDArray cn (dims);
NDArray dn (dims);
NDArray err (dims);

coust double *pu = u.data ();
coust double *pm = m.data ();

double *psn = sn.fortran_vec ();
double *pcn = cn.fortran_vec ();
double *pdn = dn.fortran_vec ();
double *perr = err.fortran_vec ();

for (octave_idx_type i = 0; i < nel; i++)
  sncndn (pu[i], pm[i], psn[i], pcn[i], pdn[i], perr[i]);

John W. Eaton <jwe>
Project Administrator


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

Attach Files:

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 jwe (Submitted the item)

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

    Only project members can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-04 rik5 StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5