Loading src/TNL/Containers/Segments/CSR.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -225,8 +225,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red const IndexType end = offsetsView[ i + 1 ]; RealType aux( zero ); bool compute( true ); IndexType localIdx( 0 ); for( IndexType j = begin; j < end && compute; j++ ) reduction( aux, fetch( i, j, compute, args... ) ); reduction( aux, fetch( i, localIdx++, j, compute, args... ) ); keeper( i, aux ); }; Algorithms::ParallelFor< Device >::exec( first, last, l, args... ); Loading src/TNL/Containers/Segments/SlicedEllpack.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -354,8 +354,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red const IndexType end = begin + segmentSize; RealType aux( zero ); bool compute( true ); IndexType localIdx( 0 ); for( IndexType globalIdx = begin; globalIdx< end; globalIdx++ ) reduction( aux, fetch( segmentIdx, globalIdx, compute, args... ) ); reduction( aux, fetch( segmentIdx, localIdx++, globalIdx, compute, args... ) ); keeper( segmentIdx, aux ); }; Algorithms::ParallelFor< Device >::exec( first, last, l, args... ); Loading @@ -370,8 +371,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red const IndexType end = sliceOffsets_view[ sliceIdx + 1 ]; RealType aux( zero ); bool compute( true ); IndexType localIdx( 0 ); for( IndexType globalIdx = begin; globalIdx < end; globalIdx += SliceSize ) reduction( aux, fetch( segmentIdx, globalIdx, compute, args... ) ); reduction( aux, fetch( segmentIdx, localIdx++, globalIdx, compute, args... ) ); keeper( segmentIdx, aux ); }; Algorithms::ParallelFor< Device >::exec( first, last, l, args... ); Loading src/TNL/Matrices/Dense.h +6 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,12 @@ class Dense : public Matrix< Real, Device, Index > typename = typename Enabler< Device2 >::type > Dense& operator=( const Dense< Real2, Device2, Index2 >& matrix ); template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool operator==( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const; template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool operator!=( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const; void save( const String& fileName ) const; void load( const String& fileName ); Loading src/TNL/Matrices/Dense.hpp +27 −0 Original line number Diff line number Diff line Loading @@ -994,6 +994,33 @@ Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::operator=( const Den throw Exceptions::NotImplementedError("Cross-device assignment for the Dense format is not implemented yet."); } template< typename Real, typename Device, typename Index, bool RowMajorOrder, typename RealAllocator > template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool Dense< Real, Device, Index, RowMajorOrder, RealAllocator >:: operator==( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const { return( this->getRows() == matrix.getRows() && this->getColumns() == matrix.getColumns() && this->getValues() == matrix.getValues() ); } template< typename Real, typename Device, typename Index, bool RowMajorOrder, typename RealAllocator > template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool Dense< Real, Device, Index, RowMajorOrder, RealAllocator >:: operator!=( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const { return ! ( *this == matrix ); } template< typename Real, typename Device, Loading src/TNL/Matrices/SparseMatrix.h +7 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,13 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator > */ SparseMatrix& operator=( const SparseMatrix& matrix ); /** * \brief Assignment of dense matrix */ template< typename Real_, typename Device_, typename Index_, bool RowMajorOrder, typename RealAllocator_ > SparseMatrix& operator=( const Dense< Real_, Device_, Index_, RowMajorOrder, RealAllocator_ >& matrix ); /** * \brief Assignment of any other matrix type. * @param matrix Loading Loading
src/TNL/Containers/Segments/CSR.hpp +2 −1 Original line number Diff line number Diff line Loading @@ -225,8 +225,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red const IndexType end = offsetsView[ i + 1 ]; RealType aux( zero ); bool compute( true ); IndexType localIdx( 0 ); for( IndexType j = begin; j < end && compute; j++ ) reduction( aux, fetch( i, j, compute, args... ) ); reduction( aux, fetch( i, localIdx++, j, compute, args... ) ); keeper( i, aux ); }; Algorithms::ParallelFor< Device >::exec( first, last, l, args... ); Loading
src/TNL/Containers/Segments/SlicedEllpack.hpp +4 −2 Original line number Diff line number Diff line Loading @@ -354,8 +354,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red const IndexType end = begin + segmentSize; RealType aux( zero ); bool compute( true ); IndexType localIdx( 0 ); for( IndexType globalIdx = begin; globalIdx< end; globalIdx++ ) reduction( aux, fetch( segmentIdx, globalIdx, compute, args... ) ); reduction( aux, fetch( segmentIdx, localIdx++, globalIdx, compute, args... ) ); keeper( segmentIdx, aux ); }; Algorithms::ParallelFor< Device >::exec( first, last, l, args... ); Loading @@ -370,8 +371,9 @@ segmentsReduction( IndexType first, IndexType last, Fetch& fetch, Reduction& red const IndexType end = sliceOffsets_view[ sliceIdx + 1 ]; RealType aux( zero ); bool compute( true ); IndexType localIdx( 0 ); for( IndexType globalIdx = begin; globalIdx < end; globalIdx += SliceSize ) reduction( aux, fetch( segmentIdx, globalIdx, compute, args... ) ); reduction( aux, fetch( segmentIdx, localIdx++, globalIdx, compute, args... ) ); keeper( segmentIdx, aux ); }; Algorithms::ParallelFor< Device >::exec( first, last, l, args... ); Loading
src/TNL/Matrices/Dense.h +6 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,12 @@ class Dense : public Matrix< Real, Device, Index > typename = typename Enabler< Device2 >::type > Dense& operator=( const Dense< Real2, Device2, Index2 >& matrix ); template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool operator==( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const; template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool operator!=( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const; void save( const String& fileName ) const; void load( const String& fileName ); Loading
src/TNL/Matrices/Dense.hpp +27 −0 Original line number Diff line number Diff line Loading @@ -994,6 +994,33 @@ Dense< Real, Device, Index, RowMajorOrder, RealAllocator >::operator=( const Den throw Exceptions::NotImplementedError("Cross-device assignment for the Dense format is not implemented yet."); } template< typename Real, typename Device, typename Index, bool RowMajorOrder, typename RealAllocator > template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool Dense< Real, Device, Index, RowMajorOrder, RealAllocator >:: operator==( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const { return( this->getRows() == matrix.getRows() && this->getColumns() == matrix.getColumns() && this->getValues() == matrix.getValues() ); } template< typename Real, typename Device, typename Index, bool RowMajorOrder, typename RealAllocator > template< typename Real_, typename Device_, typename Index_, typename RealAllocator_ > bool Dense< Real, Device, Index, RowMajorOrder, RealAllocator >:: operator!=( const Dense< Real_, Device_, Index_, RowMajorOrder >& matrix ) const { return ! ( *this == matrix ); } template< typename Real, typename Device, Loading
src/TNL/Matrices/SparseMatrix.h +7 −0 Original line number Diff line number Diff line Loading @@ -175,6 +175,13 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator > */ SparseMatrix& operator=( const SparseMatrix& matrix ); /** * \brief Assignment of dense matrix */ template< typename Real_, typename Device_, typename Index_, bool RowMajorOrder, typename RealAllocator_ > SparseMatrix& operator=( const Dense< Real_, Device_, Index_, RowMajorOrder, RealAllocator_ >& matrix ); /** * \brief Assignment of any other matrix type. * @param matrix Loading