42
42
#include < nupic/ntypes/MemParser.hpp>
43
43
#include < nupic/ntypes/MemStream.hpp>
44
44
#include < nupic/proto/SparseMatrixProto.capnp.h>
45
+ #include < nupic/types/Serializable.hpp>
45
46
46
47
namespace nupic {
47
48
@@ -113,7 +114,7 @@ struct SparseMatrixAlgorithms;
113
114
template <typename UI = nupic::UInt32 , typename Real_stor = nupic::Real32,
114
115
typename I = nupic::Int32, typename Real_prec = nupic::Real64,
115
116
typename DTZ = nupic::DistanceToZero<Real_stor>>
116
- class SparseMatrix {
117
+ class SparseMatrix : Serializable<SparseMatrixProto> {
117
118
// TODO find boost config flag to enable ullong as UnsignedInteger
118
119
// BOOST_CLASS_REQUIRE(UI, boost, UnsignedIntegerConcept);
119
120
BOOST_CLASS_REQUIRE (I, boost, SignedIntegerConcept);
@@ -2743,6 +2744,8 @@ class SparseMatrix {
2743
2744
/* *
2744
2745
* Write to a Cap'n Proto object.
2745
2746
*/
2747
+ using Serializable::write;
2748
+
2746
2749
inline void write (SparseMatrixProto::Builder &proto) const {
2747
2750
proto.setNumRows (nrows_);
2748
2751
proto.setNumColumns (ncols_);
@@ -2765,6 +2768,8 @@ class SparseMatrix {
2765
2768
/* *
2766
2769
* Read from a Cap'n Proto object.
2767
2770
*/
2771
+ using Serializable::read;
2772
+
2768
2773
inline void read (SparseMatrixProto::Reader &proto) {
2769
2774
auto nrows = proto.getNumRows ();
2770
2775
auto ncols = proto.getNumColumns ();
0 commit comments