Skip to content
Snippets Groups Projects
Commit d589b66b authored by Oliver Sander's avatar Oliver Sander
Browse files

Remove trailing whitespace

parent c101608a
No related branches found
No related tags found
No related merge requests found
......@@ -14,21 +14,21 @@ class H1SemiNorm : public Norm<VectorType>
{
public:
H1SemiNorm() : matrix_(NULL) {}
H1SemiNorm(const Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >& matrix)
H1SemiNorm(const Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >& matrix)
: matrix_(&matrix)
{}
//! Compute the norm of the difference of two vectors
double diff(const VectorType& u1, const VectorType& u2) const
double diff(const VectorType& u1, const VectorType& u2) const
{
double sum = 0;
for (size_t i=0; i<matrix_->N(); i++)
for (size_t i=0; i<matrix_->N(); i++)
{
typename Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >::row_type::const_iterator cIt = (*matrix_)[i].begin();
typename Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >::row_type::const_iterator cEndIt = (*matrix_)[i].end();
typename VectorType::block_type differ_i = u1[i] - u2[i];
for (; cIt!=cEndIt; ++cIt)
sum += differ_i * (u1[cIt.index()]-u2[cIt.index()]) * (*cIt);
......@@ -36,7 +36,7 @@ public:
return std::sqrt(sum);
}
//! Compute the norm of the given vector
double operator()(const VectorType& u) const
{
......@@ -45,22 +45,22 @@ public:
// we compute sqrt{uAu^t}. We have implemented this by hand because the matrix is
// always scalar but the vectors may not be
double sum = 0;
for (size_t i=0; i<matrix_->N(); i++) {
typename Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >::row_type::const_iterator cIt = (*matrix_)[i].begin();
typename Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >::row_type::const_iterator cEndIt = (*matrix_)[i].end();
for (; cIt!=cEndIt; ++cIt)
sum += u[i]*u[cIt.index()] * (*cIt);
}
return std::sqrt(sum);
}
const Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> >* matrix_;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment