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

foo& bar -> foo &bar

parent 2f30c080
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { ...@@ -28,7 +28,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
/** \brief Solves one local system using a modified gradient method */ /** \brief Solves one local system using a modified gradient method */
class IterateObject; class IterateObject;
MyBlockProblem(MyConvexProblemType& problem) : problem(problem) { MyBlockProblem(MyConvexProblemType &problem) : problem(problem) {
bisection = Bisection(0.0, 1.0, 1e-12, true, 0); bisection = Bisection(0.0, 1.0, 1e-12, true, 0);
}; };
...@@ -37,7 +37,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { ...@@ -37,7 +37,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
private: private:
// problem data // problem data
MyConvexProblemType& problem; MyConvexProblemType &problem;
// commonly used minimization stuff // commonly used minimization stuff
Bisection bisection; Bisection bisection;
...@@ -53,18 +53,18 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -53,18 +53,18 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
* \param bisection The class used to do a scalar bisection * \param bisection The class used to do a scalar bisection
* \param problem The problem including quadratic part and nonlinear part * \param problem The problem including quadratic part and nonlinear part
*/ */
IterateObject(Bisection const& bisection, MyConvexProblemType& problem) IterateObject(Bisection const &bisection, MyConvexProblemType &problem)
: problem(problem), bisection(bisection) {} : problem(problem), bisection(bisection) {}
public: public:
/** \brief Set the current iterate */ /** \brief Set the current iterate */
void setIterate(VectorType& u) { void setIterate(VectorType &u) {
this->u = u; this->u = u;
return; return;
} }
/** \brief Update the i-th block of the current iterate */ /** \brief Update the i-th block of the current iterate */
void updateIterate(LocalVectorType const& ui, int i) { void updateIterate(LocalVectorType const &ui, int i) {
u[i] = ui; u[i] = ui;
return; return;
} }
...@@ -75,14 +75,14 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -75,14 +75,14 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
* \param ignore Set of degrees of freedom to leave untouched * \param ignore Set of degrees of freedom to leave untouched
*/ */
void solveLocalProblem( void solveLocalProblem(
LocalVectorType& ui, int m, LocalVectorType &ui, int m,
const typename Dune::BitSetVector<block_size>::const_reference ignore) { const typename Dune::BitSetVector<block_size>::const_reference ignore) {
{ {
// TODO: Does it make any sense to ignore single spatial dimensions here? // TODO: Does it make any sense to ignore single spatial dimensions here?
if (ignore.test(0)) if (ignore.test(0))
return; return;
LocalMatrixType const* localA = NULL; LocalMatrixType const *localA = NULL;
LocalVectorType localb(problem.f[m]); LocalVectorType localb(problem.f[m]);
typename MatrixType::row_type::ConstIterator it; typename MatrixType::row_type::ConstIterator it;
...@@ -108,7 +108,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -108,7 +108,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
private: private:
// problem data // problem data
MyConvexProblemType& problem; MyConvexProblemType &problem;
// commonly used minimization stuff // commonly used minimization stuff
Bisection bisection; Bisection bisection;
......
...@@ -22,7 +22,7 @@ class LinearFunction : public NiceFunction { ...@@ -22,7 +22,7 @@ class LinearFunction : public NiceFunction {
LinearFunction(double a) : coefficient(a) {} LinearFunction(double a) : coefficient(a) {}
void virtual evaluate(double const& x, double& y) const { void virtual evaluate(double const &x, double &y) const {
y = coefficient * x; y = coefficient * x;
} }
...@@ -36,7 +36,7 @@ class LinearFunction : public NiceFunction { ...@@ -36,7 +36,7 @@ class LinearFunction : public NiceFunction {
template <int slope> class SampleFunction : public NiceFunction { template <int slope> class SampleFunction : public NiceFunction {
public: public:
void virtual evaluate(double const& x, double& y) const { void virtual evaluate(double const &x, double &y) const {
y = (x < 1) ? x : (slope * (x - 1) + 1); y = (x < 1) ? x : (slope * (x - 1) + 1);
} }
...@@ -51,7 +51,7 @@ template <int slope> class SampleFunction : public NiceFunction { ...@@ -51,7 +51,7 @@ template <int slope> class SampleFunction : public NiceFunction {
class SteepFunction : public NiceFunction { class SteepFunction : public NiceFunction {
public: public:
void virtual evaluate(double const& x, double& y) const { y = 100 * x; } void virtual evaluate(double const &x, double &y) const { y = 100 * x; }
double virtual leftDifferential(double s) const { return 100; } double virtual leftDifferential(double s) const { return 100; }
...@@ -60,7 +60,7 @@ class SteepFunction : public NiceFunction { ...@@ -60,7 +60,7 @@ class SteepFunction : public NiceFunction {
class TrivialFunction : public NiceFunction { class TrivialFunction : public NiceFunction {
public: public:
void virtual evaluate(double const& x, double& y) const { y = 0; } void virtual evaluate(double const &x, double &y) const { y = 0; }
double virtual leftDifferential(double) const { return 0; } double virtual leftDifferential(double) const { return 0; }
...@@ -70,7 +70,7 @@ class TrivialFunction : public NiceFunction { ...@@ -70,7 +70,7 @@ class TrivialFunction : public NiceFunction {
// slope in [n-1,n] is n // slope in [n-1,n] is n
class HorribleFunction : public NiceFunction { class HorribleFunction : public NiceFunction {
public: public:
void virtual evaluate(double const& x, double& y) const { void virtual evaluate(double const &x, double &y) const {
double const fl = floor(x); double const fl = floor(x);
double const sum = fl * (fl + 1) / 2; double const sum = fl * (fl + 1) / 2;
y = sum + (fl + 1) * (x - fl); y = sum + (fl + 1) * (x - fl);
...@@ -96,7 +96,7 @@ class HorribleFunction : public NiceFunction { ...@@ -96,7 +96,7 @@ class HorribleFunction : public NiceFunction {
// slope in [n-1,n] is log(n+1) // slope in [n-1,n] is log(n+1)
class HorribleFunctionLogarithmic : public NiceFunction { class HorribleFunctionLogarithmic : public NiceFunction {
public: public:
void virtual evaluate(double const& x, double& y) const { void virtual evaluate(double const &x, double &y) const {
y = 0; y = 0;
size_t const fl = floor(x); size_t const fl = floor(x);
for (size_t i = 1; i <= fl;) for (size_t i = 1; i <= fl;)
......
...@@ -30,8 +30,8 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> { ...@@ -30,8 +30,8 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> {
* \param v A corresponding vector of coefficients. * \param v A corresponding vector of coefficients.
* \param s A name of the function. * \param s A name of the function.
*/ */
VTKBasisGridFunction(const Basis& basis, const CoefficientType& v, VTKBasisGridFunction(const Basis &basis, const CoefficientType &v,
const std::string& s) const std::string &s)
: basis_(basis), coeffs_(v), s_(s) { : basis_(basis), coeffs_(v), s_(s) {
if (v.size() != basis_.size()) if (v.size() != basis_.size())
DUNE_THROW( DUNE_THROW(
...@@ -48,10 +48,10 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> { ...@@ -48,10 +48,10 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> {
* \param e The element the local coordinates are taken from. * \param e The element the local coordinates are taken from.
* \param xi The local coordinates where to evaluate the function. * \param xi The local coordinates where to evaluate the function.
*/ */
virtual double evaluate(int comp, const Entity& e, virtual double evaluate(int comp, const Entity &e,
const Dune::FieldVector<ctype, dim>& xi) const { const Dune::FieldVector<ctype, dim> &xi) const {
// evaluate the local shapefunctions // evaluate the local shapefunctions
const typename Basis::LocalFiniteElement& localFE = const typename Basis::LocalFiniteElement &localFE =
basis_.getLocalFiniteElement(e); basis_.getLocalFiniteElement(e);
std::vector<RangeType> values(localFE.localBasis().size()); std::vector<RangeType> values(localFE.localBasis().size());
localFE.localBasis().evaluateFunction(xi, values); localFE.localBasis().evaluateFunction(xi, values);
...@@ -71,8 +71,8 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> { ...@@ -71,8 +71,8 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> {
virtual ~VTKBasisGridFunction() {} virtual ~VTKBasisGridFunction() {}
private: private:
const Basis& basis_; const Basis &basis_;
const CoefficientType& coeffs_; const CoefficientType &coeffs_;
std::string s_; std::string s_;
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment