patchGNU Octave - Patches: patch #8368, imremap - Change to imremap to...

 
 

patch #8368: imremap - Change to imremap to reduce memory footprint

Submitted by:  Ian Journeaux <ijourneaux>
Submitted on:  Mon 03 Mar 2014 03:23:29 PM UTC  
 
Category:  None Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 16 Mar 2014 07:40:18 PM UTC, comment #1:

Thanks for the diff, Ian. It seems to have been generated in reverse though, i.e., diff old new vs diff new old. Would it be possible to regenerate it, please?

Also, since this is related to bug #41674, could you please attach the modified diff files there, so that we avoid duplicates.

Can someone please close the present one.

(Developers would prefer to receive a changeset file, instead of a plain diff file, in case you're inclined to learn how to prepare it on your own.)

Felipe G. Nievinski <fgnievinski>
Mon 03 Mar 2014 03:23:29 PM UTC, original submission:

I would propose the following change to imremap to reduce the memory footprint. I will post a similar change to imresize.

The issue is that meshgrid returns double when single should be sufficient.

The change involves replacing

[X, Y] = meshgrid(1:columns(Z), 1:rows(Z));

with
XD = linspace (1, columns(Z), columns(Z));
YD = linspace (1, rows(Z), Rows(Z));
XDs = single(XD);
YDs = single(YD);
%# absolute tolerance equality
isequalAbs = @(x,y,tol) (abs(x-y) <= tol );

if(all(isequalAbs(XD, XDs, eps(XDs))) && all(isequalAbs(YD, YDs, eps(YDs))))
XD = XDs;
YD = YDs;
endif
XDs=[];
YDs=[];
[X, Y] = meshgrid (XD, YD);
XD=[];
YD=[];

Ian Journeaux <ijourneaux>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30921:  imremapdiff.txt added by ijourneaux (613B - text/plain - Corrected Diff file)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by fgnievinski (Posted a comment)
  • -email is unavailable- added by ijourneaux (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 logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-16 ijourneaux Attached File- => Added imremapdiff.txt, #30921

    Back to the top


    Powered by Savane 3.3