diff --git a/sparsemat.h b/sparsemat.h index 3542a0b..3bc5c8a 100644 --- a/sparsemat.h +++ b/sparsemat.h @@ -326,10 +326,9 @@ return *this; template class SemiSparseMat { friend class NRMat; -protected: +public: NRVec diagonal; SparseMat offdiagonal; -public: SemiSparseMat() {}; SemiSparseMat(const SPMatindex n, const SPMatindex m) : offdiagonal(n,m) {if(n==m) diagonal.resize(n);}; SPMatindex nrows() const {return offdiagonal.nrows();} @@ -361,6 +360,14 @@ public: void resize(const SPMatindex n, const SPMatindex m) {offdiagonal.resize(n,m); diagonal.resize(n==m?n:0);} }; +template +std::ostream& operator<<(std::ostream &s, const SemiSparseMat &x) + { + s << "diagonal= "< b(n); cout <