inserted missing std:: (ticket #333). Thanks to trisk for the patch!

This commit is contained in:
Vadim Pisarevsky
2010-07-29 10:55:09 +00:00
parent 97254a7b45
commit 0faa75da11
7 changed files with 19 additions and 15 deletions

View File

@@ -413,7 +413,7 @@ static float percentile(float *data, int n, float p)
assert(n>0);
assert(p>=0 && p<=1);
std::vector<float> vec(data, data+n);
sort(vec.begin(), vec.end());
std::sort(vec.begin(), vec.end());
int ix = (int)(p*(n-1));
return vec[ix];
}
@@ -1299,7 +1299,7 @@ static float percentile( const float* data, int n, float p )
assert( p>=0 && p<=1 );
vector<float> vec( data, data+n );
sort(vec.begin(), vec.end());
std::sort(vec.begin(), vec.end());
int ix = (int)(p*(n-1));
return vec[ix];
}

View File

@@ -50,6 +50,8 @@
#include <cstdlib>
#include <cmath>
using namespace std;
#include "cvhaartraining.h"
int main( int argc, char* argv[] )

View File

@@ -49,6 +49,8 @@
#include <cstring>
#include <cstdlib>
using namespace std;
#include "cvhaartraining.h"
int main( int argc, char* argv[] )

View File

@@ -337,7 +337,7 @@ private:
// add bbf_node for alternate branch in priority queue
pq.push_back(bbf_node(alt_n, dist));
push_heap(pq.begin(), pq.end());
std::push_heap(pq.begin(), pq.end());
}
// called by bbf to walk to leaf;
@@ -374,11 +374,11 @@ private:
bbf_nn nn(p, distance(d, p));
if ((int) nn_pq.size() < k) {
nn_pq.push_back(nn);
push_heap(nn_pq.begin(), nn_pq.end());
std::push_heap(nn_pq.begin(), nn_pq.end());
} else if (nn_pq[0].dist > nn.dist) {
pop_heap(nn_pq.begin(), nn_pq.end());
std::pop_heap(nn_pq.begin(), nn_pq.end());
nn_pq.end()[-1] = nn;
push_heap(nn_pq.begin(), nn_pq.end());
std::push_heap(nn_pq.begin(), nn_pq.end());
}
assert(nn_pq.size() < 2 || nn_pq[0].dist >= nn_pq[1].dist);
}
@@ -405,7 +405,7 @@ public:
while (tmp_pq.size() && emax > 0) {
// from node nearest query point d, run to leaf
pop_heap(tmp_pq.begin(), tmp_pq.end());
std::pop_heap(tmp_pq.begin(), tmp_pq.end());
bbf_node bbf(tmp_pq.end()[-1]);
tmp_pq.erase(tmp_pq.end() - 1);