Skip to content
Snippets Groups Projects
Commit 1cd1e6dd authored by Tom Fischer's avatar Tom Fischer
Browse files

[NL/DOF] MatrixProvider: Rm unused public methods.

parent 7b783c2a
No related branches found
No related tags found
1 merge request!3659Remove caching of GlobalMatrix and GlobalVector objects.
......@@ -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;
......
......@@ -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));
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment