From d17b33131c14864bd1eae275f49a3f148e21cf29 Mon Sep 17 00:00:00 2001 From: Leo Chan Date: Thu, 22 Oct 2020 01:53:21 -0400 Subject: Squashed commit of the sb-vbs branch. Includes the SD-VBS benchmarks modified to: - Use libextra to loop as realtime jobs - Preallocate memory before starting their main computation - Accept input via stdin instead of via argc Does not include the SD-VBS matlab code. Fixes libextra execution in LITMUS^RT. --- .../toolbox/toolbox_basic/fact/construct_w2.m | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m (limited to 'SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m') diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m new file mode 100755 index 0000000..b2939b7 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w2.m @@ -0,0 +1,25 @@ +function W = construct_w2(centers,Ds,img_center,indexes,frames) +% +% function W = construct_w2(centers,Ds,img_center,indexes,frames) +% optional: frames +% + + +points = length(indexes); +if (nargin == 4), + frames = 0.5*size(centers,2); +end + +W = zeros(3*frames,points); + +center_x = img_center(1); +center_y = img_center(2); + +for j=1:frames, + % x is centers(:,2*j-1) + % y is centers(:,2*j) + % d is Ds(:,2*j-1) + W(j,:) = (centers(indexes,2*j-1) -center_x)'./Ds(indexes,2*j-1)'; + W(j+frames,:) = (centers(indexes,2*j) -center_y)'./Ds(indexes,2*j-1)'; + W(j+2*frames,:) = ones(1,points)./Ds(indexes,2*j-1)'; +end \ No newline at end of file -- cgit v1.2.2