2019년 5월 24일 금요일

matlab pointer doesn't help speed up

function main()
t = 0:0.03:100;
t_size = length(t);
data_y = randn(1,t_size);
p_t = libpointer('doublePtr',t);
p_data_y = libpointer('doublePtr',data_y);
tic
disp(p_data_y.Value(1));
disp(data_y(1));
toc

tic
changePtrValue(p_data_y);
disp(p_data_y.Value(1));
toc

tic
data_y1 = changeValue(data_y);
disp(data_y1(1));
toc

clear p_t
clear p_data_y
end

function changePtrValue(p_data)
p_data.Value(1) = 1;
for i = 1:numel(p_data.Value)
p_data.Value(i) = p_data.Value(i)+1;
end
end

function data_out = changeValue(data_in)
data_out = data_in;
data_out(1) = 2;
for i = 1:numel(data_out)
data_out(i) = data_out(i)+1;
end
end
---------------------------------------------------------------------------------------------------
result
using ptr: 0.113141 sec
nomar way: 0.000728 sec

matlab already has good way. they don't need the pointer for speed up.

[Visual Studio] 구글테스트 Inherited Additional Dependencies 변경

구글테스트에 Configuration을 추가하는 경우 정상적인 빌드가 되지 않는 문제 발생 상황: Test 명칭으로 Configuration을 새로 추가하였음 원인: 다음그림과 같이 Inherited values에 debug용이 아닌 release...