Originally Posted by
elninio
Yes, thats the whole point. kFmap is only defined from 0 to 1.
Then you should write it in this way:
Code:
for (vector<vector<float> >::size_type k = 0; k < kF.size(); ++k) {
Then instead of:
Code:
for (int i = 1; i <= 4; i++){
F.at(kFmap[k][namesmap[i]])++;
}
Write:
Code:
for (map<int, string>::iterator i = namesmap.begin(); i != namesmap.end(); ++i) {
++F.at(kFmap[k][i->second]);
}
Originally Posted by
elninio
k only looped from zero to one is completely valid, because kFmap is only defined from 0 to 1. Whats the problem here?
- It is hard to tell just what the 2 means.
- If kFmap's size changed, you must change the magic number 2.
- unsigned int is not quite the correct type to use (although it probably is).