diff --git a/include/Parts.hpp b/include/Parts.hpp index 56e2306..cfbee69 100644 --- a/include/Parts.hpp +++ b/include/Parts.hpp @@ -171,7 +171,7 @@ class ComponentPart { //! the part's bias vectorf bias(size_t mixture = 0) const { const int offset = (*biasid_)[self_][mixture]; - return vectorf(&((*biasw_)[offset]), &((*biasw_)[offset+nmixtures()])); + return vectorf((*biasw_).begin()+offset, (*biasw_).begin()+offset+nmixtures()); } //! the part's bias index int biasi(size_t mixture = 0) const { return (*biasi_)[(*biasid_)[self_][mixture]]; } diff --git a/src/FileStorageModel.cpp b/src/FileStorageModel.cpp index b8ef87e..9506e8a 100644 --- a/src/FileStorageModel.cpp +++ b/src/FileStorageModel.cpp @@ -146,7 +146,7 @@ bool FileStorageModel::deserialize(const std::string& filename) { part["biasid"] >> biasid_[c][p]; cv::FileNode defid = part["defid"]; - if(defid.isInt()) + if(!defid.isNone()) defid >> defid_[c][p]; else defid_[c][p].push_back(0);