Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Commits
c364793b
Commit
c364793b
authored
15 years ago
by
Oliver Sander
Committed by
sander@PCPOOL.MI.FU-BERLIN.DE
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
activate the solve()-method and make it compile
[[Imported from SVN: r5535]]
parent
1f35de3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/targetspacertrsolver.cc
+14
-17
14 additions, 17 deletions
src/targetspacertrsolver.cc
with
14 additions
and
17 deletions
src/targetspacertrsolver.cc
+
14
−
17
View file @
c364793b
...
...
@@ -50,12 +50,8 @@ setup(const AverageDistanceAssembler<TargetSpace>* assembler,
template
<
class
TargetSpace
>
void
TargetSpaceRiemannianTRSolver
<
TargetSpace
>::
solve
()
{
#if 0
MaxNormTrustRegion<blocksize> trustRegion(x_.size(), initialTrustRegionRadius_);
std::vector<std::vector<BoxConstraint<field_type,blocksize> > > trustRegionObstacles((mgStep)
? mgStep->numLevels_
: 0);
MaxNormTrustRegion
<
blocksize
>
trustRegion
(
1
,
// we have only one block
initialTrustRegionRadius_
);
// /////////////////////////////////////////////////////
// Trust-Region Solver
...
...
@@ -71,11 +67,13 @@ void TargetSpaceRiemannianTRSolver<TargetSpace>::solve()
}
CorrectionType
rhs
;
CorrectionType corr(
x_.size());
CorrectionType
corr
(
1
);
// length is 1 _block_
corr
=
0
;
assembler_->assembleGradient(x_, rhs);
assembler_->assembleMatrix(x_, hesseMatrix);
MatrixType
hesseMatrix
;
assembler_
->
assembleGradient
(
x_
,
rhs
[
0
]);
assembler_
->
assembleMatrix
(
x_
,
hesseMatrix
[
0
][
0
]);
//gradientFDCheck(x_, rhs, *rodAssembler_);
//hessianFDCheck(x_, *hessianMatrix_, *rodAssembler_);
...
...
@@ -83,10 +81,9 @@ void TargetSpaceRiemannianTRSolver<TargetSpace>::solve()
// The right hand side is the _negative_ gradient
rhs
*=
-
1
;
mgStep
->setProblem(
*
hess
ian
Matrix
_
, corr, rhs
, grid_->maxLevel()+1
);
dynamic_cast
<
LinearIterationStep
<
MatrixType
,
CorrectionType
>*>
(
innerSolver_
->
iterationStep_
)
->
setProblem
(
hess
e
Matrix
,
corr
,
rhs
);
trustRegionObstacles.back() = trustRegion.obstacles();
mgStep->obstacles_ = &trustRegionObstacles;
dynamic_cast
<
TrustRegionGSStep
<
MatrixType
,
CorrectionType
>*>
(
innerSolver_
->
iterationStep_
)
->
obstacles_
=
&
trustRegion
.
obstacles
();
innerSolver_
->
preprocess
();
...
...
@@ -96,7 +93,7 @@ void TargetSpaceRiemannianTRSolver<TargetSpace>::solve()
innerSolver_
->
solve
();
corr =
mg
Step->getSol();
corr
=
innerSolver_
->
iteration
Step
_
->
getSol
();
//std::cout << "Correction: " << std::endl << corr << std::endl;
...
...
@@ -118,7 +115,7 @@ void TargetSpaceRiemannianTRSolver<TargetSpace>::solve()
// ////////////////////////////////////////////////////
TargetSpace
newIterate
=
x_
;
newIterate = TargetSpace::exp(newIterate, corr);
newIterate
=
TargetSpace
::
exp
(
newIterate
,
corr
[
0
]
);
/** \todo Don't always recompute oldEnergy */
double
oldEnergy
=
assembler_
->
value
(
x_
);
...
...
@@ -129,10 +126,10 @@ void TargetSpaceRiemannianTRSolver<TargetSpace>::solve()
// Note that rhs = -g
CorrectionType
tmp
(
corr
.
size
());
tmp
=
0
;
hess
ian
Matrix
_->
umv(corr, tmp);
hess
e
Matrix
.
umv
(
corr
,
tmp
);
double
modelDecrease
=
(
rhs
*
corr
)
-
0.5
*
(
corr
*
tmp
);
if (
/*
this->verbosity_ == NumProc::FULL
*/
) {
if
(
this
->
verbosity_
==
NumProc
::
FULL
)
{
std
::
cout
<<
"Absolute model decrease: "
<<
modelDecrease
<<
", functional decrease: "
<<
oldEnergy
-
energy
<<
std
::
endl
;
std
::
cout
<<
"Relative model decrease: "
<<
modelDecrease
/
energy
...
...
@@ -184,5 +181,5 @@ void TargetSpaceRiemannianTRSolver<TargetSpace>::solve()
std
::
cout
<<
"--- Current energy: "
<<
energy
<<
" ---"
<<
std
::
endl
;
}
#endif
}
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