mutable_tree.h
Go to the documentation of this file.
00001 #ifndef VOCABULARY_TREE_MUTABLE_TREE_H
00002 #define VOCABULARY_TREE_MUTABLE_TREE_H
00003 
00004 #include "vocabulary_tree/vocabulary_tree.h"
00005 
00006 namespace vt {
00007 
00014 template<class Feature, class Distance = vt::distance::L2<Feature>,
00015          class FeatureAllocator = typename DefaultAllocator<Feature>::type>
00016 class MutableVocabularyTree : public vt::VocabularyTree<Feature, Distance, FeatureAllocator>
00017 {
00018   typedef vt::VocabularyTree<Feature, Distance, FeatureAllocator> BaseClass;
00019   
00020 public:
00021   MutableVocabularyTree(Distance d = Distance())
00022     : BaseClass(d)
00023   {
00024   }
00025 
00026   void setSize(uint32_t levels, uint32_t splits)
00027   {
00028     this->levels_ = levels;
00029     this->k_ = splits;
00030     this->setNodeCounts();
00031   }
00032 
00033   uint32_t nodes() const
00034   {
00035     return this->word_start_ + this->num_words_;
00036   }
00037 
00038   std::vector<Feature, FeatureAllocator>& centers() { return this->centers_; }
00039   const std::vector<Feature, FeatureAllocator>& centers() const { return this->centers_; }
00040   
00041   std::vector<uint8_t>& validCenters() { return this->valid_centers_; }
00042   const std::vector<uint8_t>& validCenters() const { return this->valid_centers_; }
00043 };
00044 
00045 } //namespace vt
00046 
00047 #endif


vocabulary_tree
Author(s): Patrick Mihelich
autogenerated on Thu Jan 2 2014 12:12:26