Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
podlesny
dune-tectonic
Commits
e391a7b2
Commit
e391a7b2
authored
11 years ago
by
Elias Pipping
Committed by
Elias Pipping
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rename: descDir -> v
parent
a6f29d8a
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
dune/tectonic/minimisation.hh
+14
-14
14 additions, 14 deletions
dune/tectonic/minimisation.hh
with
14 additions
and
14 deletions
dune/tectonic/minimisation.hh
+
14
−
14
View file @
e391a7b2
...
...
@@ -14,7 +14,7 @@ namespace Dune {
template
<
class
Functional
>
void
descentMinimisation
(
Functional
const
&
J
,
typename
Functional
::
SmallVector
&
x
,
typename
Functional
::
SmallVector
const
&
descDir
,
typename
Functional
::
SmallVector
const
&
v
,
Bisection
const
&
bisection
)
{
using
SmallVector
=
typename
Functional
::
SmallVector
;
using
LocalNonlinearityType
=
typename
Functional
::
NonlinearityType
;
...
...
@@ -27,15 +27,15 @@ void descentMinimisation(Functional const &J,
since A is symmetric.
*/
SmallVector
tmp
=
J
.
b
;
// b
J
.
A
.
mmv
(
x
,
tmp
);
// b-Au
double
const
JRestb
=
tmp
*
descDir
;
// <b-Au,v>
SmallVector
tmp
=
J
.
b
;
// b
J
.
A
.
mmv
(
x
,
tmp
);
// b-Au
double
const
JRestb
=
tmp
*
v
;
// <b-Au,v>
J
.
A
.
mv
(
descDir
,
tmp
);
// Av
double
const
JRestA
=
tmp
*
descDir
;
// <Av,v>
J
.
A
.
mv
(
v
,
tmp
);
// Av
double
const
JRestA
=
tmp
*
v
;
// <Av,v>
MyDirectionalConvexFunction
<
LocalNonlinearityType
>
const
JRest
(
JRestA
,
JRestb
,
*
J
.
phi
,
x
,
descDir
);
MyDirectionalConvexFunction
<
LocalNonlinearityType
>
const
JRest
(
JRestA
,
JRestb
,
*
J
.
phi
,
x
,
v
);
// }}}
{
// Debug
...
...
@@ -66,7 +66,7 @@ void descentMinimisation(Functional const &J,
<<
std
::
endl
;
;
x
.
axpy
(
stepsize
,
descDir
);
x
.
axpy
(
stepsize
,
v
);
}
template
<
class
Functional
>
...
...
@@ -75,14 +75,14 @@ void minimise(Functional const &J, typename Functional::SmallVector &x,
using
SmallVector
=
typename
Functional
::
SmallVector
;
for
(
size_t
step
=
0
;
step
<
steps
;
++
step
)
{
SmallVector
descDir
;
J
.
gradient
(
x
,
descDir
);
descDir
*=
-
1
;
SmallVector
v
;
J
.
gradient
(
x
,
v
);
v
*=
-
1
;
if
(
descDir
.
two_norm
()
<
1e-14
)
// TODO: Make controllable
if
(
v
.
two_norm
()
<
1e-14
)
// TODO: Make controllable
return
;
descentMinimisation
(
J
,
x
,
descDir
,
bisection
);
descentMinimisation
(
J
,
x
,
v
,
bisection
);
}
}
}
...
...
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