Commit 5a054685 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Passing of matrix and preconditioner via const reference to SharedPointer

This will indicate to the user that the data will not be modified in the
solver. I think that it's not necessary to differentiate between e.g.
MatrixPointer and MatrixConstPointer, because these are implicitly
mutually assignable.
parent 40379dcf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -52,9 +52,9 @@ class BICGStab : public Object,
   bool setup( const Config::ParameterContainer& parameters,
               const String& prefix = "" );

   void setMatrix( MatrixPointer matrix );
   void setMatrix( const MatrixPointer& matrix );

   void setPreconditioner( PreconditionerPointer preconditioner );
   void setPreconditioner( const PreconditionerPointer& preconditioner );

   template< typename Vector,
             typename ResidueGetter = LinearResidueGetter< Matrix, Vector >  >
+2 −2
Original line number Diff line number Diff line
@@ -59,14 +59,14 @@ setup( const Config::ParameterContainer& parameters,

template< typename Matrix,
          typename Preconditioner >
void BICGStab< Matrix, Preconditioner >::setMatrix( MatrixPointer matrix )
void BICGStab< Matrix, Preconditioner >::setMatrix( const MatrixPointer& matrix )
{
   this->matrix = matrix;
}

template< typename Matrix,
          typename Preconditioner >
void BICGStab< Matrix, Preconditioner > :: setPreconditioner( PreconditionerPointer preconditioner )
void BICGStab< Matrix, Preconditioner > :: setPreconditioner( const PreconditionerPointer& preconditioner )
{
   this->preconditioner = preconditioner;
}
+2 −2
Original line number Diff line number Diff line
@@ -52,9 +52,9 @@ class CG : public Object,
   bool setup( const Config::ParameterContainer& parameters,
               const String& prefix = "" );

   void setMatrix( MatrixPointer matrix );
   void setMatrix( const MatrixPointer& matrix );

   void setPreconditioner( PreconditionerPointer preconditioner );
   void setPreconditioner( const PreconditionerPointer& preconditioner );

   template< typename Vector,
             typename ResidueGetter = LinearResidueGetter< Matrix, Vector >  >
+2 −2
Original line number Diff line number Diff line
@@ -51,14 +51,14 @@ setup( const Config::ParameterContainer& parameters,

template< typename Matrix,
          typename Preconditioner >
void CG< Matrix, Preconditioner >::setMatrix( MatrixPointer matrix )
void CG< Matrix, Preconditioner >::setMatrix( const MatrixPointer& matrix )
{
   this->matrix = matrix;
}

template< typename Matrix,
          typename Preconditioner >
void CG< Matrix, Preconditioner > :: setPreconditioner( PreconditionerPointer preconditioner )
void CG< Matrix, Preconditioner > :: setPreconditioner( const PreconditionerPointer& preconditioner )
{
   this->preconditioner = preconditioner;
}
+2 −2
Original line number Diff line number Diff line
@@ -53,9 +53,9 @@ class GMRES : public Object,

   void setRestarting( IndexType rest );

   void setMatrix( MatrixPointer matrix );
   void setMatrix( const MatrixPointer& matrix );

   void setPreconditioner( PreconditionerPointer preconditioner );
   void setPreconditioner( const PreconditionerPointer& preconditioner );

   template< typename Vector,
             typename ResidueGetter = LinearResidueGetter< Matrix, Vector >  >
Loading