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

Adding a method clear() to the shared pointers.

parent e2f66b49
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -230,6 +230,11 @@ class SharedPointer< Object, Devices::Host > : public SmartPointer
         return true;
      }
      
      void clear()
      {
         this->free();
      }

      ~SharedPointer()
      {
         this->free();
@@ -512,6 +517,11 @@ class SharedPointer< Object, Devices::Cuda > : public SmartPointer
#endif
      }
      
      void clear()
      {
         this->free();
      }      

      ~SharedPointer()
      {
         this->free();
+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@ template< typename Matrix,
          typename Preconditioner >
BICGStab< Matrix, Preconditioner > :: BICGStab()
{
   /****
    * Clearing the shared pointer means that there is no
    * preconditioner set.
    */
   this->preconditioner.clear();   
}

template< typename Matrix,
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,11 @@ template< typename Matrix,
          typename Preconditioner >
CG< Matrix, Preconditioner > :: CG()
{
   /****
    * Clearing the shared pointer means that there is no
    * preconditioner set.
    */
   this->preconditioner.clear();   
}

template< typename Matrix,
+5 −0
Original line number Diff line number Diff line
@@ -19,6 +19,11 @@ CWYGMRES()
  ldSize( 0 ),
  restarting( 10 )
{
   /****
    * Clearing the shared pointer means that there is no
    * preconditioner set.
    */
   this->preconditioner.clear();   
}

template< typename Matrix,
+1 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ protected:
   IndexType size, restarting;

   MatrixPointer matrix;
   
   PreconditionerPointer preconditioner;
};

Loading