Skip to content
Snippets Groups Projects
Commit 9ad664ba authored by Max Kahnt's avatar Max Kahnt
Browse files

Inject resize from SumOperator.

parent 126d0898
Branches
No related tags found
1 merge request!19Feature/resize in matrix vector
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#define SUMOPERATOR_HH #define SUMOPERATOR_HH
#include <cstddef> #include <cstddef>
#include <dune/matrix-vector/resize.hh>
/** \brief represents the sum of two linear operators /** \brief represents the sum of two linear operators
* *
...@@ -139,5 +140,14 @@ class SumOperator ...@@ -139,5 +140,14 @@ class SumOperator
const bool summands_allocated_internally_; const bool summands_allocated_internally_;
}; };
//! inject the resize from SumOperator to generic vector tools
namespace Dune { namespace MatrixVector {
template <class Vector, class SparseMatrix, class LowRankMatrix>
//! Resize vector from SumOperator. Note that we only consider the sparse part.
void resize(Vector& v, const SumOperator<SparseMatrix, LowRankMatrix>& sumOp) {
resize(v, sumOp.sparseMatrix());
}
}}
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment