Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
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
Timo Koch
dune-common
Commits
b6ddd1cb
Commit
b6ddd1cb
authored
10 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
[test] use different epsilon for int and float types
This avoids compiler warning about implicitly rounded to zero
parent
033d0919
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/test/fvectortest.cc
+13
-1
13 additions, 1 deletion
dune/common/test/fvectortest.cc
with
13 additions
and
1 deletion
dune/common/test/fvectortest.cc
+
13
−
1
View file @
b6ddd1cb
...
...
@@ -210,13 +210,25 @@ struct ScalarOrderingTest
}
};
template
<
typename
T
>
struct
Epsilon
{
static
T
value
()
{
return
T
(
1e-6
);
}
};
template
<
>
struct
Epsilon
<
int
>
{
static
int
value
()
{
return
0
;
}
};
// scalar ordering doesn't work for complex numbers
template
<
class
rt
,
int
d
>
struct
DotProductTest
{
DotProductTest
()
{
typedef
std
::
complex
<
rt
>
ct
;
const
rt
myEps
(
1e-6
);
const
rt
myEps
=
Epsilon
<
rt
>::
value
(
);
static_assert
(
(
Dune
::
is_same
<
typename
Dune
::
FieldTraits
<
rt
>::
real_type
,
rt
>::
value
),
...
...
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