From 1e74c6d1cdab525cdc14fb4f7200d4d36beb877b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Sat, 15 Sep 2018 07:56:16 +0200 Subject: [PATCH] Added method getLength to SparseRow --- src/TNL/Matrices/SparseRow.h | 3 +++ src/TNL/Matrices/SparseRow_impl.h | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/TNL/Matrices/SparseRow.h b/src/TNL/Matrices/SparseRow.h index 9451362541..e7547ee679 100644 --- a/src/TNL/Matrices/SparseRow.h +++ b/src/TNL/Matrices/SparseRow.h @@ -49,6 +49,9 @@ class SparseRow __cuda_callable__ const Real& getElementValue( const Index& elementIndex ) const; + __cuda_callable__ + Index getLength() const; + void print( std::ostream& str ) const; protected: diff --git a/src/TNL/Matrices/SparseRow_impl.h b/src/TNL/Matrices/SparseRow_impl.h index c4b69044bc..f6921b15bb 100644 --- a/src/TNL/Matrices/SparseRow_impl.h +++ b/src/TNL/Matrices/SparseRow_impl.h @@ -98,6 +98,15 @@ getElementValue( const Index& elementIndex ) const return this->values[ elementIndex * step ]; } +template< typename Real, typename Index > +__cuda_callable__ +Index +SparseRow< Real, Index >:: +getLength() const +{ + return length; +} + template< typename Real, typename Index > void SparseRow< Real, Index >:: -- GitLab