Commit 53762829 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Avoiding Matrix::getCompressedRowLengths.

parent 71a1f300
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ void export_Matrix( py::module & m, const char* name )

    using VectorType = TNL::Containers::Vector< typename Matrix::RealType, typename Matrix::DeviceType, typename Matrix::IndexType >;

    void (Matrix::* _getCompressedRowLengths)(typename Matrix::CompressedRowLengthsVector&) const = &Matrix::getCompressedRowLengths;
    void (Matrix::* _getCompressedRowLengths)(typename Matrix::CompressedRowLengthsVectorView) const = &Matrix::getCompressedRowLengths;

    auto matrix = py::class_< Matrix, TNL::Object >( m, name )
        .def(py::init<>())
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public:

   // TODO: implementation is not parallel
   // TODO: it would be nice if padding zeros could be stripped
   void getCompressedRowLengths( CompressedRowLengthsVector& rowLengths ) const;
   //void getCompressedRowLengths( CompressedRowLengthsVector& rowLengths ) const;

   virtual void getCompressedRowLengths( CompressedRowLengthsVectorView rowLengths ) const;

+5 −5
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ void Matrix< Real, Device, Index, RealAllocator >::setDimensions( const IndexTyp
   this->columns = columns;
}

template< typename Real,
/*template< typename Real,
          typename Device,
          typename Index,
          typename RealAllocator >
@@ -64,7 +64,7 @@ void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( Comp
{
   rowLengths.setSize( this->getRows() );
   getCompressedRowLengths( rowLengths.getView() );
}
}*/

template< typename Real,
          typename Device,
@@ -72,9 +72,9 @@ template< typename Real,
          typename RealAllocator >
void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( CompressedRowLengthsVectorView rowLengths ) const
{
   //TNL_ASSERT_EQ( rowLengths.getSize(), this->getRows(), "invalid size of the rowLengths vector" );
   //for( IndexType row = 0; row < this->getRows(); row++ )
   //   rowLengths.setElement( row, this->getRowLength( row ) );
   TNL_ASSERT_EQ( rowLengths.getSize(), this->getRows(), "invalid size of the rowLengths vector" );
   for( IndexType row = 0; row < this->getRows(); row++ )
      rowLengths.setElement( row, this->getRowLength( row ) );
}

template< typename Real,