Loading src/TNL/Matrices/CSR_impl.h +4 −2 Original line number Diff line number Diff line Loading @@ -90,14 +90,16 @@ template< typename Real, typename Index > void CSR< Real, Device, Index >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); /**** * Compute the rows pointers. The last one is * the end of the last row and so it says the * necessary length of the vectors this->values * and this->columnIndexes. */ TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); Containers::SharedVector< IndexType, DeviceType, IndexType > rowPtrs; rowPtrs.bind( this->rowPointers.getData(), this->getRows() ); rowPtrs = rowLengths; Loading src/TNL/Matrices/ChunkedEllpack_impl.h +3 −2 Original line number Diff line number Diff line Loading @@ -217,8 +217,9 @@ template< typename Real, typename Index > void ChunkedEllpack< Real, Device, Index >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); IndexType elementsToAllocation( 0 ); Loading src/TNL/Matrices/Ellpack_impl.h +4 −3 Original line number Diff line number Diff line Loading @@ -86,9 +86,10 @@ template< typename Real, typename Index > void Ellpack< Real, Device, Index >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); TNL_ASSERT( rowLengths.getSize() > 0, ); TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); this->rowLengths = this->maxRowLength = rowLengths.max(); allocateElements(); } Loading src/TNL/Matrices/SlicedEllpack_impl.h +4 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,10 @@ template< typename Real, int SliceSize > void SlicedEllpack< Real, Device, Index, SliceSize >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); const IndexType slices = roundUpDivision( this->rows, SliceSize ); this->sliceCompressedRowLengths.setSize( slices ); this->slicePointers.setSize( slices + 1 ); Loading Loading
src/TNL/Matrices/CSR_impl.h +4 −2 Original line number Diff line number Diff line Loading @@ -90,14 +90,16 @@ template< typename Real, typename Index > void CSR< Real, Device, Index >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); /**** * Compute the rows pointers. The last one is * the end of the last row and so it says the * necessary length of the vectors this->values * and this->columnIndexes. */ TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); Containers::SharedVector< IndexType, DeviceType, IndexType > rowPtrs; rowPtrs.bind( this->rowPointers.getData(), this->getRows() ); rowPtrs = rowLengths; Loading
src/TNL/Matrices/ChunkedEllpack_impl.h +3 −2 Original line number Diff line number Diff line Loading @@ -217,8 +217,9 @@ template< typename Real, typename Index > void ChunkedEllpack< Real, Device, Index >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); IndexType elementsToAllocation( 0 ); Loading
src/TNL/Matrices/Ellpack_impl.h +4 −3 Original line number Diff line number Diff line Loading @@ -86,9 +86,10 @@ template< typename Real, typename Index > void Ellpack< Real, Device, Index >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); TNL_ASSERT( rowLengths.getSize() > 0, ); TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); this->rowLengths = this->maxRowLength = rowLengths.max(); allocateElements(); } Loading
src/TNL/Matrices/SlicedEllpack_impl.h +4 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,10 @@ template< typename Real, int SliceSize > void SlicedEllpack< Real, Device, Index, SliceSize >::setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT( this->getRows() > 0, ); TNL_ASSERT( this->getColumns() > 0, ); TNL_ASSERT_GT( this->getRows(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_GT( this->getColumns(), 0, "cannot set row lengths of an empty matrix" ); TNL_ASSERT_EQ( this->getRows(), rowLengths.getSize(), "wrong size of the rowLengths vector" ); const IndexType slices = roundUpDivision( this->rows, SliceSize ); this->sliceCompressedRowLengths.setSize( slices ); this->slicePointers.setSize( slices + 1 ); Loading