[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #8368] imremap - Change to imremap to redu
From: |
Ian Journeaux |
Subject: |
[Octave-patch-tracker] [patch #8368] imremap - Change to imremap to reduce memory footprint |
Date: |
Mon, 03 Mar 2014 15:23:30 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36 |
URL:
<http://savannah.gnu.org/patch/?8368>
Summary: imremap - Change to imremap to reduce memory
footprint
Project: GNU Octave
Submitted by: ijourneaux
Submitted on: Mon 03 Mar 2014 03:23:29 PM GMT
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
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=[];
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?8368>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-patch-tracker] [patch #8368] imremap - Change to imremap to reduce memory footprint,
Ian Journeaux <=