diff --git a/cpp/lib/KeyMap.cpp b/cpp/lib/KeyMap.cpp index 76a5301..a42a9f1 100644 --- a/cpp/lib/KeyMap.cpp +++ b/cpp/lib/KeyMap.cpp @@ -38,13 +38,13 @@ KeyMap::~KeyMap(void) // void KeyMap::getCommonDocs(DocPairVector& dpv, int n, docid id2) { - cout << "getCommonDocs: called on keymap with " << size() << " ids" << endl; + cout << "getCommonDocs: called on keymap with " << size() << " keys, threshold=" << n << endl; // Find largest docid docid maxDocid=0; for (KeyMap::iterator kit=begin(); kit!=end(); kit++) { // kit->second is KgramInfo object, has ids[0..idsSize] KgramInfo* ki=kit->second; - for (int j=0; j<(ki->idsSize); j++) { + for (int j=0; j<(ki->size()); j++) { if (ki->ids[j]>maxDocid) maxDocid=ki->ids[j]; } } @@ -142,7 +142,7 @@ void filterKeymap(keymap& ks, keymap& kf, keymap& kr) if (ksit!=ks.end()) { // This kgram is in both maps //cout << "ksit: " << *ksit->second << endl; - KgramInfo* kip=new KgramInfo(*ksit->second); + KgramInfo* kip=new KgramInfo(ksit->second); //cout << kip << endl; kr.insert(keymap::value_type(ksit->first,kip)); } diff --git a/cpp/lib/KeyMap.h b/cpp/lib/KeyMap.h index 608b471..90d9523 100644 --- a/cpp/lib/KeyMap.h +++ b/cpp/lib/KeyMap.h @@ -24,7 +24,6 @@ ostream& operator<<(ostream& out, keymap& keys); istream& operator>>(istream& in, keymap& keys); void eraseKeymap(keymap& keys); void filterKeymap(keymap& ks, keymap& kf, keymap& kr); -//void getCommonDocs(keymap& keys, DocPairVector& dpv, int n, docid id2=9999999); class KeyMap: public keymap { public: @@ -32,10 +31,6 @@ class KeyMap: public keymap { KeyMap(void); ~KeyMap(void); void getCommonDocs(DocPairVector& dpv, int n, docid id2=9999999); - }; -//was necessary (?) by now (2014-08) causes recursive call on RHEL6 -//inline void filterKeymap(KeyMap& ks, KeyMap& kf, KeyMap& kr) { filterKeymap(ks,kf,kr); } - #endif /* #ifndef __INC_KeyMap */