#ifndef _WEIGHTS_H_ #define _WEIGHTS_H_ #include #include #include "sparse_vector.h" // warning: in the future this will become float typedef double weight_t; class Weights { public: Weights() {} void InitFromFile(const std::string& fname, std::vector* feature_list = NULL); void WriteToFile(const std::string& fname, bool hide_zero_value_features = true, const std::string* extra = NULL) const; void InitVector(std::vector* w) const; void InitSparseVector(SparseVector* w) const; void InitFromVector(const std::vector& w); void InitFromVector(const SparseVector& w); private: std::vector wv_; }; #endif