Add function to Sparse

This commit is contained in:
kradchen
2023-05-30 17:53:21 +08:00
parent e9be863a67
commit b7e3970dce
2 changed files with 15 additions and 7 deletions

View File

@@ -27,18 +27,25 @@ namespace Aurora
&& mColIdxVector.getDataSize() == mValueVector.getDataSize();
}
Matrix& Sparse::getColVector()
Matrix& Sparse::getColVector()
{
return mColIdxVector;
}
Matrix& Sparse::getRowVector()
Matrix& Sparse::getRowVector()
{
return mRowIdxVector;
}
Matrix& Sparse::getValVector()
Matrix& Sparse::getValVector()
{
return mValueVector;
}
size_t Sparse::getM() const{
return mM;
}
size_t Sparse::getN() const{
return mN;
}
}

View File

@@ -10,10 +10,11 @@ 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();
Matrix& getColVector() ;
Matrix& getRowVector() ;
Matrix& getValVector() ;
size_t getM() const ;
size_t getN() const;
// TODO:add operators
private:
Matrix mColIdxVector;