Skip to content
Snippets Groups Projects
Commit 4d0ac064 authored by Elias Pipping's avatar Elias Pipping
Browse files

Cleanup

parent 91ebf908
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -3,25 +3,19 @@ ...@@ -3,25 +3,19 @@
#include <cassert> #include <cassert>
#include <dune/solvers/common/arithmetic.hh>
template<class MatrixType, class DiscFuncType, class BitVectorType> template<class MatrixType, class DiscFuncType, class BitVectorType>
inline inline
void BlockGSStep<MatrixType, DiscFuncType, BitVectorType>:: void BlockGSStep<MatrixType, DiscFuncType, BitVectorType>::
residual(int index, VectorBlock& r) const residual(int index, VectorBlock& r) const
{ {
const MatrixType& mat = *this->mat_;
const auto& row = mat[index];
r = (*this->rhs_)[index]; r = (*this->rhs_)[index];
/* The following loop subtracts const auto& row = (*this->mat_)[index];
* \f[ sum_i = \sum_j A_{ij}w_j \f] for (auto cIt = row.begin(); cIt!=row.end(); ++cIt) {
*/
auto cIt = row.begin();
auto cEndIt = row.end();
for (; cIt!=cEndIt; ++cIt) {
// r_i -= A_ij x_j // r_i -= A_ij x_j
cIt->mmv((*this->x_)[cIt.index()], r); Arithmetic::subtractProduct(r, *cIt, (*this->x_)[cIt.index()]);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment