Commit 945e8507 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Changed unimplemented performSORIteration methods to throw exceptions instead of returning false

parent 212c187b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <TNL/Algorithms/ParallelFor.h>
#include <TNL/Matrices/LambdaMatrix.h>
#include <TNL/Matrices/details/SparseMatrix.h>
#include <TNL/Exceptions/NotImplementedError.h>

namespace TNL {
namespace Matrices {
@@ -413,6 +414,7 @@ performSORIteration( const Vector1& b,
                          Vector2& x,
                          const RealType& omega ) const
{
   throw Exceptions::NotImplementedError("performSORIteration is not implemented for SparseMatrixView");
}

template< typename MatrixElementsLambda,
+1 −1
Original line number Diff line number Diff line
@@ -1044,7 +1044,7 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator >
       */

      template< typename Vector1, typename Vector2 >
      bool performSORIteration( const Vector1& b,
      void performSORIteration( const Vector1& b,
                                const IndexType row,
                                Vector2& x,
                                const RealType& omega = 1.0 ) const;
+2 −2
Original line number Diff line number Diff line
@@ -824,14 +824,14 @@ template< typename Real,
          typename RealAllocator,
          typename IndexAllocator >
template< typename Vector1, typename Vector2 >
bool
void
SparseMatrix< Real, Device, Index, MatrixType, Segments, ComputeReal, RealAllocator, IndexAllocator >::
performSORIteration( const Vector1& b,
                     const IndexType row,
                     Vector2& x,
                     const RealType& omega ) const
{
   return false;
   this->view.performSORIteration( b, row, x, omega );
}

// copy assignment
+1 −1
Original line number Diff line number Diff line
@@ -822,7 +822,7 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
                          IndexType end = 0 ) const;

      template< typename Vector1, typename Vector2 >
      bool performSORIteration( const Vector1& b,
      void performSORIteration( const Vector1& b,
                                const IndexType row,
                                Vector2& x,
                                const RealType& omega = 1.0 ) const;
+3 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <TNL/Algorithms/reduce.h>
#include <TNL/Algorithms/AtomicOperations.h>
#include <TNL/Matrices/details/SparseMatrix.h>
#include <TNL/Exceptions/NotImplementedError.h>

namespace TNL {
namespace Matrices {
@@ -832,14 +833,14 @@ template< typename Real,
          template< typename, typename > class SegmentsView,
          typename ComputeReal >
template< typename Vector1, typename Vector2 >
bool
void
SparseMatrixView< Real, Device, Index, MatrixType, SegmentsView, ComputeReal >::
performSORIteration( const Vector1& b,
                     const IndexType row,
                     Vector2& x,
                     const RealType& omega ) const
{
   return false;
   throw Exceptions::NotImplementedError("performSORIteration is not implemented for SparseMatrixView");
}

template< typename Real,