testing on one image

This commit is contained in:
Joseph Redmon
2015-06-11 15:38:58 -07:00
parent d41fbf638e
commit 11c72b1132
8 changed files with 1046 additions and 30 deletions

View File

@ -73,11 +73,11 @@ float sec(clock_t clocks)
void top_k(float *a, int n, int k, int *index)
{
int i,j;
for(j = 0; j < k; ++j) index[j] = 0;
for(j = 0; j < k; ++j) index[j] = -1;
for(i = 0; i < n; ++i){
int curr = i;
for(j = 0; j < k; ++j){
if(a[curr] > a[index[j]]){
if((index[j] < 0) || a[curr] > a[index[j]]){
int swap = curr;
curr = index[j];
index[j] = swap;