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. --- SD-VBS/common/toolbox/ikkjin/getANMS.m | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 SD-VBS/common/toolbox/ikkjin/getANMS.m (limited to 'SD-VBS/common/toolbox/ikkjin/getANMS.m') diff --git a/SD-VBS/common/toolbox/ikkjin/getANMS.m b/SD-VBS/common/toolbox/ikkjin/getANMS.m new file mode 100755 index 0000000..a40d50c --- /dev/null +++ b/SD-VBS/common/toolbox/ikkjin/getANMS.m @@ -0,0 +1,30 @@ +function [interestPnts]=getANMS(x, y, v, r, dataDir) +MAX_LIMIT=100000; +C_ROBUST=1; +r_sq=r^2; +points=[x y v]; +[n temp]=size(v); +[srtdV srtdVIdx]=sort(v,'descend'); +srtdPnts=points(srtdVIdx,:); + +interestPnts=zeros(0,3); + +suppressR=ones(n,1)*MAX_LIMIT; +supId=find(suppressR>r_sq); + +iter = 0; +while length(supId)>0 + + interestPnts=[interestPnts; srtdPnts(supId(1),:)]; + srtdPnts=srtdPnts(supId(2:end),:); + suppressR=suppressR(supId(2:end),:); + + suppressR=min(suppressR,... + (C_ROBUST*interestPnts(end,3)>=srtdPnts(:,3)).*... + ((srtdPnts(:,1)-interestPnts(end,1)).^2 + (srtdPnts(:,2)-interestPnts(end,2)).^2)... + +(C_ROBUST*interestPnts(end,3)r_sq); +end -- cgit v1.2.2