diff --git a/src/Sparse.cpp b/src/Sparse.cpp index 293685e..11874ec 100644 --- a/src/Sparse.cpp +++ b/src/Sparse.cpp @@ -10,9 +10,9 @@ namespace Aurora { } - Sparse::Sparse(Matrix Cols, Matrix Rows, Matrix Values,size_t M, size_t N) - : mColIdxVector(Cols), - mRowIdxVector(Rows), + Sparse::Sparse(Matrix RowIdxs, Matrix ColIdxs , Matrix Values,size_t M, size_t N) + : mColIdxVector(ColIdxs), + mRowIdxVector(RowIdxs), mValueVector(Values), mM(M), mN(N) @@ -26,4 +26,26 @@ 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; + } + size_t Sparse::getM() const{ + return mM; + } + + size_t Sparse::getN() const{ + return mN; + } } \ No newline at end of file diff --git a/src/Sparse.h b/src/Sparse.h index 67fc470..e80b83e 100644 --- a/src/Sparse.h +++ b/src/Sparse.h @@ -7,9 +7,24 @@ namespace Aurora { { public: Sparse(); - Sparse(Matrix Cols, Matrix Rows, Matrix Values,size_t M, size_t N); + Sparse(Matrix RowIdxs, Matrix ColIdxs, Matrix Values,size_t M, size_t N); ~Sparse(); bool isValid() const; + Matrix& getColVector() ; + Matrix& getRowVector() ; + Matrix& getValVector() ; + /** + * @brief Rows + * + * @return size_t + */ + size_t getM() const; + /** + * @brief Cols + * + * @return size_t + */ + size_t getN() const; // TODO:add operators private: Matrix mColIdxVector;