bugGNU Octave - Bugs: bug #41459, interp2 should ignore * method...

 
 

bug #41459: interp2 should ignore * method flag for faster interpolation

Submitter:  Felipe G. Nievinski <fgnievinski>
Submitted:  Tue 04 Feb 2014 07:52:35 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 22 Mar 2014 09:31:54 PM UTC, comment #3: 

I pushed a changeset that issues a warning if the '*' flag is used with interp2, interp3, and interpn (http://hg.savannah.gnu.org/hgweb/octave/rev/5cf9a02732b6).

Rik <rik5>
Group administrator
Sun 23 Feb 2014 06:38:32 PM UTC, comment #2: 

yes, all of them have it:

interp1(..., *METHOD)
interp2(..., *METHOD)
interp3(..., *METHOD)
interpn(..., *METHOD)

my patch reads:


153a154,157
>   if (!isempty (method) && (method(1) == "*")) # = strncmp(method, "*", 1)
>     warning ("interp2: ignoring * METHOD flag for faster interpolation");
>     method(1) = [];
>   endif


Felipe G. Nievinski <fgnievinski>
Sun 23 Feb 2014 06:20:29 PM UTC, comment #1: 

I see we do handle the "*" modifier in the interp1 function already. So you're saying this should apply to interp2 as well? What about interp3 or interpn? I don't see any mention of the "*" modifier on any of the Matlab help pages, is this an undocumented or legacy Matlab feature?

It would be good to patch all of them at once, and follow the pattern of interp1 even if we don't handle the flag for now to make it easier to compare all 4 functions. Something like this maybe? Completely untested:


## FIXME: Handle starmethod interpolation
starmethod = method(1) == "*";
if (starmethod)
  method(1) = [];
  warning (...)
endif


Mike Miller <mtmiller>
Group Member
Tue 04 Feb 2014 07:52:35 PM UTC, original submission:  

so that at least it runs code without modification.
patch attached.

Felipe G. Nievinski <fgnievinski>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30458:  interp2.m.diff added by fgnievinski (202B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by fgnievinski (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-22 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-03-21 rik5 StatusNeed Info Patch Submitted
    2014-02-23 mtmiller CategoryNone Octave Function
        StatusNone Need Info
    2014-02-04 fgnievinski Attached File- Added interp2.m.diff, #30458

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code