diff options
Diffstat (limited to 'model/ranksvm.cpp')
-rw-r--r-- | model/ranksvm.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/model/ranksvm.cpp b/model/ranksvm.cpp index 6294245..060001b 100644 --- a/model/ranksvm.cpp +++ b/model/ranksvm.cpp @@ -12,7 +12,8 @@ int RSVM::saveModel(const string fname){ std::ofstream fout(fname.c_str()); fout<<this->getName()<<endl; - fout<<this->model; + fout<<this->fsize<<endl; + Eigen::write_stream(fout, this->model); return 0; } @@ -37,8 +38,8 @@ RSVM* RSVM::loadModel(const string fname){ } int RSVM::setModel(const Eigen::VectorXd &model) { - if (model.cols()!=fsize) - LOG(FATAL) << "Feature size mismatch"; + if (model.rows()!=fsize) + LOG(FATAL) << "Feature size mismatch: "<<fsize<<" "<<model.cols(); this->model=model; return 0; }
\ No newline at end of file |