33 FeatureVector::iterator vit = this->lower_bound(
id);
35 if(vit != this->end() && vit->first ==
id)
37 vit->second.push_back(i_feature);
41 vit = this->insert(vit, FeatureVector::value_type(
id,
42 std::vector<unsigned int>() ));
43 vit->second.push_back(i_feature);
54 FeatureVector::const_iterator vit = v.begin();
56 const std::vector<unsigned int>*
f = &vit->second;
58 out <<
"<" << vit->first <<
": [";
59 if(!f->empty()) out << (*f)[0];
60 for(
unsigned int i = 1; i < f->size(); ++i)
62 out <<
", " << (*f)[i];
66 for(++vit; vit != v.end(); ++vit)
70 out <<
", <" << vit->first <<
": [";
71 if(!f->empty()) out << (*f)[0];
72 for(
unsigned int i = 1; i < f->size(); ++i)
74 out <<
", " << (*f)[i];
friend std::ostream & operator<<(std::ostream &out, const FeatureVector &v)
Vector of nodes with indexes of local features.
void addFeature(NodeId id, unsigned int i_feature)
unsigned int NodeId
Id of nodes in the vocabulary treee.