diff options
author | Leo Chan <leochanj@live.unc.edu> | 2020-10-22 01:53:21 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-22 01:56:35 -0400 |
commit | d17b33131c14864bd1eae275f49a3f148e21cf29 (patch) | |
tree | 0d8f77922e8d193cb0f6edab83018f057aad64a0 /SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m | |
parent | 601ed25a4c5b66cb75315832c15613a727db2c26 (diff) |
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.
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m')
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m new file mode 100755 index 0000000..372b4b6 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/fact/construct_w.m | |||
@@ -0,0 +1,25 @@ | |||
1 | function W = construct_w(centers,Ds,img_center,indexes,frames) | ||
2 | % | ||
3 | % function W = construct_w(centers,Ds,img_center,indexes,frames) | ||
4 | % optional: frames | ||
5 | % | ||
6 | |||
7 | |||
8 | points = length(indexes); | ||
9 | if (nargin == 4), | ||
10 | frames = 0.5*size(centers,2); | ||
11 | end | ||
12 | |||
13 | W = zeros(2*frames,points); | ||
14 | |||
15 | center_x = img_center(1); | ||
16 | center_y = img_center(2); | ||
17 | |||
18 | for j=1:frames, | ||
19 | % x is centers(:,2*j-1) | ||
20 | % y is centers(:,2*j) | ||
21 | % d is Ds(:,2*j-1) | ||
22 | W(j,:) = (centers(indexes,2*j-1) -center_x)'./Ds(indexes,2*j-1)'; | ||
23 | W(j+frames,:) = (centers(indexes,2*j) -center_y)'./Ds(indexes,2*j-1)'; | ||
24 | % W(j+2*frames,:) = ones(1,points)./Ds(indexes,2*j-1)'; | ||
25 | end \ No newline at end of file | ||