#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: static void InitFromFile(const std::string& fname, std::vector* weights, std::vector* feature_list = NULL); static void WriteToFile(const std::string& fname, const std::vector& weights, bool hide_zero_value_features = true, const std::string* extra = NULL); static void InitSparseVector(const std::vector& dv, SparseVector* sv); // check for infinities, NaNs, etc static void SanityCheck(const std::vector& w); // write weights with largest magnitude to cerr static void ShowLargestFeatures(const std::vector& w); private: Weights(); }; #endif