Add sparse matrix.
This commit is contained in:
29
src/Sparse.cpp
Normal file
29
src/Sparse.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "Sparse.h"
|
||||
#include "Matrix.h"
|
||||
namespace Aurora
|
||||
{
|
||||
Sparse::Sparse()
|
||||
{
|
||||
}
|
||||
|
||||
Sparse::~Sparse()
|
||||
{
|
||||
}
|
||||
|
||||
Sparse::Sparse(Matrix& Cols, Matrix& Rows, Matrix& Values,size_t M, size_t N)
|
||||
: mColIdxVector(Cols),
|
||||
mRowIdxVector(Rows),
|
||||
mValueVector(Values),
|
||||
mM(M),
|
||||
mN(N)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool Sparse::isValid() const
|
||||
{
|
||||
return mColIdxVector.isVector() && mRowIdxVector.isVector() && mValueVector.isVector()
|
||||
&& mColIdxVector.getDataSize() == mRowIdxVector.getDataSize()
|
||||
&& mColIdxVector.getDataSize() == mValueVector.getDataSize();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user