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
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
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
agnumpde
dune-tectonic
Commits
7418ec6c
Commit
7418ec6c
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make phi visible to the outside
parent
2b2fd146
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/samplefunctional.hh
+8
-9
8 additions, 9 deletions
src/samplefunctional.hh
with
8 additions
and
9 deletions
src/samplefunctional.hh
+
8
−
9
View file @
7418ec6c
...
@@ -26,10 +26,10 @@ class SampleFunctional {
...
@@ -26,10 +26,10 @@ class SampleFunctional {
double
operator
()(
const
SmallVector
v
)
const
{
double
operator
()(
const
SmallVector
v
)
const
{
SmallVector
y
;
SmallVector
y
;
A
.
mv
(
v
,
y
);
// y = Av
A
.
mv
(
v
,
y
);
// y = Av
y
/=
2
;
// y = 1/2 Av
y
/=
2
;
// y = 1/2 Av
y
-=
b
;
// y = 1/2 Av - b
y
-=
b
;
// y = 1/2 Av - b
return
y
*
v
+
phi
_
(
v
);
// <1/2 Av - b,v> + H(|v|)
return
y
*
v
+
phi
(
v
);
// <1/2 Av - b,v> + H(|v|)
}
}
void
descentDirection
(
const
SmallVector
x
,
SmallVector
&
ret
)
const
{
void
descentDirection
(
const
SmallVector
x
,
SmallVector
&
ret
)
const
{
...
@@ -38,7 +38,7 @@ class SampleFunctional {
...
@@ -38,7 +38,7 @@ class SampleFunctional {
SmallVector
const
d
=
smoothGradient
(
x
);
SmallVector
const
d
=
smoothGradient
(
x
);
Interval
<
double
>
D
;
Interval
<
double
>
D
;
phi
_
.
directionalSubDiff
(
x
,
d
,
D
);
phi
.
directionalSubDiff
(
x
,
d
,
D
);
double
const
nonlinearDecline
=
D
[
1
];
double
const
nonlinearDecline
=
D
[
1
];
double
const
smoothDecline
=
-
(
d
*
d
);
double
const
smoothDecline
=
-
(
d
*
d
);
double
const
combinedDecline
=
smoothDecline
+
nonlinearDecline
;
double
const
combinedDecline
=
smoothDecline
+
nonlinearDecline
;
...
@@ -82,10 +82,9 @@ class SampleFunctional {
...
@@ -82,10 +82,9 @@ class SampleFunctional {
SmallMatrix
A
;
SmallMatrix
A
;
SmallVector
b
;
SmallVector
b
;
NonlinearityType
phi
;
private
:
private
:
NonlinearityType
phi_
;
// Gradient of the smooth part
// Gradient of the smooth part
SmallVector
smoothGradient
(
const
SmallVector
x
)
const
{
SmallVector
smoothGradient
(
const
SmallVector
x
)
const
{
SmallVector
y
;
SmallVector
y
;
...
@@ -96,14 +95,14 @@ class SampleFunctional {
...
@@ -96,14 +95,14 @@ class SampleFunctional {
SmallVector
upperGradient
(
const
SmallVector
x
)
const
{
SmallVector
upperGradient
(
const
SmallVector
x
)
const
{
SmallVector
y
;
SmallVector
y
;
phi
_
.
upperGradient
(
x
,
y
);
phi
.
upperGradient
(
x
,
y
);
y
+=
smoothGradient
(
x
);
y
+=
smoothGradient
(
x
);
return
y
;
return
y
;
}
}
SmallVector
lowerGradient
(
const
SmallVector
x
)
const
{
SmallVector
lowerGradient
(
const
SmallVector
x
)
const
{
SmallVector
y
;
SmallVector
y
;
phi
_
.
lowerGradient
(
x
,
y
);
phi
.
lowerGradient
(
x
,
y
);
y
+=
smoothGradient
(
x
);
y
+=
smoothGradient
(
x
);
return
y
;
return
y
;
}
}
...
...
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