From fa7bd33f3e718ba3fb8d6540066f23b805554d8f Mon Sep 17 00:00:00 2001 From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz> Date: Mon, 27 Dec 2021 11:30:21 +0100 Subject: [PATCH] Deleting deprecated method performSORIteration from matrices. --- src/TNL/Matrices/DenseMatrix.h | 6 ----- src/TNL/Matrices/DenseMatrix.hpp | 22 ------------------- src/TNL/Matrices/DenseMatrixView.h | 6 ----- src/TNL/Matrices/DenseMatrixView.hpp | 22 ------------------- src/TNL/Matrices/LambdaMatrix.h | 7 ------ src/TNL/Matrices/LambdaMatrix.hpp | 16 -------------- src/TNL/Matrices/MultidiagonalMatrix.h | 7 ------ src/TNL/Matrices/MultidiagonalMatrix.hpp | 23 -------------------- src/TNL/Matrices/MultidiagonalMatrixView.h | 7 ------ src/TNL/Matrices/MultidiagonalMatrixView.hpp | 22 ------------------- src/TNL/Matrices/SparseMatrix.h | 6 ----- src/TNL/Matrices/SparseMatrix.hpp | 19 ---------------- src/TNL/Matrices/SparseMatrixView.h | 6 ----- src/TNL/Matrices/SparseMatrixView.hpp | 17 --------------- src/TNL/Matrices/TridiagonalMatrix.h | 7 ------ src/TNL/Matrices/TridiagonalMatrix.hpp | 21 ------------------ src/TNL/Matrices/TridiagonalMatrixView.h | 7 ------ src/TNL/Matrices/TridiagonalMatrixView.hpp | 22 ------------------- 18 files changed, 243 deletions(-) diff --git a/src/TNL/Matrices/DenseMatrix.h b/src/TNL/Matrices/DenseMatrix.h index 3d0e2d62da..d46b844e66 100644 --- a/src/TNL/Matrices/DenseMatrix.h +++ b/src/TNL/Matrices/DenseMatrix.h @@ -906,12 +906,6 @@ class DenseMatrix : public Matrix< Real, Device, Index, RealAllocator > void getTransposition( const Matrix& matrix, const RealType& matrixMultiplicator = 1.0 ); - template< typename Vector1, typename Vector2 > - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment operator with exactly the same type of the dense matrix. * diff --git a/src/TNL/Matrices/DenseMatrix.hpp b/src/TNL/Matrices/DenseMatrix.hpp index a42421aa7a..ae3f7ee6bb 100644 --- a/src/TNL/Matrices/DenseMatrix.hpp +++ b/src/TNL/Matrices/DenseMatrix.hpp @@ -1037,28 +1037,6 @@ void DenseMatrix< Real, Device, Index, Organization, RealAllocator >::getTranspo } } -template< typename Real, - typename Device, - typename Index, - ElementsOrganization Organization, - typename RealAllocator > - template< typename Vector1, typename Vector2 > -void DenseMatrix< Real, Device, Index, Organization, RealAllocator >::performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - RealType sum( 0.0 ), diagonalValue; - for( IndexType i = 0; i < this->getColumns(); i++ ) - { - if( i == row ) - diagonalValue = this->getElement( row, row ); - else - sum += this->getElement( row, i ) * x[ i ]; - } - x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / diagonalValue * ( b[ row ] - sum ); -} - template< typename Real, typename Device, typename Index, diff --git a/src/TNL/Matrices/DenseMatrixView.h b/src/TNL/Matrices/DenseMatrixView.h index 89a2219b3b..712a565ae2 100644 --- a/src/TNL/Matrices/DenseMatrixView.h +++ b/src/TNL/Matrices/DenseMatrixView.h @@ -856,12 +856,6 @@ class DenseMatrixView : public MatrixView< Real, Device, Index > void getTransposition( const Matrix& matrix, const RealType& matrixMultiplicator = 1.0 ); - template< typename Vector1, typename Vector2 > - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment operator with DenseMatrix. * diff --git a/src/TNL/Matrices/DenseMatrixView.hpp b/src/TNL/Matrices/DenseMatrixView.hpp index 3a44269d1d..336fcbb9aa 100644 --- a/src/TNL/Matrices/DenseMatrixView.hpp +++ b/src/TNL/Matrices/DenseMatrixView.hpp @@ -1006,28 +1006,6 @@ void DenseMatrixView< Real, Device, Index, Organization >::getTransposition( con } } -template< typename Real, - typename Device, - typename Index, - ElementsOrganization Organization > - template< typename Vector1, typename Vector2 > -void DenseMatrixView< Real, Device, Index, Organization >::performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - RealType sum( 0.0 ), diagonalValue; - for( IndexType i = 0; i < this->getColumns(); i++ ) - { - if( i == row ) - diagonalValue = this->getElement( row, row ); - else - sum += this->getElement( row, i ) * x[ i ]; - } - x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / diagonalValue * ( b[ row ] - sum ); -} - - template< typename Real, typename Device, typename Index, diff --git a/src/TNL/Matrices/LambdaMatrix.h b/src/TNL/Matrices/LambdaMatrix.h index 2b788ed527..0278a00ef4 100644 --- a/src/TNL/Matrices/LambdaMatrix.h +++ b/src/TNL/Matrices/LambdaMatrix.h @@ -490,13 +490,6 @@ class LambdaMatrix const IndexType begin = 0, IndexType end = 0 ) const; - - template< typename Vector1, typename Vector2 > - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Method for printing the matrix to output stream. * diff --git a/src/TNL/Matrices/LambdaMatrix.hpp b/src/TNL/Matrices/LambdaMatrix.hpp index 730c8b5b1d..e348a6dba6 100644 --- a/src/TNL/Matrices/LambdaMatrix.hpp +++ b/src/TNL/Matrices/LambdaMatrix.hpp @@ -401,22 +401,6 @@ sequentialForAllRows( Function&& function ) const sequentialForRows( (IndexType) 0, this->getRows(), function ); } -template< typename MatrixElementsLambda, - typename CompressedRowLengthsLambda, - typename Real, - typename Device, - typename Index > - template< typename Vector1, typename Vector2 > -void -LambdaMatrix< MatrixElementsLambda, CompressedRowLengthsLambda, Real, Device, Index >:: -performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - throw Exceptions::NotImplementedError("performSORIteration is not implemented for SparseMatrixView"); -} - template< typename MatrixElementsLambda, typename CompressedRowLengthsLambda, typename Real, diff --git a/src/TNL/Matrices/MultidiagonalMatrix.h b/src/TNL/Matrices/MultidiagonalMatrix.h index 3a74b0b44f..d56f1fd061 100644 --- a/src/TNL/Matrices/MultidiagonalMatrix.h +++ b/src/TNL/Matrices/MultidiagonalMatrix.h @@ -1053,13 +1053,6 @@ class MultidiagonalMatrix : public Matrix< Real, Device, Index, RealAllocator > void getTransposition( const MultidiagonalMatrix< Real2, Device, Index2 >& matrix, const RealType& matrixMultiplicator = 1.0 ); - template< typename Vector1, typename Vector2 > - __cuda_callable__ - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment of exactly the same matrix type. * diff --git a/src/TNL/Matrices/MultidiagonalMatrix.hpp b/src/TNL/Matrices/MultidiagonalMatrix.hpp index 244188831c..6ece15b4ca 100644 --- a/src/TNL/Matrices/MultidiagonalMatrix.hpp +++ b/src/TNL/Matrices/MultidiagonalMatrix.hpp @@ -808,29 +808,6 @@ getTransposition( const MultidiagonalMatrix< Real2, Device, Index2 >& matrix, } } -template< typename Real, - typename Device, - typename Index, - ElementsOrganization Organization, - typename RealAllocator, - typename IndexAllocator > - template< typename Vector1, typename Vector2 > -__cuda_callable__ -void MultidiagonalMatrix< Real, Device, Index, Organization, RealAllocator, IndexAllocator >:: -performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - RealType sum( 0.0 ); - if( row > 0 ) - sum += this->getElementFast( row, row - 1 ) * x[ row - 1 ]; - if( row < this->getColumns() - 1 ) - sum += this->getElementFast( row, row + 1 ) * x[ row + 1 ]; - x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / this->getElementFast( row, row ) * ( b[ row ] - sum ); -} - - // copy assignment template< typename Real, typename Device, diff --git a/src/TNL/Matrices/MultidiagonalMatrixView.h b/src/TNL/Matrices/MultidiagonalMatrixView.h index 869ddb9732..a0e13874d0 100644 --- a/src/TNL/Matrices/MultidiagonalMatrixView.h +++ b/src/TNL/Matrices/MultidiagonalMatrixView.h @@ -811,13 +811,6 @@ class MultidiagonalMatrixView : public MatrixView< Real, Device, Index > void getTransposition( const MultidiagonalMatrixView< Real2, Device, Index2 >& matrix, const RealType& matrixMultiplicator = 1.0 ); - template< typename Vector1, typename Vector2 > - __cuda_callable__ - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment of exactly the same matrix type. * diff --git a/src/TNL/Matrices/MultidiagonalMatrixView.hpp b/src/TNL/Matrices/MultidiagonalMatrixView.hpp index 550158e4d4..65293b809e 100644 --- a/src/TNL/Matrices/MultidiagonalMatrixView.hpp +++ b/src/TNL/Matrices/MultidiagonalMatrixView.hpp @@ -774,28 +774,6 @@ getTransposition( const MultidiagonalMatrixView< Real2, Device, Index2 >& matrix } } -template< typename Real, - typename Device, - typename Index, - ElementsOrganization Organization > - template< typename Vector1, typename Vector2 > -__cuda_callable__ -void -MultidiagonalMatrixView< Real, Device, Index, Organization >:: -performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - RealType sum( 0.0 ); - if( row > 0 ) - sum += this->getElementFast( row, row - 1 ) * x[ row - 1 ]; - if( row < this->getColumns() - 1 ) - sum += this->getElementFast( row, row + 1 ) * x[ row + 1 ]; - x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / this->getElementFast( row, row ) * ( b[ row ] - sum ); -} - - template< typename Real, typename Device, typename Index, diff --git a/src/TNL/Matrices/SparseMatrix.h b/src/TNL/Matrices/SparseMatrix.h index fa3441b018..76d47b50dc 100644 --- a/src/TNL/Matrices/SparseMatrix.h +++ b/src/TNL/Matrices/SparseMatrix.h @@ -1043,12 +1043,6 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator > const RealType& matrixMultiplicator = 1.0 ); */ - template< typename Vector1, typename Vector2 > - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment of exactly the same matrix type. * diff --git a/src/TNL/Matrices/SparseMatrix.hpp b/src/TNL/Matrices/SparseMatrix.hpp index 93cd9b173f..b7df383b0a 100644 --- a/src/TNL/Matrices/SparseMatrix.hpp +++ b/src/TNL/Matrices/SparseMatrix.hpp @@ -815,25 +815,6 @@ getTransposition( const SparseMatrix< Real2, Device, Index2 >& matrix, }*/ -template< typename Real, - typename Device, - typename Index, - typename MatrixType, - template< typename, typename, typename > class Segments, - typename ComputeReal, - typename RealAllocator, - typename IndexAllocator > -template< typename Vector1, typename Vector2 > -void -SparseMatrix< Real, Device, Index, MatrixType, Segments, ComputeReal, RealAllocator, IndexAllocator >:: -performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - this->view.performSORIteration( b, row, x, omega ); -} - // copy assignment template< typename Real, typename Device, diff --git a/src/TNL/Matrices/SparseMatrixView.h b/src/TNL/Matrices/SparseMatrixView.h index eaf692ac66..704d8c7ed9 100644 --- a/src/TNL/Matrices/SparseMatrixView.h +++ b/src/TNL/Matrices/SparseMatrixView.h @@ -821,12 +821,6 @@ class SparseMatrixView : public MatrixView< Real, Device, Index > const IndexType begin = 0, IndexType end = 0 ) const; - template< typename Vector1, typename Vector2 > - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment of any matrix type. * . diff --git a/src/TNL/Matrices/SparseMatrixView.hpp b/src/TNL/Matrices/SparseMatrixView.hpp index d7ed73815b..3d0ce73427 100644 --- a/src/TNL/Matrices/SparseMatrixView.hpp +++ b/src/TNL/Matrices/SparseMatrixView.hpp @@ -827,23 +827,6 @@ getTransposition( const SparseMatrixView< Real2, Device, Index2 >& matrix, }*/ -template< typename Real, - typename Device, - typename Index, - typename MatrixType, - template< typename, typename > class SegmentsView, - typename ComputeReal > -template< typename Vector1, typename Vector2 > -void -SparseMatrixView< Real, Device, Index, MatrixType, SegmentsView, ComputeReal >:: -performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - throw Exceptions::NotImplementedError("performSORIteration is not implemented for SparseMatrixView"); -} - template< typename Real, typename Device, typename Index, diff --git a/src/TNL/Matrices/TridiagonalMatrix.h b/src/TNL/Matrices/TridiagonalMatrix.h index 45e6d132fe..bb47f68126 100644 --- a/src/TNL/Matrices/TridiagonalMatrix.h +++ b/src/TNL/Matrices/TridiagonalMatrix.h @@ -945,13 +945,6 @@ class TridiagonalMatrix : public Matrix< Real, Device, Index, RealAllocator > void getTransposition( const TridiagonalMatrix< Real2, Device, Index2 >& matrix, const RealType& matrixTriplicator = 1.0 ); - template< typename Vector1, typename Vector2 > - __cuda_callable__ - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment of exactly the same matrix type. * diff --git a/src/TNL/Matrices/TridiagonalMatrix.hpp b/src/TNL/Matrices/TridiagonalMatrix.hpp index 93ebcd8b39..80236b7de7 100644 --- a/src/TNL/Matrices/TridiagonalMatrix.hpp +++ b/src/TNL/Matrices/TridiagonalMatrix.hpp @@ -658,27 +658,6 @@ void TridiagonalMatrix< Real, Device, Index, Organization, RealAllocator >::getT } } -template< typename Real, - typename Device, - typename Index, - ElementsOrganization Organization, - typename RealAllocator > - template< typename Vector1, typename Vector2 > -__cuda_callable__ -void TridiagonalMatrix< Real, Device, Index, Organization, RealAllocator >::performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - RealType sum( 0.0 ); - if( row > 0 ) - sum += this->getElementFast( row, row - 1 ) * x[ row - 1 ]; - if( row < this->getColumns() - 1 ) - sum += this->getElementFast( row, row + 1 ) * x[ row + 1 ]; - x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / this->getElementFast( row, row ) * ( b[ row ] - sum ); -} - - // copy assignment template< typename Real, typename Device, diff --git a/src/TNL/Matrices/TridiagonalMatrixView.h b/src/TNL/Matrices/TridiagonalMatrixView.h index c8e0ecdcad..3420f68154 100644 --- a/src/TNL/Matrices/TridiagonalMatrixView.h +++ b/src/TNL/Matrices/TridiagonalMatrixView.h @@ -779,13 +779,6 @@ class TridiagonalMatrixView : public MatrixView< Real, Device, Index > void getTransposition( const TridiagonalMatrixView< Real2, Device, Index2 >& matrix, const RealType& matrixMultiplicator = 1.0 ); - template< typename Vector1, typename Vector2 > - __cuda_callable__ - void performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega = 1.0 ) const; - /** * \brief Assignment of exactly the same matrix type. * diff --git a/src/TNL/Matrices/TridiagonalMatrixView.hpp b/src/TNL/Matrices/TridiagonalMatrixView.hpp index c670733810..64da406244 100644 --- a/src/TNL/Matrices/TridiagonalMatrixView.hpp +++ b/src/TNL/Matrices/TridiagonalMatrixView.hpp @@ -757,28 +757,6 @@ getTransposition( const TridiagonalMatrixView< Real2, Device, Index2 >& matrix, } } -template< typename Real, - typename Device, - typename Index, - ElementsOrganization Organization > - template< typename Vector1, typename Vector2 > -__cuda_callable__ -void -TridiagonalMatrixView< Real, Device, Index, Organization >:: -performSORIteration( const Vector1& b, - const IndexType row, - Vector2& x, - const RealType& omega ) const -{ - RealType sum( 0.0 ); - if( row > 0 ) - sum += this->getElementFast( row, row - 1 ) * x[ row - 1 ]; - if( row < this->getColumns() - 1 ) - sum += this->getElementFast( row, row + 1 ) * x[ row + 1 ]; - x[ row ] = ( 1.0 - omega ) * x[ row ] + omega / this->getElementFast( row, row ) * ( b[ row ] - sum ); -} - - template< typename Real, typename Device, typename Index, -- GitLab