view extra/NaN/test/test_perf_skipnan.m @ 12687:4f3528f4795b octave-forge

reduce memory requirements for testing performance of ...skipnan
author schloegl
date Sat, 12 Sep 2015 09:03:25 +0000
parents 41f92a4ada86
children
line wrap: on
line source


%% TEST_PERF_NANTB

% 	Copyright (C) 2009,2010 by Alois Schloegl <alois.schloegl@gmail.com>
%       This function is part of the NaN-toolbox
%       http://pub.ist.ac.at/~schloegl/matlab/NaN/

%    This program is free software; you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation; either version 3 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program; if not, write to the Free Software
%    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
%    USA



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	Performance 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	SUMSKIPNAN_MEX with and w/o OpenMP 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Generate Test data
y = randn(4e5,32);

flag=0; 
N = 10; 	% repeat the tests 10 times
t1=repmat(N,2);
t2=repmat(N,2);
for k=1:N;
	tic;t=cputime();
	[s,n]=sumskipnan_mex(y,1);
	t1(k,1)=cputime()-t; t1(k,2)=toc; 

	tic;t=cputime();
	[c,n]=covm_mex(y,[],flag);
	t2(k,1)=cputime()-t; t2(k,2)=toc; 
end;
[[t1,t2];mean([t1,t2]);std([t1,t2])]
exp(-diff(log([mean(t1)',mean(t2)'])))