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

Remove BCRS workaround.

parent 0dc4c586
Branches
No related tags found
1 merge request!3Feature/multitype arithmetic
......@@ -365,56 +365,6 @@ namespace MatrixVector {
}
};
template <class ABlock, class ScalarB, class CBlock>
struct ProductHelper<Dune::BCRSMatrix<ABlock>, ScalarB,
Dune::BCRSMatrix<CBlock>, false, true, false> {
typedef Dune::BCRSMatrix<ABlock> A;
typedef ScalarB B;
typedef Dune::BCRSMatrix<CBlock> C;
static void addProduct(A& a, const B& b, const C& c) {
// Workaround for the fact that Dune::BCRSMatrix assumes
// its blocks to have an axpy() implementation, yet
// Dune::DiagonalMatrix does not.
// a.axpy(b, c);
for (typename C::ConstIterator i = c.begin(); i != c.end(); ++i) {
const size_t iindex = i.index();
for (typename C::row_type::ConstIterator j = i->begin(); j != i->end();
++j)
ProductHelper<typename A::block_type, B, typename C::block_type,
false, true, false>::addProduct(a[iindex][j.index()], b,
*j);
}
}
};
template <class ABlock, class Scalar, class ScalarB, class CBlock>
struct ScaledProductHelper<Dune::BCRSMatrix<ABlock>, Scalar, ScalarB,
Dune::BCRSMatrix<CBlock>, false, true, false> {
typedef Dune::BCRSMatrix<ABlock> A;
typedef ScalarB B;
typedef Dune::BCRSMatrix<CBlock> C;
static void addProduct(A& a, const Scalar& scalar, const B& b, const C& c) {
// Workaround for the fact that Dune::BCRSMatrix assumes
// its blocks to have an axpy() implementation, yet
// Dune::DiagonalMatrix does not.
// a.axpy(scalar*b, c);
for (typename C::ConstIterator i = c.begin(); i != c.end(); ++i) {
const size_t iindex = i.index();
for (typename C::row_type::ConstIterator j = i->begin(); j != i->end();
++j)
ProductHelper<typename A::block_type, B, typename C::block_type,
false, true, false>::addProduct(a[iindex][j.index()],
scalar * b, *j);
}
}
};
template <class T, int n, class ScalarB>
struct ProductHelper<Dune::ScaledIdentityMatrix<T, n>, ScalarB,
Dune::ScaledIdentityMatrix<T, n>, false, true, false> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment