diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2011-12-12 20:27:27 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2011-12-12 20:27:27 +0400 |
commit | 575168c277d83bc4c22a51f213b0d82bbe0e0150 (patch) | |
tree | f398c16799f4290c094375352dc2833099e4dce1 | |
parent | b9c5a51f9539273e4d5e0cfa384f4337ae76c90e (diff) |
uint -> size_t
-rw-r--r-- | mert/Data.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mert/Data.cpp b/mert/Data.cpp index 94f5287a8..a3c6fc314 100644 --- a/mert/Data.cpp +++ b/mert/Data.cpp @@ -50,10 +50,10 @@ Data::~Data() { //ADDED BY TS void Data::remove_duplicates() { - uint nSentences = featdata->size(); + size_t nSentences = featdata->size(); assert(scoredata->size() == nSentences); - for (uint s=0; s < nSentences; s++) { + for (size_t s=0; s < nSentences; s++) { FeatureArray& feat_array = featdata->get(s); ScoreArray& score_array = scoredata->get(s); @@ -61,29 +61,29 @@ void Data::remove_duplicates() { assert(feat_array.size() == score_array.size()); //serves as a hash-map: - std::map<double, std::vector<uint> > lookup; + std::map<double, std::vector<size_t> > lookup; - uint end_pos = feat_array.size() - 1; + size_t end_pos = feat_array.size() - 1; - uint nRemoved = 0; - for (uint k=0; k <= end_pos; k++) { + size_t nRemoved = 0; + for (size_t k=0; k <= end_pos; k++) { const FeatureStats& cur_feats = feat_array.get(k); double sum = 0.0; - for (uint l=0; l < cur_feats.size(); l++) + for (size_t l=0; l < cur_feats.size(); l++) sum += cur_feats.get(l); if (lookup.find(sum) != lookup.end()) { //std::cerr << "hit" << std::endl; - std::vector<uint>& cur_list = lookup[sum]; + std::vector<size_t>& cur_list = lookup[sum]; - uint l=0; + size_t l=0; for (l=0; l < cur_list.size(); l++) { - uint j=cur_list[l]; + size_t j=cur_list[l]; if (cur_feats == feat_array.get(j) && score_array.get(k) == score_array.get(j)) { @@ -108,7 +108,7 @@ void Data::remove_duplicates() { else lookup[sum].push_back(k); - // for (uint j=0; j < k; j++) { + // for (size_t j=0; j < k; j++) { // if (feat_array.get(k) == feat_array.get(j) // && score_array.get(k) == score_array.get(j)) { |