Skip to content
Snippets Groups Projects
Commit 53762829 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Avoiding Matrix::getCompressedRowLengths.

parent 71a1f300
No related branches found
No related tags found
1 merge request!48Segments
...@@ -51,7 +51,7 @@ void export_Matrix( py::module & m, const char* name ) ...@@ -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 >; 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 ) auto matrix = py::class_< Matrix, TNL::Object >( m, name )
.def(py::init<>()) .def(py::init<>())
......
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
// TODO: implementation is not parallel // TODO: implementation is not parallel
// TODO: it would be nice if padding zeros could be stripped // 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; virtual void getCompressedRowLengths( CompressedRowLengthsVectorView rowLengths ) const;
......
...@@ -56,7 +56,7 @@ void Matrix< Real, Device, Index, RealAllocator >::setDimensions( const IndexTyp ...@@ -56,7 +56,7 @@ void Matrix< Real, Device, Index, RealAllocator >::setDimensions( const IndexTyp
this->columns = columns; this->columns = columns;
} }
template< typename Real, /*template< typename Real,
typename Device, typename Device,
typename Index, typename Index,
typename RealAllocator > typename RealAllocator >
...@@ -64,7 +64,7 @@ void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( Comp ...@@ -64,7 +64,7 @@ void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( Comp
{ {
rowLengths.setSize( this->getRows() ); rowLengths.setSize( this->getRows() );
getCompressedRowLengths( rowLengths.getView() ); getCompressedRowLengths( rowLengths.getView() );
} }*/
template< typename Real, template< typename Real,
typename Device, typename Device,
...@@ -72,9 +72,9 @@ template< typename Real, ...@@ -72,9 +72,9 @@ template< typename Real,
typename RealAllocator > typename RealAllocator >
void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( CompressedRowLengthsVectorView rowLengths ) const void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( CompressedRowLengthsVectorView rowLengths ) const
{ {
//TNL_ASSERT_EQ( rowLengths.getSize(), this->getRows(), "invalid size of the rowLengths vector" ); TNL_ASSERT_EQ( rowLengths.getSize(), this->getRows(), "invalid size of the rowLengths vector" );
//for( IndexType row = 0; row < this->getRows(); row++ ) for( IndexType row = 0; row < this->getRows(); row++ )
// rowLengths.setElement( row, this->getRowLength( row ) ); rowLengths.setElement( row, this->getRowLength( row ) );
} }
template< typename Real, template< typename Real,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment