Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ag-ohlberger
dune-community
dune-xt
Commits
0d442a5a
Commit
0d442a5a
authored
12 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[fem] cleverer getMinMaxOfDiscreteFunction
parent
33432552
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/stuff/common/math.hh
+0
-2
0 additions, 2 deletions
dune/stuff/common/math.hh
dune/stuff/test/common_math.cc
+11
-3
11 additions, 3 deletions
dune/stuff/test/common_math.cc
with
11 additions
and
5 deletions
dune/stuff/common/math.hh
+
0
−
2
View file @
0d442a5a
...
@@ -194,8 +194,6 @@ protected:
...
@@ -194,8 +194,6 @@ protected:
typedef
boost
::
accumulators
::
stats
<
boost
::
accumulators
::
tag
::
max
,
boost
::
accumulators
::
tag
::
min
,
typedef
boost
::
accumulators
::
stats
<
boost
::
accumulators
::
tag
::
max
,
boost
::
accumulators
::
tag
::
min
,
boost
::
accumulators
::
tag
::
mean
>
StatsType
;
boost
::
accumulators
::
tag
::
mean
>
StatsType
;
boost
::
accumulators
::
accumulator_set
<
ElementType
,
StatsType
>
acc_
;
boost
::
accumulators
::
accumulator_set
<
ElementType
,
StatsType
>
acc_
;
MinMaxAvg
(
const
ThisType
&
other
);
};
};
//! bound \param var in [\param min,\param max]
//! bound \param var in [\param min,\param max]
...
...
This diff is collapsed.
Click to expand it.
dune/stuff/test/common_math.cc
+
11
−
3
View file @
0d442a5a
...
@@ -84,6 +84,14 @@ struct MinMaxAvgTest : public testing::Test
...
@@ -84,6 +84,14 @@ struct MinMaxAvgTest : public testing::Test
{
{
};
};
template
<
class
MMType
,
class
TypeParam
>
void
mmCheck
(
const
MMType
&
mma
)
{
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
min
(),
TypeParam
(
-
4.0
)));
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
max
(),
TypeParam
(
1.0
)));
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
average
(),
TypeParam
(
-
1.0
)));
}
TYPED_TEST_CASE
(
MinMaxAvgTest
,
TestTypes
);
TYPED_TEST_CASE
(
MinMaxAvgTest
,
TestTypes
);
TYPED_TEST
(
MinMaxAvgTest
,
All
)
TYPED_TEST
(
MinMaxAvgTest
,
All
)
{
{
...
@@ -98,9 +106,9 @@ TYPED_TEST(MinMaxAvgTest, All)
...
@@ -98,9 +106,9 @@ TYPED_TEST(MinMaxAvgTest, All)
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
max
(),
TypeParam
(
1.0
)));
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
max
(),
TypeParam
(
1.0
)));
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
average
(),
TypeParam
(
0.0
)));
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
average
(),
TypeParam
(
0.0
)));
mma
(
-
4
);
mma
(
-
4
);
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
min
()
,
TypeParam
(
-
4.0
))
);
mmCheck
<
MinMaxAvg
<
TypeParam
>
,
TypeParam
>
(
mma
);
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
max
(),
TypeParam
(
1.0
)))
;
mmb
=
mma
;
EXPECT_TRUE
(
Dune
::
FloatCmp
::
eq
(
mma
.
average
()
,
TypeParam
(
-
1.0
))
);
mmCheck
<
MinMaxAvg
<
TypeParam
>
,
TypeParam
>
(
mmb
);
}
}
TEST
(
OtherMath
,
Range
)
TEST
(
OtherMath
,
Range
)
...
...
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