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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Core Modules
dune-common
Commits
94413ecd
Commit
94413ecd
authored
12 years ago
by
Martin Nolte
Browse files
Options
Downloads
Patches
Plain Diff
don't assign a double value to rt myEps (where rt might be int)
[[Imported from SVN: r6923]]
parent
b98a25d6
Branches
master
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/test/fvectortest.cc
+10
-3
10 additions, 3 deletions
dune/common/test/fvectortest.cc
with
10 additions
and
3 deletions
dune/common/test/fvectortest.cc
+
10
−
3
View file @
94413ecd
...
...
@@ -17,6 +17,13 @@
using
Dune
::
FieldVector
;
using
std
::
complex
;
template
<
class
rt
>
struct
Epsilon
;
template
<
>
struct
Epsilon
<
int
>
{
static
int
value
()
{
return
0
;
}
};
template
<
>
struct
Epsilon
<
float
>
{
static
float
value
()
{
return
1e-6
f
;
}
};
template
<
>
struct
Epsilon
<
double
>
{
static
double
value
()
{
return
1e-12
;
}
};
template
<
class
ft
,
class
rt
,
int
d
>
struct
FieldVectorMainTest
{
...
...
@@ -85,10 +92,10 @@ struct FieldVectorMainTest
// test istream operator
std
::
stringstream
s
;
for
(
int
i
=
0
;
i
<
d
;
i
++
)
for
(
int
i
=
0
;
i
<
d
;
++
i
)
{
s
<<
i
<<
" "
;
v
[
i
]
=
i
;
v
[
i
]
=
rt
(
i
)
;
}
s
>>
w
;
assert
(
v
==
w
);
...
...
@@ -209,7 +216,7 @@ struct DotProductTest
{
DotProductTest
()
{
typedef
std
::
complex
<
rt
>
ct
;
const
rt
myEps
(
1e-6
);
const
rt
myEps
=
Epsilon
<
rt
>::
value
(
);
dune_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