diff --git a/NumLib/DOF/MatrixProviderUser.h b/NumLib/DOF/MatrixProviderUser.h index 440e3692facc1a7240fa4681951c8a48767c5f24..8a690ae8010349061623d67b9a5e047f0f8246dc 100644 --- a/NumLib/DOF/MatrixProviderUser.h +++ b/NumLib/DOF/MatrixProviderUser.h @@ -86,21 +86,9 @@ public: class MatrixProvider { public: - //! Get an uninitialized matrix. - virtual GlobalMatrix& getMatrix() = 0; - //! Get an uninitialized matrix with the given \c id. virtual GlobalMatrix& getMatrix(std::size_t& id) = 0; - //! Get a copy of \c A. - virtual GlobalMatrix& getMatrix(GlobalMatrix const& A) = 0; - - //! Get a copy of \c A in the storage of the matrix with the given \c id. - virtual GlobalMatrix& getMatrix(GlobalMatrix const& A, std::size_t& id) = 0; - - //! Get a matrix according to the given specifications. - virtual GlobalMatrix& getMatrix(MathLib::MatrixSpecifications const& ms) = 0; - //! Get a matrix according to the given specifications in the storage //! of the matrix with the given \c id. virtual GlobalMatrix& getMatrix(MathLib::MatrixSpecifications const& ms, std::size_t& id) = 0; diff --git a/NumLib/DOF/SimpleMatrixVectorProvider.cpp b/NumLib/DOF/SimpleMatrixVectorProvider.cpp index 00712b7a68017285268193ce7b7291eade248433..f1e43efeef1eb0de590b5398a0acd97501bc63e9 100644 --- a/NumLib/DOF/SimpleMatrixVectorProvider.cpp +++ b/NumLib/DOF/SimpleMatrixVectorProvider.cpp @@ -45,25 +45,11 @@ std::pair<GlobalMatrix*, bool> SimpleMatrixVectorProvider::getMatrix_( id, _unused_matrices, _used_matrices, std::forward<Args>(args)...); } -GlobalMatrix& SimpleMatrixVectorProvider::getMatrix() -{ - std::size_t id = 0u; - return *getMatrix_<false>(id).first; -} - GlobalMatrix& SimpleMatrixVectorProvider::getMatrix(std::size_t& id) { return *getMatrix_<true>(id).first; } -GlobalMatrix& SimpleMatrixVectorProvider::getMatrix( - MathLib::MatrixSpecifications const& ms) -{ - std::size_t id = 0u; - return *getMatrix_<false>(id, ms).first; - // TODO assert that the returned object always is of the right size -} - GlobalMatrix& SimpleMatrixVectorProvider::getMatrix( MathLib::MatrixSpecifications const& ms, std::size_t& id) { @@ -71,28 +57,6 @@ GlobalMatrix& SimpleMatrixVectorProvider::getMatrix( // TODO assert that the returned object always is of the right size } -GlobalMatrix& SimpleMatrixVectorProvider::getMatrix(GlobalMatrix const& A) -{ - std::size_t id = 0u; - auto const& res = getMatrix_<false>(id, A); - if (!res.second) - { // no new object has been created - LinAlg::copy(A, *res.first); - } - return *res.first; -} - -GlobalMatrix& SimpleMatrixVectorProvider::getMatrix(GlobalMatrix const& A, - std::size_t& id) -{ - auto const& res = getMatrix_<true>(id, A); - if (!res.second) - { // no new object has been created - LinAlg::copy(A, *res.first); - } - return *res.first; -} - void SimpleMatrixVectorProvider::releaseMatrix(GlobalMatrix const& A) { auto it = _used_matrices.find(const_cast<GlobalMatrix*>(&A)); diff --git a/NumLib/DOF/SimpleMatrixVectorProvider.h b/NumLib/DOF/SimpleMatrixVectorProvider.h index 328333bae61a055656aafc0b5002cb81ba1a5e1d..2bc5398ccf52f17873451cee2a6192c5ed361eae 100644 --- a/NumLib/DOF/SimpleMatrixVectorProvider.h +++ b/NumLib/DOF/SimpleMatrixVectorProvider.h @@ -46,13 +46,8 @@ public: void releaseVector(GlobalVector const& x) override; - GlobalMatrix& getMatrix() override; GlobalMatrix& getMatrix(std::size_t& id) override; - GlobalMatrix& getMatrix(GlobalMatrix const& A) override; - GlobalMatrix& getMatrix(GlobalMatrix const& A, std::size_t& id) override; - - GlobalMatrix& getMatrix(MathLib::MatrixSpecifications const& ms) override; GlobalMatrix& getMatrix(MathLib::MatrixSpecifications const& ms, std::size_t& id) override; void releaseMatrix(GlobalMatrix const& A) override; @@ -84,6 +79,4 @@ private: std::map<GlobalVector*, std::size_t> _used_vectors; }; - - } // namespace NumLib