Loading src/Python/pytnl/tnl/SparseMatrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -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<>()) Loading src/TNL/Matrices/Matrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading src/TNL/Matrices/Matrix.hpp +5 −5 Original line number Diff line number Diff line Loading @@ -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 > Loading @@ -64,7 +64,7 @@ void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( Comp { rowLengths.setSize( this->getRows() ); getCompressedRowLengths( rowLengths.getView() ); } }*/ template< typename Real, typename Device, Loading @@ -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, Loading Loading
src/Python/pytnl/tnl/SparseMatrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -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<>()) Loading
src/TNL/Matrices/Matrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
src/TNL/Matrices/Matrix.hpp +5 −5 Original line number Diff line number Diff line Loading @@ -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 > Loading @@ -64,7 +64,7 @@ void Matrix< Real, Device, Index, RealAllocator >::getCompressedRowLengths( Comp { rowLengths.setSize( this->getRows() ); getCompressedRowLengths( rowLengths.getView() ); } }*/ template< typename Real, typename Device, Loading @@ -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, Loading