diff options
author | Barry Haddow <barry.haddow@gmail.com> | 2014-07-21 14:04:43 +0400 |
---|---|---|
committer | Barry Haddow <barry.haddow@gmail.com> | 2014-07-21 14:04:43 +0400 |
commit | efee2695c31e1086af783c1b092fc842fb7bb1a4 (patch) | |
tree | e8324ea35cc92f0737c93f6b8fa8e23898e4d78a /mert/MiraFeatureVector.h | |
parent | c83c5a3ee6f3ef7480e7a782d2023af9e99c1711 (diff) |
Merge 08811deb17337356cd8dae9c59c0160590679a35 from joshua
Diffstat (limited to 'mert/MiraFeatureVector.h')
-rw-r--r-- | mert/MiraFeatureVector.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mert/MiraFeatureVector.h b/mert/MiraFeatureVector.h index cb2b1c87d..48aa496b5 100644 --- a/mert/MiraFeatureVector.h +++ b/mert/MiraFeatureVector.h @@ -26,7 +26,10 @@ typedef FeatureStatsType ValType; class MiraFeatureVector { public: + MiraFeatureVector() {} MiraFeatureVector(const FeatureDataItem& vec); + //Assumes that features in sparse with id < num_dense are dense features + MiraFeatureVector(const SparseVector& sparse, size_t num_dense); MiraFeatureVector(const MiraFeatureVector& other); MiraFeatureVector(const std::vector<ValType>& dense, const std::vector<std::size_t>& sparseFeats, @@ -42,7 +45,12 @@ public: friend std::ostream& operator<<(std::ostream& o, const MiraFeatureVector& e); + friend bool operator==(const MiraFeatureVector& a,const MiraFeatureVector& b); + private: + //Ignore any sparse features with id < ignoreLimit + void InitSparse(const SparseVector& sparse, size_t ignoreLimit = 0); + std::vector<ValType> m_dense; std::vector<std::size_t> m_sparseFeats; std::vector<ValType> m_sparseVals; |