diff options
| author | leochanj105 <leochanj@live.unc.edu> | 2021-10-26 13:22:32 -0400 |
|---|---|---|
| committer | leochanj105 <leochanj@live.unc.edu> | 2021-10-26 13:22:32 -0400 |
| commit | 14c854543b1a3cf344a371a5b45595657f95786b (patch) | |
| tree | 70f752880522e5e44669af365754ac0f649dce81 /SD-VBS/benchmarks/localization/src/c/weightedSample.c | |
| parent | 5e2ccfae0532ddd89bcc04bf14aad451e9c79785 (diff) | |
add deadlines and costs
Diffstat (limited to 'SD-VBS/benchmarks/localization/src/c/weightedSample.c')
| -rw-r--r-- | SD-VBS/benchmarks/localization/src/c/weightedSample.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/SD-VBS/benchmarks/localization/src/c/weightedSample.c b/SD-VBS/benchmarks/localization/src/c/weightedSample.c deleted file mode 100644 index 28099e8..0000000 --- a/SD-VBS/benchmarks/localization/src/c/weightedSample.c +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include <stdio.h> | ||
| 6 | #include <stdlib.h> | ||
| 7 | #include <math.h> | ||
| 8 | #include "localization.h" | ||
| 9 | |||
| 10 | I2D* weightedSample(F2D* w) | ||
| 11 | { | ||
| 12 | I2D *bin; | ||
| 13 | F2D *seed; | ||
| 14 | int n, i, j; | ||
| 15 | |||
| 16 | n = w->height; | ||
| 17 | seed = randWrapper(n, 1); | ||
| 18 | bin = iSetArray(n, 1, 0); | ||
| 19 | |||
| 20 | for(i=0; i<n; i++) | ||
| 21 | { | ||
| 22 | for(j=0; j<n; j++) | ||
| 23 | { | ||
| 24 | if(asubsref(seed,j) > 0) | ||
| 25 | asubsref(bin,j) = asubsref(bin,j) + 1; | ||
| 26 | } | ||
| 27 | for(j=0; j<n; j++) | ||
| 28 | asubsref(seed,j) = asubsref(seed,j) - asubsref(w,i); | ||
| 29 | } | ||
| 30 | |||
| 31 | free(seed); | ||
| 32 | return bin; | ||
| 33 | } | ||
| 34 | |||
| 35 | |||
| 36 | |||
| 37 | |||
