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

Add trailing underscore to member

[[Imported from SVN: r12926]]
parent fc9eaa42
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ void CGStep<MatrixType, VectorType>::preprocess() ...@@ -17,7 +17,7 @@ void CGStep<MatrixType, VectorType>::preprocess()
} else } else
p_ = r_; p_ = r_;
r_squared_old = p_*r_; r_squared_old_ = p_*r_;
} }
template <class MatrixType, class VectorType> template <class MatrixType, class VectorType>
...@@ -26,7 +26,7 @@ void CGStep<MatrixType, VectorType>::iterate() ...@@ -26,7 +26,7 @@ void CGStep<MatrixType, VectorType>::iterate()
VectorType q(x_); VectorType q(x_);
matrix_.mv(p_, q); // q_0 = Ap_0 matrix_.mv(p_, q); // q_0 = Ap_0
const double alpha = r_squared_old / (p_ * q); // alpha_0 = r_0*r_0/p_0*Ap_0 const double alpha = r_squared_old_ / (p_ * q); // alpha_0 = r_0*r_0/p_0*Ap_0
x_.axpy(alpha, p_); // x_1 = x_0 + alpha_0 p_0 x_.axpy(alpha, p_); // x_1 = x_0 + alpha_0 p_0
r_.axpy(-alpha, q); // r_1 = r_0 - alpha_0 Ap_0 r_.axpy(-alpha, q); // r_1 = r_0 - alpha_0 Ap_0
...@@ -36,8 +36,8 @@ void CGStep<MatrixType, VectorType>::iterate() ...@@ -36,8 +36,8 @@ void CGStep<MatrixType, VectorType>::iterate()
q = r_; q = r_;
const double r_squared = q * r_; const double r_squared = q * r_;
const double beta = r_squared / r_squared_old; // beta_0 = r_1*r_1/ (r_0*r_0) const double beta = r_squared / r_squared_old_; // beta_0 = r_1*r_1/ (r_0*r_0)
p_ *= beta; // p_1 = r_1 + beta_0 p_0 p_ *= beta; // p_1 = r_1 + beta_0 p_0
p_ += q; p_ += q;
r_squared_old = r_squared; r_squared_old_ = r_squared;
} }
...@@ -38,7 +38,7 @@ namespace Dune { ...@@ -38,7 +38,7 @@ namespace Dune {
VectorType r_; // residual VectorType r_; // residual
VectorType& x_; VectorType& x_;
const MatrixType& matrix_; const MatrixType& matrix_;
double r_squared_old; double r_squared_old_;
Preconditioner<MatrixType, VectorType>* preconditioner_; Preconditioner<MatrixType, VectorType>* preconditioner_;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment