Commit 20c94442 authored by Lukas Cejka's avatar Lukas Cejka
Browse files

Added getNonZeroRowLength for backup purposes.

parent f937a97f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ public:
   __cuda_callable__
   IndexType getRowLengthFast( const IndexType row ) const;
   
   IndexType getNonZeroRowLength( const IndexType row ) const;

   template< typename Real2, typename Device2, typename Index2 >
   void setLike( const CSR< Real2, Device2, Index2 >& matrix );

+9 −0
Original line number Diff line number Diff line
@@ -131,6 +131,15 @@ Index CSR< Real, Device, Index >::getRowLengthFast( const IndexType row ) const
   return this->rowPointers[ row + 1 ] - this->rowPointers[ row ];
}

template< typename Real,
          typename Device,
          typename Index >
Index CSR< Real, Device, Index >::getNonZeroRowLength( const IndexType row ) const
{
    ConstMatrixRow matrixRow = getRow( row );
    return matrixRow.getNonZeroElementsCount();
}

template< typename Real,
          typename Device,
          typename Index >
+2 −0
Original line number Diff line number Diff line
@@ -105,6 +105,8 @@ public:
   __cuda_callable__
   IndexType getRowLengthFast( const IndexType row ) const;
   
   IndexType getNonZeroRowLength( const IndexType row ) const;

   template< typename Real2, typename Device2, typename Index2 >
   void setLike( const ChunkedEllpack< Real2, Device2, Index2 >& matrix );

+13 −4
Original line number Diff line number Diff line
@@ -308,6 +308,15 @@ Index ChunkedEllpack< Real, Device, Index >::getRowLengthFast( const IndexType r
   return rowPointers[ row + 1 ] - rowPointers[ row ];
}

template< typename Real,
          typename Device,
          typename Index >
Index ChunkedEllpack< Real, Device, Index >::getNonZeroRowLength( const IndexType row ) const
{
    ConstMatrixRow matrixRow = getRow( row );
    return matrixRow.getNonZeroElementsCount();
}

template< typename Real,
          typename Device,
          typename Index >
@@ -979,7 +988,7 @@ getRow( const IndexType rowIndex ) const
{
   const IndexType rowOffset = this->rowPointers[ rowIndex ];
   const IndexType rowLength = this->rowPointers[ rowIndex + 1 ] - rowOffset;
   return MatrixRow( &this->columnIndexes[ rowOffset ],
   return ConstMatrixRow( &this->columnIndexes[ rowOffset ],
                          &this->values[ rowOffset ],
                          rowLength,
                          1 );
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ public:
   __cuda_callable__
   IndexType getRowLengthFast( const IndexType row ) const;
   
   IndexType getNonZeroRowLength( const IndexType row ) const;

   template< typename Real2, typename Device2, typename Index2 >
   void setLike( const Ellpack< Real2, Device2, Index2 >& matrix );

Loading