[mlpack-git] [mlpack/mlpack] Lsh table access (#663)
Ryan Curtin
notifications at github.com
Wed Jun 1 09:32:22 EDT 2016
The boost serialization bit is fairly straightforward... we can use the version information with BOOST_CLASS_VERSION(). The implementation will probably look like this:
```
template<typename Archive>
void Serialize(Archive& ar, const unsigned int version)
{
...
if (version == 0)
{
// In older versions, the projection tables were stored in a std::vector.
std::vector<arma::mat> tmpProj;
ar & data::CreateNVP(tmpProj, "projections");
projections.set_size(tmpProj[0].n_rows, tmpProj[0].n_cols, tmpProj.size());
for (size_t i = 0; i < tmpProj.size(); ++i)
projections.slice(i) = tmpProj[i];
}
else
{
ar & data::CreateNVP(projections, "projections");
}
...
}
```
And then you will have to set the class version number which you would normally do with `BOOST_CLASS_VERSION(LSHSearch, 1);` but this is a template class and the macro does not work with the template class so we have to use the expansion of the macro.
I wonder why Travis is not building this PR anymore? If it compiles and the LSH tests pass on your system I am fine with that, no need for Travis.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/663#issuecomment-222992904
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160601/16e92a19/attachment-0001.html>
More information about the mlpack-git
mailing list