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
c8a6cdb3
Commit
c8a6cdb3
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Drop obsolete qualifier
parent
7e290e29
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/nicefunction.hh
+10
-14
10 additions, 14 deletions
src/nicefunction.hh
with
10 additions
and
14 deletions
src/nicefunction.hh
+
10
−
14
View file @
c8a6cdb3
...
...
@@ -10,17 +10,17 @@
namespace
Dune
{
class
NiceFunction
:
public
VirtualFunction
<
double
,
double
>
{
public:
virtual
double
leftDifferential
(
const
double
s
)
const
=
0
;
virtual
double
rightDifferential
(
const
double
s
)
const
=
0
;
virtual
double
leftDifferential
(
double
s
)
const
=
0
;
virtual
double
rightDifferential
(
double
s
)
const
=
0
;
};
class
Identity
:
public
NiceFunction
{
public:
void
virtual
evaluate
(
const
double
&
x
,
double
&
y
)
const
{
y
=
x
;
}
double
virtual
leftDifferential
(
const
double
s
)
const
{
return
1
;
}
double
virtual
leftDifferential
(
double
s
)
const
{
return
1
;
}
double
virtual
rightDifferential
(
const
double
s
)
const
{
return
1
;
}
double
virtual
rightDifferential
(
double
s
)
const
{
return
1
;
}
};
class
SampleFunction
:
public
NiceFunction
{
...
...
@@ -29,13 +29,9 @@ class SampleFunction : public NiceFunction {
y
=
(
x
<
1
)
?
x
:
(
2
*
x
-
1
);
}
double
virtual
leftDifferential
(
const
double
s
)
const
{
return
(
s
<=
1
)
?
1
:
2
;
}
double
virtual
leftDifferential
(
double
s
)
const
{
return
(
s
<=
1
)
?
1
:
2
;
}
double
virtual
rightDifferential
(
const
double
s
)
const
{
return
(
s
<
1
)
?
1
:
2
;
}
double
virtual
rightDifferential
(
double
s
)
const
{
return
(
s
<
1
)
?
1
:
2
;
}
};
class
TrivialFunction
:
public
NiceFunction
{
...
...
@@ -56,7 +52,7 @@ class HorribleFunction : public NiceFunction {
y
=
sum
+
(
fl
+
1
)
*
(
x
-
fl
);
}
double
virtual
leftDifferential
(
const
double
x
)
const
{
double
virtual
leftDifferential
(
double
x
)
const
{
double
const
fl
=
floor
(
x
);
if
(
x
-
fl
<
1e-14
)
return
fl
;
...
...
@@ -64,7 +60,7 @@ class HorribleFunction : public NiceFunction {
return
fl
+
1
;
}
double
virtual
rightDifferential
(
const
double
x
)
const
{
double
virtual
rightDifferential
(
double
x
)
const
{
double
const
c
=
ceil
(
x
);
if
(
c
-
x
<
1e-14
)
return
c
+
1
;
...
...
@@ -85,7 +81,7 @@ class HorribleFunctionLogarithmic : public NiceFunction {
y
+=
log
(
fl
+
2
)
*
(
x
-
fl
);
}
double
virtual
leftDifferential
(
const
double
x
)
const
{
double
virtual
leftDifferential
(
double
x
)
const
{
double
const
fl
=
floor
(
x
);
if
(
x
-
fl
<
1e-14
)
return
log
(
fl
+
1
);
...
...
@@ -93,7 +89,7 @@ class HorribleFunctionLogarithmic : public NiceFunction {
return
log
(
fl
+
2
);
}
double
virtual
rightDifferential
(
const
double
x
)
const
{
double
virtual
rightDifferential
(
double
x
)
const
{
double
const
c
=
ceil
(
x
);
if
(
c
-
x
<
1e-14
)
return
log
(
c
+
2
);
...
...
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