Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
agnumpde
dune-solvers
Commits
57e522d0
Commit
57e522d0
authored
11 years ago
by
Elias Pipping
Committed by
pipping
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add trailing underscore to member
[[Imported from SVN: r12926]]
parent
fc9eaa42
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/solvers/iterationsteps/cgstep.cc
+4
-4
4 additions, 4 deletions
dune/solvers/iterationsteps/cgstep.cc
dune/solvers/iterationsteps/cgstep.hh
+1
-1
1 addition, 1 deletion
dune/solvers/iterationsteps/cgstep.hh
with
5 additions
and
5 deletions
dune/solvers/iterationsteps/cgstep.cc
+
4
−
4
View file @
57e522d0
...
@@ -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
;
}
}
This diff is collapsed.
Click to expand it.
dune/solvers/iterationsteps/cgstep.hh
+
1
−
1
View file @
57e522d0
...
@@ -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_
;
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment