Loading src/TNL/SharedPointer.h +54 −48 Original line number Diff line number Diff line Loading @@ -49,13 +49,8 @@ namespace TNL { /*** * Use the lazy mode if you do not want to call the object constructor in the * shared pointer constructor. You may call it later via the method recreate. */ template< typename Object, typename Device = typename Object::DeviceType, bool lazy = false > typename Device = typename Object::DeviceType > class SharedPointer { static_assert( ! std::is_same< Device, void >::value, "The device cannot be void. You need to specify the device explicitly in your code." ); Loading @@ -64,8 +59,8 @@ class SharedPointer /**** * Specialization for Devices::Host */ template< typename Object, bool lazy > class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer template< typename Object > class SharedPointer< Object, Devices::Host > : public SmartPointer { private: // Convenient template alias for controlling the selection of copy- and Loading @@ -77,14 +72,14 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >; // friend class will be needed for templated assignment operators template< typename Object_, typename Device_, bool lazy_ > template< typename Object_, typename Device_ > friend class SharedPointer; public: typedef Object ObjectType; typedef Devices::Host DeviceType; typedef SharedPointer< Object, Devices::Host, lazy > ThisType; typedef SharedPointer< Object, Devices::Host > ThisType; template< typename... Args > explicit SharedPointer( Args... args ) Loading @@ -93,7 +88,6 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Creating shared pointer to " << demangle(typeid(ObjectType).name()) << std::endl; #endif if( ! lazy ) this->allocate( args... ); } Loading @@ -105,9 +99,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( const SharedPointer< Object_, DeviceType, lazy_ >& pointer ) SharedPointer( const SharedPointer< Object_, DeviceType >& pointer ) : pd( (PointerData*) pointer.pd ) { this->pd->counter += 1; Loading @@ -121,9 +115,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( SharedPointer< Object_, DeviceType, lazy_ >&& pointer ) SharedPointer( SharedPointer< Object_, DeviceType >&& pointer ) : pd( (PointerData*) pointer.pd ) { pointer.pd = nullptr; Loading Loading @@ -203,9 +197,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( const SharedPointer< Object_, DeviceType, lazy_ >& ptr ) const ThisType& operator=( const SharedPointer< Object_, DeviceType >& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -223,9 +217,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( SharedPointer< Object_, DeviceType, lazy_ >&& ptr ) const ThisType& operator=( SharedPointer< Object_, DeviceType >&& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -238,6 +232,11 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer return true; } void clear() { this->free(); } ~SharedPointer() { this->free(); Loading Loading @@ -284,8 +283,8 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer /**** * Specialization for CUDA */ template< typename Object, bool lazy > class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer template< typename Object > class SharedPointer< Object, Devices::Cuda > : public SmartPointer { private: // Convenient template alias for controlling the selection of copy- and Loading @@ -297,21 +296,20 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >; // friend class will be needed for templated assignment operators template< typename Object_, typename Device_, bool lazy_ > template< typename Object_, typename Device_ > friend class SharedPointer; public: typedef Object ObjectType; typedef Devices::Cuda DeviceType; typedef SharedPointer< Object, Devices::Cuda, lazy > ThisType; typedef SharedPointer< Object, Devices::Cuda > ThisType; template< typename... Args > explicit SharedPointer( Args... args ) : pd( nullptr ), cuda_pointer( nullptr ) { if( ! lazy ) this->allocate( args... ); } Loading @@ -324,9 +322,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( const SharedPointer< Object_, DeviceType, lazy_ >& pointer ) SharedPointer( const SharedPointer< Object_, DeviceType >& pointer ) : pd( (PointerData*) pointer.pd ), cuda_pointer( pointer.cuda_pointer ) { Loading @@ -343,9 +341,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( SharedPointer< Object_, DeviceType, lazy_ >&& pointer ) SharedPointer( SharedPointer< Object_, DeviceType >&& pointer ) : pd( (PointerData*) pointer.pd ), cuda_pointer( pointer.cuda_pointer ) { Loading Loading @@ -452,9 +450,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( const SharedPointer< Object_, DeviceType, lazy_ >& ptr ) const ThisType& operator=( const SharedPointer< Object_, DeviceType >& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -481,9 +479,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( SharedPointer< Object_, DeviceType, lazy_ >&& ptr ) const ThisType& operator=( SharedPointer< Object_, DeviceType >&& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading Loading @@ -521,6 +519,11 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer #endif } void clear() { this->free(); } ~SharedPointer() { this->free(); Loading Loading @@ -606,13 +609,12 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer Object* cuda_pointer; }; #ifdef HAVE_MIC /**** * Specialization for MIC */ template< typename Object, bool lazy > class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer template< typename Object> class SharedPointer< Object, Devices::MIC > : public SmartPointer { private: // Convenient template alias for controlling the selection of copy- and Loading @@ -624,21 +626,20 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >; // friend class will be needed for templated assignment operators template< typename Object_, typename Device_, bool lazy_ > template< typename Object_, typename Device_> friend class SharedPointer; public: typedef Object ObjectType; typedef Devices::MIC DeviceType; typedef SharedPointer< Object, Devices::MIC, lazy > ThisType; typedef SharedPointer< Object, Devices::MIC> ThisType; template< typename... Args > explicit SharedPointer( Args... args ) : pd( nullptr ), mic_pointer( nullptr ) { if( ! lazy ) this->allocate( args... ); } Loading @@ -651,9 +652,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( const SharedPointer< Object_, DeviceType, lazy_ >& pointer ) SharedPointer( const SharedPointer< Object_, DeviceType >& pointer ) : pd( (PointerData*) pointer.pd ), mic_pointer( pointer.mic_pointer ) { Loading @@ -670,9 +671,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( SharedPointer< Object_, DeviceType, lazy_ >&& pointer ) SharedPointer( SharedPointer< Object_, DeviceType >&& pointer ) : pd( (PointerData*) pointer.pd ), mic_pointer( pointer.mic_pointer ) { Loading Loading @@ -779,9 +780,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( const SharedPointer< Object_, DeviceType, lazy_ >& ptr ) const ThisType& operator=( const SharedPointer< Object_, DeviceType >& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -808,9 +809,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( SharedPointer< Object_, DeviceType, lazy_ >&& ptr ) const ThisType& operator=( SharedPointer< Object_, DeviceType >&& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading Loading @@ -843,6 +844,11 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer return false; //?? } void clear() { this->free(); } ~SharedPointer() { this->free(); Loading src/TNL/Solvers/Linear/BICGStab.h +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ class BICGStab : public Object, typedef typename Matrix::DeviceType DeviceType; typedef Matrix MatrixType; typedef Preconditioner PreconditionerType; typedef SharedPointer< const MatrixType, DeviceType, true > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType, true > PreconditionerPointer; typedef SharedPointer< const MatrixType, DeviceType > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType > PreconditionerPointer; BICGStab(); Loading src/TNL/Solvers/Linear/BICGStab_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -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, Loading src/TNL/Solvers/Linear/CG.h +2 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ class CG : public Object, typedef typename Matrix::DeviceType DeviceType; typedef Matrix MatrixType; typedef Preconditioner PreconditionerType; typedef SharedPointer< const MatrixType, DeviceType, true > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType, true > PreconditionerPointer; typedef SharedPointer< const MatrixType, DeviceType > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType > PreconditionerPointer; CG(); Loading src/TNL/Solvers/Linear/CG_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -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, Loading Loading
src/TNL/SharedPointer.h +54 −48 Original line number Diff line number Diff line Loading @@ -49,13 +49,8 @@ namespace TNL { /*** * Use the lazy mode if you do not want to call the object constructor in the * shared pointer constructor. You may call it later via the method recreate. */ template< typename Object, typename Device = typename Object::DeviceType, bool lazy = false > typename Device = typename Object::DeviceType > class SharedPointer { static_assert( ! std::is_same< Device, void >::value, "The device cannot be void. You need to specify the device explicitly in your code." ); Loading @@ -64,8 +59,8 @@ class SharedPointer /**** * Specialization for Devices::Host */ template< typename Object, bool lazy > class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer template< typename Object > class SharedPointer< Object, Devices::Host > : public SmartPointer { private: // Convenient template alias for controlling the selection of copy- and Loading @@ -77,14 +72,14 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >; // friend class will be needed for templated assignment operators template< typename Object_, typename Device_, bool lazy_ > template< typename Object_, typename Device_ > friend class SharedPointer; public: typedef Object ObjectType; typedef Devices::Host DeviceType; typedef SharedPointer< Object, Devices::Host, lazy > ThisType; typedef SharedPointer< Object, Devices::Host > ThisType; template< typename... Args > explicit SharedPointer( Args... args ) Loading @@ -93,7 +88,6 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer #ifdef TNL_DEBUG_SHARED_POINTERS std::cerr << "Creating shared pointer to " << demangle(typeid(ObjectType).name()) << std::endl; #endif if( ! lazy ) this->allocate( args... ); } Loading @@ -105,9 +99,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( const SharedPointer< Object_, DeviceType, lazy_ >& pointer ) SharedPointer( const SharedPointer< Object_, DeviceType >& pointer ) : pd( (PointerData*) pointer.pd ) { this->pd->counter += 1; Loading @@ -121,9 +115,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( SharedPointer< Object_, DeviceType, lazy_ >&& pointer ) SharedPointer( SharedPointer< Object_, DeviceType >&& pointer ) : pd( (PointerData*) pointer.pd ) { pointer.pd = nullptr; Loading Loading @@ -203,9 +197,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( const SharedPointer< Object_, DeviceType, lazy_ >& ptr ) const ThisType& operator=( const SharedPointer< Object_, DeviceType >& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -223,9 +217,9 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( SharedPointer< Object_, DeviceType, lazy_ >&& ptr ) const ThisType& operator=( SharedPointer< Object_, DeviceType >&& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -238,6 +232,11 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer return true; } void clear() { this->free(); } ~SharedPointer() { this->free(); Loading Loading @@ -284,8 +283,8 @@ class SharedPointer< Object, Devices::Host, lazy > : public SmartPointer /**** * Specialization for CUDA */ template< typename Object, bool lazy > class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer template< typename Object > class SharedPointer< Object, Devices::Cuda > : public SmartPointer { private: // Convenient template alias for controlling the selection of copy- and Loading @@ -297,21 +296,20 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >; // friend class will be needed for templated assignment operators template< typename Object_, typename Device_, bool lazy_ > template< typename Object_, typename Device_ > friend class SharedPointer; public: typedef Object ObjectType; typedef Devices::Cuda DeviceType; typedef SharedPointer< Object, Devices::Cuda, lazy > ThisType; typedef SharedPointer< Object, Devices::Cuda > ThisType; template< typename... Args > explicit SharedPointer( Args... args ) : pd( nullptr ), cuda_pointer( nullptr ) { if( ! lazy ) this->allocate( args... ); } Loading @@ -324,9 +322,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( const SharedPointer< Object_, DeviceType, lazy_ >& pointer ) SharedPointer( const SharedPointer< Object_, DeviceType >& pointer ) : pd( (PointerData*) pointer.pd ), cuda_pointer( pointer.cuda_pointer ) { Loading @@ -343,9 +341,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( SharedPointer< Object_, DeviceType, lazy_ >&& pointer ) SharedPointer( SharedPointer< Object_, DeviceType >&& pointer ) : pd( (PointerData*) pointer.pd ), cuda_pointer( pointer.cuda_pointer ) { Loading Loading @@ -452,9 +450,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( const SharedPointer< Object_, DeviceType, lazy_ >& ptr ) const ThisType& operator=( const SharedPointer< Object_, DeviceType >& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -481,9 +479,9 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( SharedPointer< Object_, DeviceType, lazy_ >&& ptr ) const ThisType& operator=( SharedPointer< Object_, DeviceType >&& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading Loading @@ -521,6 +519,11 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer #endif } void clear() { this->free(); } ~SharedPointer() { this->free(); Loading Loading @@ -606,13 +609,12 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer Object* cuda_pointer; }; #ifdef HAVE_MIC /**** * Specialization for MIC */ template< typename Object, bool lazy > class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer template< typename Object> class SharedPointer< Object, Devices::MIC > : public SmartPointer { private: // Convenient template alias for controlling the selection of copy- and Loading @@ -624,21 +626,20 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer std::is_same< typename std::remove_cv< Object >::type, Object_ >::value >; // friend class will be needed for templated assignment operators template< typename Object_, typename Device_, bool lazy_ > template< typename Object_, typename Device_> friend class SharedPointer; public: typedef Object ObjectType; typedef Devices::MIC DeviceType; typedef SharedPointer< Object, Devices::MIC, lazy > ThisType; typedef SharedPointer< Object, Devices::MIC> ThisType; template< typename... Args > explicit SharedPointer( Args... args ) : pd( nullptr ), mic_pointer( nullptr ) { if( ! lazy ) this->allocate( args... ); } Loading @@ -651,9 +652,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( const SharedPointer< Object_, DeviceType, lazy_ >& pointer ) SharedPointer( const SharedPointer< Object_, DeviceType >& pointer ) : pd( (PointerData*) pointer.pd ), mic_pointer( pointer.mic_pointer ) { Loading @@ -670,9 +671,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional constructor for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > SharedPointer( SharedPointer< Object_, DeviceType, lazy_ >&& pointer ) SharedPointer( SharedPointer< Object_, DeviceType >&& pointer ) : pd( (PointerData*) pointer.pd ), mic_pointer( pointer.mic_pointer ) { Loading Loading @@ -779,9 +780,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( const SharedPointer< Object_, DeviceType, lazy_ >& ptr ) const ThisType& operator=( const SharedPointer< Object_, DeviceType >& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading @@ -808,9 +809,9 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer } // conditional operator for non-const -> const data template< typename Object_, bool lazy_, template< typename Object_, typename = typename Enabler< Object_ >::type > const ThisType& operator=( SharedPointer< Object_, DeviceType, lazy_ >&& ptr ) const ThisType& operator=( SharedPointer< Object_, DeviceType >&& ptr ) { this->free(); this->pd = (PointerData*) ptr.pd; Loading Loading @@ -843,6 +844,11 @@ class SharedPointer< Object, Devices::MIC, lazy > : public SmartPointer return false; //?? } void clear() { this->free(); } ~SharedPointer() { this->free(); Loading
src/TNL/Solvers/Linear/BICGStab.h +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ class BICGStab : public Object, typedef typename Matrix::DeviceType DeviceType; typedef Matrix MatrixType; typedef Preconditioner PreconditionerType; typedef SharedPointer< const MatrixType, DeviceType, true > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType, true > PreconditionerPointer; typedef SharedPointer< const MatrixType, DeviceType > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType > PreconditionerPointer; BICGStab(); Loading
src/TNL/Solvers/Linear/BICGStab_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -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, Loading
src/TNL/Solvers/Linear/CG.h +2 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,8 @@ class CG : public Object, typedef typename Matrix::DeviceType DeviceType; typedef Matrix MatrixType; typedef Preconditioner PreconditionerType; typedef SharedPointer< const MatrixType, DeviceType, true > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType, true > PreconditionerPointer; typedef SharedPointer< const MatrixType, DeviceType > MatrixPointer; typedef SharedPointer< const PreconditionerType, DeviceType > PreconditionerPointer; CG(); Loading
src/TNL/Solvers/Linear/CG_impl.h +5 −0 Original line number Diff line number Diff line Loading @@ -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, Loading