Loading src/TNL/Matrices/Matrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public: template< typename Matrix_ > void setLike( const Matrix_& matrix ); IndexType getNumberOfMatrixElements() const; IndexType getAllocatedElementsCount() const; virtual IndexType getNumberOfNonzeroMatrixElements() const = 0; Loading src/TNL/Matrices/Matrix.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ template< typename Real, typename Device, typename Index, typename RealAllocator > Index Matrix< Real, Device, Index, RealAllocator >::getNumberOfMatrixElements() const Index Matrix< Real, Device, Index, RealAllocator >::getAllocatedElementsCount() const { return this->values.getSize(); } Loading src/TNL/Matrices/MatrixView.h +10 −3 Original line number Diff line number Diff line Loading @@ -57,12 +57,10 @@ public: virtual void getCompressedRowLengths( CompressedRowLengthsVectorView rowLengths ) const; IndexType getNumberOfMatrixElements() const; IndexType getAllocatedElementsCount() const; virtual IndexType getNumberOfNonzeroMatrixElements() const; void reset(); __cuda_callable__ IndexType getRows() const; Loading Loading @@ -91,6 +89,15 @@ public: ValuesView& getValues(); /** * \brief Shallow copy of the matrix view. * * @param view * @return */ __cuda_callable__ MatrixView& operator=( const MatrixView& view ); // TODO: parallelize and optimize for sparse matrices template< typename Matrix > bool operator == ( const Matrix& matrix ) const; Loading src/TNL/Matrices/MatrixView.hpp +8 −6 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ void MatrixView< Real, Device, Index >::getCompressedRowLengths( CompressedRowLe template< typename Real, typename Device, typename Index > Index MatrixView< Real, Device, Index >::getNumberOfMatrixElements() const Index MatrixView< Real, Device, Index >::getAllocatedElementsCount() const { return this->values.getSize(); } Loading Loading @@ -118,15 +118,17 @@ getValues() { return this->values; } template< typename Real, typename Device, typename Index > void MatrixView< Real, Device, Index >::reset() __cuda_callable__ MatrixView< Real, Device, Index >& MatrixView< Real, Device, Index >:: operator=( const MatrixView& view ) { this->rows = 0; this->columns = 0; this->values.reset(); rows = view.rows; columns = view.columns; values.copy( view.values ); } template< typename Real, Loading src/TNL/Matrices/Tridiagonal.h +2 −4 Original line number Diff line number Diff line Loading @@ -79,12 +79,8 @@ class Tridiagonal : public Matrix< Real, Device, Index, RealAllocator > template< typename Real_, typename Device_, typename Index_, bool RowMajorOrder_, typename RealAllocator_ > void setLike( const Tridiagonal< Real_, Device_, Index_, RowMajorOrder_, RealAllocator_ >& m ); IndexType getNumberOfMatrixElements() const; IndexType getNumberOfNonzeroMatrixElements() const; IndexType getMaxRowlength() const; void reset(); template< typename Real_, typename Device_, typename Index_, bool RowMajorOrder_, typename RealAllocator_ > Loading Loading @@ -179,6 +175,8 @@ class Tridiagonal : public Matrix< Real, Device, Index, RealAllocator > const IndexType localIdx ) const; IndexerType indexer; ViewType view; }; } // namespace Matrices Loading Loading
src/TNL/Matrices/Matrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public: template< typename Matrix_ > void setLike( const Matrix_& matrix ); IndexType getNumberOfMatrixElements() const; IndexType getAllocatedElementsCount() const; virtual IndexType getNumberOfNonzeroMatrixElements() const = 0; Loading
src/TNL/Matrices/Matrix.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ template< typename Real, typename Device, typename Index, typename RealAllocator > Index Matrix< Real, Device, Index, RealAllocator >::getNumberOfMatrixElements() const Index Matrix< Real, Device, Index, RealAllocator >::getAllocatedElementsCount() const { return this->values.getSize(); } Loading
src/TNL/Matrices/MatrixView.h +10 −3 Original line number Diff line number Diff line Loading @@ -57,12 +57,10 @@ public: virtual void getCompressedRowLengths( CompressedRowLengthsVectorView rowLengths ) const; IndexType getNumberOfMatrixElements() const; IndexType getAllocatedElementsCount() const; virtual IndexType getNumberOfNonzeroMatrixElements() const; void reset(); __cuda_callable__ IndexType getRows() const; Loading Loading @@ -91,6 +89,15 @@ public: ValuesView& getValues(); /** * \brief Shallow copy of the matrix view. * * @param view * @return */ __cuda_callable__ MatrixView& operator=( const MatrixView& view ); // TODO: parallelize and optimize for sparse matrices template< typename Matrix > bool operator == ( const Matrix& matrix ) const; Loading
src/TNL/Matrices/MatrixView.hpp +8 −6 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ void MatrixView< Real, Device, Index >::getCompressedRowLengths( CompressedRowLe template< typename Real, typename Device, typename Index > Index MatrixView< Real, Device, Index >::getNumberOfMatrixElements() const Index MatrixView< Real, Device, Index >::getAllocatedElementsCount() const { return this->values.getSize(); } Loading Loading @@ -118,15 +118,17 @@ getValues() { return this->values; } template< typename Real, typename Device, typename Index > void MatrixView< Real, Device, Index >::reset() __cuda_callable__ MatrixView< Real, Device, Index >& MatrixView< Real, Device, Index >:: operator=( const MatrixView& view ) { this->rows = 0; this->columns = 0; this->values.reset(); rows = view.rows; columns = view.columns; values.copy( view.values ); } template< typename Real, Loading
src/TNL/Matrices/Tridiagonal.h +2 −4 Original line number Diff line number Diff line Loading @@ -79,12 +79,8 @@ class Tridiagonal : public Matrix< Real, Device, Index, RealAllocator > template< typename Real_, typename Device_, typename Index_, bool RowMajorOrder_, typename RealAllocator_ > void setLike( const Tridiagonal< Real_, Device_, Index_, RowMajorOrder_, RealAllocator_ >& m ); IndexType getNumberOfMatrixElements() const; IndexType getNumberOfNonzeroMatrixElements() const; IndexType getMaxRowlength() const; void reset(); template< typename Real_, typename Device_, typename Index_, bool RowMajorOrder_, typename RealAllocator_ > Loading Loading @@ -179,6 +175,8 @@ class Tridiagonal : public Matrix< Real, Device, Index, RealAllocator > const IndexType localIdx ) const; IndexerType indexer; ViewType view; }; } // namespace Matrices Loading