From e9be863a6712cfa6283e90f810370a97b9a400c8 Mon Sep 17 00:00:00 2001 From: kradchen Date: Tue, 30 May 2023 14:48:51 +0800 Subject: [PATCH] Add Sparse functions. --- src/Sparse.cpp | 15 +++++++++++++++ src/Sparse.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/src/Sparse.cpp b/src/Sparse.cpp index 293685e..eef45b6 100644 --- a/src/Sparse.cpp +++ b/src/Sparse.cpp @@ -26,4 +26,19 @@ namespace Aurora && mColIdxVector.getDataSize() == mRowIdxVector.getDataSize() && mColIdxVector.getDataSize() == mValueVector.getDataSize(); } + + Matrix& Sparse::getColVector() + { + return mColIdxVector; + } + + Matrix& Sparse::getRowVector() + { + return mRowIdxVector; + } + + Matrix& Sparse::getValVector() + { + return mValueVector; + } } \ No newline at end of file diff --git a/src/Sparse.h b/src/Sparse.h index 67fc470..25a43c0 100644 --- a/src/Sparse.h +++ b/src/Sparse.h @@ -10,6 +10,10 @@ namespace Aurora { Sparse(Matrix Cols, Matrix Rows, Matrix Values,size_t M, size_t N); ~Sparse(); bool isValid() const; + Matrix& getColVector(); + Matrix& getRowVector(); + Matrix& getValVector(); + // TODO:add operators private: Matrix mColIdxVector;