From 22818a539c37198cd8d9f36b31d4b37a50b8f7c7 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Tue, 3 Feb 2026 17:21:04 +0100 Subject: [PATCH] semisparsemat ostream output --- sparsemat.h | 11 +++++++++-- t.cc | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) 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 <