Skip to content
Snippets Groups Projects
Commit dc4b2498 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Refactoring preconditioners - the solve method can return just void

parent bc9a2b30
No related branches found
No related tags found
1 merge request!8Distributed linear solvers
This commit is part of merge request !8. Comments created here will be created in the context of that merge request.
......@@ -59,7 +59,7 @@ public:
virtual void update( const MatrixPointer& matrixPointer ) override;
virtual bool solve( ConstVectorViewType b, VectorViewType x ) const override;
virtual void solve( ConstVectorViewType b, VectorViewType x ) const override;
protected:
Matrices::CSR< RealType, DeviceType, IndexType > L;
......@@ -87,7 +87,7 @@ public:
virtual void update( const MatrixPointer& matrixPointer ) override;
virtual bool solve( ConstVectorViewType b, VectorViewType x ) const override;
virtual void solve( ConstVectorViewType b, VectorViewType x ) const override;
~ILU0_impl()
{
......@@ -188,7 +188,7 @@ public:
throw std::runtime_error("Not Iplemented yet for MIC");
}
virtual bool solve( ConstVectorViewType b, VectorViewType x ) const override
virtual void solve( ConstVectorViewType b, VectorViewType x ) const override
{
throw std::runtime_error("Not Iplemented yet for MIC");
}
......
......@@ -103,7 +103,7 @@ update( const MatrixPointer& matrixPointer )
}
template< typename Matrix, typename Real, typename Index >
bool
void
ILU0_impl< Matrix, Real, Devices::Host, Index >::
solve( ConstVectorViewType b, VectorViewType x ) const
{
......@@ -147,8 +147,6 @@ solve( ConstVectorViewType b, VectorViewType x ) const
x[ i ] /= U_ii;
}
return true;
}
......@@ -262,7 +260,7 @@ update( const MatrixPointer& matrixPointer )
}
template< typename Matrix >
bool
void
ILU0_impl< Matrix, double, Devices::Cuda, int >::
solve( ConstVectorViewType b, VectorViewType x ) const
{
......@@ -290,8 +288,6 @@ solve( ConstVectorViewType b, VectorViewType x ) const
y.getData(),
x.getData(),
policy_U, (void*) pBuffer.getData() );
return true;
#else
throw std::runtime_error("The program was not compiled with the CUSPARSE library. Pass -DHAVE_CUSPARSE -lcusparse to the compiler.");
#endif
......
......@@ -64,7 +64,7 @@ public:
virtual void update( const MatrixPointer& matrixPointer ) override;
virtual bool solve( ConstVectorViewType b, VectorViewType x ) const override;
virtual void solve( ConstVectorViewType b, VectorViewType x ) const override;
protected:
Index p = 0;
......@@ -92,7 +92,7 @@ public:
throw std::runtime_error("Not Iplemented yet for CUDA");
}
virtual bool solve( ConstVectorViewType b, VectorViewType x ) const override
virtual void solve( ConstVectorViewType b, VectorViewType x ) const override
{
throw std::runtime_error("Not Iplemented yet for CUDA");
}
......@@ -115,7 +115,7 @@ public:
throw std::runtime_error("Not Iplemented yet for MIC");
}
virtual bool solve( ConstVectorViewType b, VectorViewType x ) const override
virtual void solve( ConstVectorViewType b, VectorViewType x ) const override
{
throw std::runtime_error("Not Iplemented yet for MIC");
}
......
......@@ -241,7 +241,7 @@ update( const MatrixPointer& matrixPointer )
}
template< typename Matrix, typename Real, typename Index >
bool
void
ILUT_impl< Matrix, Real, Devices::Host, Index >::
solve( ConstVectorViewType b, VectorViewType x ) const
{
......@@ -289,8 +289,6 @@ solve( ConstVectorViewType b, VectorViewType x ) const
x[ i ] /= U_ii;
}
return true;
}
} // namespace Preconditioners
......
......@@ -46,10 +46,9 @@ public:
virtual void update( const MatrixPointer& matrixPointer )
{}
virtual bool solve( ConstVectorViewType b, VectorViewType x ) const
virtual void solve( ConstVectorViewType b, VectorViewType x ) const
{
TNL_ASSERT_TRUE( false, "The solve() method of a dummy preconditioner should not be called." );
return true;
}
String getType() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment