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
Tobias Leibner
dune-common
Commits
fab444d0
Commit
fab444d0
authored
6 years ago
by
Janick Gerstenberger
Browse files
Options
Downloads
Patches
Plain Diff
simplify tmp
parent
914836a4
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/math.hh
+10
-4
10 additions, 4 deletions
dune/common/math.hh
with
10 additions
and
4 deletions
dune/common/math.hh
+
10
−
4
View file @
fab444d0
...
...
@@ -103,10 +103,9 @@ namespace Dune
//! calculate the binomial coefficient n over k as a constexpr
// T and U have to be the same integral type
template
<
class
T
,
class
U
,
std
::
enable_if_t
<
std
::
is_same
<
T
,
U
>
::
value
,
int
>
=
0
>
constexpr
inline
static
T
binomial
(
const
T
&
n
,
const
U
&
k
)
noexcept
// T has to be an integral type
template
<
class
T
>
constexpr
inline
static
T
binomial
(
const
T
&
n
,
const
T
&
k
)
noexcept
{
static_assert
(
std
::
numeric_limits
<
T
>::
is_integer
,
"`binomial(n, k)` has to be called with an integer type."
);
...
...
@@ -129,6 +128,13 @@ namespace Dune
return
std
::
integral_constant
<
T
,
binomial
(
n
,
k
)
>
{};
}
template
<
class
T
,
T
n
>
constexpr
inline
static
auto
binomial
(
std
::
integral_constant
<
T
,
n
>
,
std
::
integral_constant
<
T
,
n
>
)
noexcept
{
return
std
::
integral_constant
<
T
,
(
n
>=
0
?
1
:
0
)
>
{};
}
//! compute conjugate complex of x
// conjugate complex does nothing for non-complex types
template
<
class
K
>
...
...
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