diff --git a/src/TNL/Matrices/Matrix.h b/src/TNL/Matrices/Matrix.h index ebe7ccc21fb31326b020851854d3026f4675b7c3..0b34a5a57f2426d211a57854d311a55a85a50422 100644 --- a/src/TNL/Matrices/Matrix.h +++ b/src/TNL/Matrices/Matrix.h @@ -76,14 +76,16 @@ public: __cuda_callable__ IndexType getColumns() const; - virtual void setElement( const IndexType row, + //virtual TODO: uncomment + void setElement( const IndexType row, const IndexType column, - const RealType& value ) = 0; + const RealType& value );// = 0; - virtual void addElement( const IndexType row, + //virtual TODO: uncomment + void addElement( const IndexType row, const IndexType column, const RealType& value, - const RealType& thisElementMultiplicator = 1.0 ) = 0; + const RealType& thisElementMultiplicator = 1.0 );// = 0; virtual Real getElement( const IndexType row, const IndexType column ) const = 0; diff --git a/src/TNL/Matrices/Multidiagonal.hpp b/src/TNL/Matrices/Multidiagonal.hpp index b885115012876bc4485c2c882e16e3d005d016ba..7bc83f2d4904bf647d412f19d053776d83c7334b 100644 --- a/src/TNL/Matrices/Multidiagonal.hpp +++ b/src/TNL/Matrices/Multidiagonal.hpp @@ -707,7 +707,7 @@ operator=( const Multidiagonal< Real_, Device_, Index_, RowMajorOrder_, RealAllo //// // Copy matrix elements from the buffer to the matrix - auto f2 = [=] __cuda_callable__ ( IndexType rowIdx, IndexType localIdx, IndexType& columnIndex, RealType& value ) mutable { + auto f2 = [=] __cuda_callable__ ( const IndexType rowIdx, const IndexType localIdx, const IndexType columnIndex, RealType& value ) mutable { const IndexType bufferIdx = ( rowIdx - baseRow ) * maxRowLength + localIdx; value = thisValuesBuffer_view[ bufferIdx ]; }; diff --git a/src/TNL/Matrices/MultidiagonalMatrixView.h b/src/TNL/Matrices/MultidiagonalMatrixView.h index 3d33ac0aeadb6583fee464923e2c2410c6a326de..1e5a9bd28e5e75a0062f0ee738a5d7a49ff653dd 100644 --- a/src/TNL/Matrices/MultidiagonalMatrixView.h +++ b/src/TNL/Matrices/MultidiagonalMatrixView.h @@ -30,10 +30,10 @@ class MultidiagonalMatrixView : public MatrixView< Real, Device, Index > using DeviceType = Device; using IndexType = Index; using BaseType = MatrixView< Real, Device, Index >; - using DiagonalsShiftsType = Containers::Vector< IndexType, DeviceType, IndexType >; - using DiagonalsShiftsView = typename DiagonalsShiftsType::ViewType; - using HostDiagonalsShiftsType = Containers::Vector< IndexType, Devices::Host, IndexType >; - using HostDiagonalsShiftsView = typename DiagonalsShiftsType::ViewType; + //using DiagonalsShiftsType = Containers::Vector< IndexType, DeviceType, IndexType >; + using DiagonalsShiftsView = Containers::VectorView< IndexType, DeviceType, IndexType >; + //using HostDiagonalsShiftsType = Containers::Vector< IndexType, Devices::Host, IndexType >; + using HostDiagonalsShiftsView = Containers::VectorView< IndexType, Devices::Host, IndexType >; using IndexerType = details::MultidiagonalMatrixIndexer< IndexType, RowMajorOrder >; using ValuesViewType = typename BaseType::ValuesView; using ViewType = MultidiagonalMatrixView< Real, Device, Index, RowMajorOrder >; diff --git a/src/TNL/Matrices/MultidiagonalMatrixView.hpp b/src/TNL/Matrices/MultidiagonalMatrixView.hpp index 1ba8dc34d095d3c6c8ef96ed66aef41acb2f28b8..2839c997aa3a5a3acbbb1406dcdf08fdfa00dce2 100644 --- a/src/TNL/Matrices/MultidiagonalMatrixView.hpp +++ b/src/TNL/Matrices/MultidiagonalMatrixView.hpp @@ -398,7 +398,7 @@ forRows( IndexType first, IndexType last, Function& function ) const { const IndexType columnIdx = rowIdx + diagonalsShifts_view[ localIdx ]; if( columnIdx >= 0 && columnIdx < columns ) - function( rowIdx, localIdx, columnIdx, values_view[ indexer.getGlobalIndex( rowIdx, localIdx, 0 ) ] ); + function( rowIdx, localIdx, columnIdx, values_view[ indexer.getGlobalIndex( rowIdx, localIdx ) ] ); } }; Algorithms::ParallelFor< DeviceType >::exec( first, last, f );