Skip to content
Snippets Groups Projects
Commit 329b919b authored by Markus Blatt's avatar Markus Blatt
Browse files

Fixed flyspray bug:

parent 6fd7e617
No related branches found
No related tags found
No related merge requests found
...@@ -745,7 +745,7 @@ namespace Dune { ...@@ -745,7 +745,7 @@ namespace Dune {
#ifdef DUNE_ISTL_WITH_CHECKING #ifdef DUNE_ISTL_WITH_CHECKING
if (!includesindexset(y)) DUNE_THROW(ISTLError,"index set mismatch"); if (!includesindexset(y)) DUNE_THROW(ISTLError,"index set mismatch");
#endif #endif
for (size_type i=0; i<this->n; ++i) (this->p)[i] += y[(this->j)[i]]; for (size_type i=0; i<y.n; ++i) this->operator[](y.j[i]) += y.p[i];
return *this; return *this;
} }
...@@ -756,7 +756,7 @@ namespace Dune { ...@@ -756,7 +756,7 @@ namespace Dune {
#ifdef DUNE_ISTL_WITH_CHECKING #ifdef DUNE_ISTL_WITH_CHECKING
if (!includesindexset(y)) DUNE_THROW(ISTLError,"index set mismatch"); if (!includesindexset(y)) DUNE_THROW(ISTLError,"index set mismatch");
#endif #endif
for (size_type i=0; i<this->n; ++i) (this->p)[i] -= y[(this->j)[i]]; for (size_type i=0; i<y.n; ++i) this->operator[](y.j[i]) -= y.p[i];
return *this; return *this;
} }
...@@ -767,7 +767,7 @@ namespace Dune { ...@@ -767,7 +767,7 @@ namespace Dune {
#ifdef DUNE_ISTL_WITH_CHECKING #ifdef DUNE_ISTL_WITH_CHECKING
if (!includesindexset(y)) DUNE_THROW(ISTLError,"index set mismatch"); if (!includesindexset(y)) DUNE_THROW(ISTLError,"index set mismatch");
#endif #endif
for (size_type i=0; i<this->n; ++i) (this->p)[i].axpy(a,y[(this->j)[i]]); for (size_type i=0; i<y.n; ++i) (this->operator[](y.j[i])).axpy(a,y.p[i]);
return *this; return *this;
} }
...@@ -792,7 +792,8 @@ namespace Dune { ...@@ -792,7 +792,8 @@ namespace Dune {
field_type operator* (const compressed_block_vector_unmanaged& y) const field_type operator* (const compressed_block_vector_unmanaged& y) const
{ {
#ifdef DUNE_ISTL_WITH_CHECKING #ifdef DUNE_ISTL_WITH_CHECKING
if (!includesindexset(y)) DUNE_THROW(ISTLError,"index set mismatch"); if (!includesindexset(y) || !y.includesindexset(*this) )
DUNE_THROW(ISTLError,"index set mismatch");
#endif #endif
field_type sum=0; field_type sum=0;
for (size_type i=0; i<this->n; ++i) for (size_type i=0; i<this->n; ++i)
...@@ -878,9 +879,9 @@ namespace Dune { ...@@ -878,9 +879,9 @@ namespace Dune {
template<class V> template<class V>
bool includesindexset (const V& y) bool includesindexset (const V& y)
{ {
typename V::ConstIterator e=y.end(); typename V::ConstIterator e=this->end();
for (size_type i=0; i<this->n; i++) for (size_type i=0; i<y.n; i++)
if (y.find((this->j)[i])==e) if (find(y.j[i])==e)
return false; return false;
return true; return true;
} }
......
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