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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
f9e07d7a
Commit
f9e07d7a
authored
Dec 3, 2011
by
Elias Pipping
Committed by
Elias Pipping
Dec 7, 2011
Browse files
Options
Downloads
Patches
Plain Diff
Fix up tests
parent
8a30a358
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test-gradient-method.cc
+44
-22
44 additions, 22 deletions
src/test-gradient-method.cc
with
44 additions
and
22 deletions
src/test-gradient-method.cc
+
44
−
22
View file @
f9e07d7a
...
...
@@ -35,8 +35,10 @@ void testIdentity() {
b
[
0
]
=
1
;
b
[
1
]
=
2
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
LinearFunction
(
1
));
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
LinearFunction
(
1
));
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
=
b
;
start
*=
17
;
...
...
@@ -70,8 +72,10 @@ void testSampleFunction() {
b
[
0
]
=
1
;
b
[
1
]
=
2
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
=
b
;
start
*=
17
;
...
...
@@ -119,8 +123,10 @@ void testSampleFunctionNonsmooth() {
b
[
0
]
=
1
;
b
[
1
]
=
2
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
;
Functional
::
SmallVector
error
;
...
...
@@ -181,8 +187,10 @@ void testTrivialFunction() {
b
[
0
]
=
1
;
b
[
1
]
=
2
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
TrivialFunction
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
TrivialFunction
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
=
b
;
start
*=
17
;
...
...
@@ -225,8 +233,10 @@ void testHorribleFunction() {
b
[
0
]
=
1
;
b
[
1
]
=
2
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
HorribleFunction
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
HorribleFunction
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
=
b
;
start
*=
17
;
...
...
@@ -260,9 +270,11 @@ void testHorribleFunctionLogarithmic() {
b
[
0
]
=
1
;
b
[
1
]
=
2
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
HorribleFunctionLogarithmic
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
=
b
;
start
*=
17
;
...
...
@@ -300,8 +312,10 @@ void testSampleFunction3D() {
b
[
1
]
=
2
;
b
[
2
]
=
3
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
=
b
;
start
*=
17
;
...
...
@@ -338,8 +352,10 @@ void testSampleFunction2() {
b
[
0
]
=
1
;
b
[
1
]
=
1
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
=
b
;
...
...
@@ -372,8 +388,10 @@ void testSampleFunctionSteep1() {
b
[
0
]
=
1
;
b
[
1
]
=
2
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
;
...
...
@@ -409,8 +427,10 @@ void testSampleFunctionSteep2() {
b
[
0
]
=
1
;
b
[
1
]
=
2.5
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
SampleFunction
<
2
>
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
;
...
...
@@ -446,8 +466,10 @@ void testSteepFunction() {
b
[
0
]
=
1
;
b
[
1
]
=
2.5
;
Dune
::
shared_ptr
<
Dune
::
NiceFunction
>
f
(
new
Dune
::
SampleFunction
<
100
>
());
Functional
J
(
A
,
b
,
Dune
::
LocalNonlinearity
<
dim
>
(
f
));
Dune
::
shared_ptr
<
Dune
::
NiceFunction
const
>
f
(
new
Dune
::
SampleFunction
<
100
>
());
Dune
::
shared_ptr
<
Functional
::
NonlinearityType
const
>
phi
(
new
Functional
::
NonlinearityType
(
f
));
Functional
J
(
A
,
b
,
phi
);
Functional
::
SmallVector
start
;
...
...
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