diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-12 13:17:31 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-12 13:17:31 +0400 |
commit | 6c845323ac0dec19bc281d3547352701d10efe8a (patch) | |
tree | cdd5b62fda6825051a24d72843307a2ac14e6f7f /mert | |
parent | 20e27aab92a8a1ef67bb9d4bdeaca8bc458f2df5 (diff) |
Fix the order of initialization when the constructor will be called.
Diffstat (limited to 'mert')
-rw-r--r-- | mert/FeatureArray.cpp | 5 | ||||
-rw-r--r-- | mert/FeatureArray.h | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/mert/FeatureArray.cpp b/mert/FeatureArray.cpp index 4267e465e..3b3dd8c38 100644 --- a/mert/FeatureArray.cpp +++ b/mert/FeatureArray.cpp @@ -18,7 +18,10 @@ const char FEATURES_BIN_BEGIN[] = "FEATURES_BIN_BEGIN_0"; const char FEATURES_BIN_END[] = "FEATURES_BIN_END_0"; } // namespace -FeatureArray::FeatureArray() : idx(""), _sparse_flag(false) {} +FeatureArray::FeatureArray() + : idx(""), number_of_features(0), _sparse_flag(false) {} + +FeatureArray::~FeatureArray() {} void FeatureArray::savetxt(std::ofstream& outFile) { diff --git a/mert/FeatureArray.h b/mert/FeatureArray.h index d3e9c56fb..eaedf893a 100644 --- a/mert/FeatureArray.h +++ b/mert/FeatureArray.h @@ -21,20 +21,20 @@ using namespace std; class FeatureArray { +private: + // idx to identify the utterance. It can differ from + // the index inside the vector. + std::string idx; + protected: featarray_t array_; size_t number_of_features; std::string features; bool _sparse_flag; -private: - // idx to identify the utterance. It can differ from - // the index inside the vector. - std::string idx; - public: FeatureArray(); - ~FeatureArray() {} + ~FeatureArray(); inline void clear() { array_.clear(); |