Skip to content

Commit 5ffb053

Browse files
committed
Update SparseMatrix to use Serializable
1 parent e221e3d commit 5ffb053

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/nupic/math/SparseMatrix.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <nupic/ntypes/MemParser.hpp>
4343
#include <nupic/ntypes/MemStream.hpp>
4444
#include <nupic/proto/SparseMatrixProto.capnp.h>
45+
#include <nupic/types/Serializable.hpp>
4546

4647
namespace nupic {
4748

@@ -113,7 +114,7 @@ struct SparseMatrixAlgorithms;
113114
template <typename UI = nupic::UInt32, typename Real_stor = nupic::Real32,
114115
typename I = nupic::Int32, typename Real_prec = nupic::Real64,
115116
typename DTZ = nupic::DistanceToZero<Real_stor>>
116-
class SparseMatrix {
117+
class SparseMatrix : Serializable<SparseMatrixProto> {
117118
// TODO find boost config flag to enable ullong as UnsignedInteger
118119
// BOOST_CLASS_REQUIRE(UI, boost, UnsignedIntegerConcept);
119120
BOOST_CLASS_REQUIRE(I, boost, SignedIntegerConcept);
@@ -2743,6 +2744,8 @@ class SparseMatrix {
27432744
/**
27442745
* Write to a Cap'n Proto object.
27452746
*/
2747+
using Serializable::write;
2748+
27462749
inline void write(SparseMatrixProto::Builder &proto) const {
27472750
proto.setNumRows(nrows_);
27482751
proto.setNumColumns(ncols_);
@@ -2765,6 +2768,8 @@ class SparseMatrix {
27652768
/**
27662769
* Read from a Cap'n Proto object.
27672770
*/
2771+
using Serializable::read;
2772+
27682773
inline void read(SparseMatrixProto::Reader &proto) {
27692774
auto nrows = proto.getNumRows();
27702775
auto ncols = proto.getNumColumns();

0 commit comments

Comments
 (0)