Commit 11645636 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Implementing the shared pointers.

parent a228f31c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ class tnlBICGStabSolver : public tnlObject,
   typedef tnlSharedPointer< MatrixType, DeviceType > MatrixPointer;
   // TODO: make this 'typedef tnlSharedPointer< const MatrixType, DeviceType > ConstMatrixPointer;'


   public:

   tnlBICGStabSolver();
@@ -59,7 +60,7 @@ class tnlBICGStabSolver : public tnlObject,

   void setMatrix( MatrixPointer& matrix );

   void setPreconditioner( const Preconditioner& preconditioner );
   void setPreconditioner( const PreconditionerType& preconditioner );

#ifdef HAVE_NOT_CXX11
   template< typename VectorPointer,
+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ RealType computeBICGStabNewP( Vector& p,
template< typename Matrix,
          typename Preconditioner >
tnlBICGStabSolver< Matrix, Preconditioner > :: tnlBICGStabSolver()
: preconditioner( 0 )
{
}

@@ -72,7 +73,7 @@ void tnlBICGStabSolver< Matrix, Preconditioner >::setMatrix( MatrixPointer& matr

template< typename Matrix,
           typename Preconditioner >
void tnlBICGStabSolver< Matrix, Preconditioner > :: setPreconditioner( const Preconditioner& preconditioner )
void tnlBICGStabSolver< Matrix, Preconditioner > :: setPreconditioner( const PreconditionerType& preconditioner )
{
   this->preconditioner = &preconditioner;
}
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ class tnlCGSolver : public tnlObject,

   void setMatrix( MatrixPointer& matrix );

   void setPreconditioner( const Preconditioner& preconditioner );
   void setPreconditioner( const PreconditionerType& preconditioner );

#ifdef HAVE_NOT_CXX11
   template< typename Vector,
@@ -79,7 +79,7 @@ class tnlCGSolver : public tnlObject,
   tnlVector< RealType, DeviceType, IndexType >  r, new_r, p, Ap;

   MatrixPointer matrix;
   PreconditionerPointer preconditioner;
   const PreconditionerType* preconditioner;
};

#include <solvers/linear/krylov/tnlCGSolver_impl.h>
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
template< typename Matrix,
          typename Preconditioner >
tnlCGSolver< Matrix, Preconditioner > :: tnlCGSolver()
: preconditioner( 0 )
{
}

+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ class tnlGMRESSolver : public tnlObject,

   void setMatrix( MatrixPointer& matrix );

   void setPreconditioner( const Preconditioner& preconditioner );
   void setPreconditioner( const PreconditionerType& preconditioner );

#ifdef HAVE_NOT_CXX11
   template< typename VectorPointer,
Loading