Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
991acbfc
Commit
991acbfc
authored
Jul 27, 2020
by
Praetorius, Simon
Browse files
Merge branch 'issue/variadic_packs' into 'master'
variadic packs See merge request
amdis/amdis-core!189
parents
b85eda79
9b09a70f
Changes
5
Hide whitespace changes
Inline
Side-by-side
amdis/ProblemStatTraits.hpp
View file @
991acbfc
...
...
@@ -54,7 +54,7 @@ namespace AMDiS
// factory to construct a global basis of several lagrange bases, with flat indexing.
template
<
int
deg
,
int
...
degs
>
struct
LagrangePreBasisCreator
:
public
LagrangePreBasisCreatorImpl
<
all_of_v
<
(
deg
==
degs
)...
>
,
deg
,
degs
...
>
:
public
LagrangePreBasisCreatorImpl
<
(
(
deg
==
degs
)
&&
...
)
,
deg
,
degs
...
>
{};
...
...
amdis/common/Logical.hpp
View file @
991acbfc
...
...
@@ -25,39 +25,39 @@ namespace AMDiS
}
// end namespace Impl
template
<
bool
...
Bs
>
using
all_of_t
=
std
::
is_same
<
Impl
::
all_helper
<
true
,
Bs
...
>
,
Impl
::
all_helper
<
Bs
...,
true
>
>
;
using
all_of_t
=
bool_t
<
(
Bs
&&
...)
>
;
template
<
bool
...
Bs
>
constexpr
bool
all_of_v
=
all_of_t
<
Bs
...
>::
value
;
constexpr
bool
all_of_v
=
(
Bs
&&
...)
;
template
<
bool
...
Bs
>
using
and_t
=
all_of_t
<
Bs
...
>
;
template
<
bool
...
Bs
>
using
none_of_t
=
std
::
is_same
<
Impl
::
all_helper
<
false
,
Bs
...
>
,
Impl
::
all_helper
<
Bs
...,
false
>
>
;
using
none_of_t
=
bool_t
<!
(
Bs
||
...)
>
;
template
<
bool
...
Bs
>
constexpr
bool
none_of_v
=
none_of_t
<
Bs
...
>::
value
;
constexpr
bool
none_of_v
=
!
(
Bs
||
...)
;
template
<
bool
...
Bs
>
using
any_of_t
=
bool_t
<
not
none_of_t
<
Bs
...
>::
value
>
;
using
any_of_t
=
bool_t
<
(
Bs
||
...)
>
;
template
<
bool
...
Bs
>
constexpr
bool
any_of_v
=
any_of_t
<
Bs
...
>::
value
;
constexpr
bool
any_of_v
=
(
Bs
||
...)
;
template
<
bool
...
Bs
>
using
or_t
=
any_of_t
<
Bs
...
>
;
template
<
bool
...
Bs
>
constexpr
bool_t
<
and_t
<
Bs
...
>::
value
>
and_
=
{};
constexpr
all_of_t
<
Bs
...
>
and_
=
{};
template
<
bool
B0
,
bool
B1
>
constexpr
bool_t
<
B0
&&
B1
>
operator
&&
(
bool_t
<
B0
>
,
bool_t
<
B1
>
)
{
return
{};
}
template
<
bool
...
Bs
>
constexpr
bool_t
<
or_t
<
Bs
...
>::
value
>
or_
=
{};
constexpr
any_of_t
<
Bs
...
>
or_
=
{};
template
<
bool
B0
,
bool
B1
>
constexpr
bool_t
<
B0
||
B1
>
operator
||
(
bool_t
<
B0
>
,
bool_t
<
B1
>
)
{
return
{};
}
...
...
@@ -67,7 +67,7 @@ namespace AMDiS
using
not_t
=
bool_t
<!
B
>
;
template
<
bool
B
>
constexpr
bool_t
<
not_t
<
B
>::
value
>
not_
=
{};
constexpr
bool_t
<
!
B
>
not_
=
{};
template
<
bool
B
>
constexpr
bool_t
<!
B
>
operator
!
(
bool_t
<
B
>
)
{
return
{};
}
...
...
amdis/gridfunctions/FunctorGridFunction.hpp
View file @
991acbfc
...
...
@@ -156,11 +156,12 @@ namespace AMDiS
**/
template
<
class
Sig
,
class
F
,
class
...
LFs
,
REQUIRES
(
Concepts
::
HasFunctorOrder
<
F
,
sizeof
...(
LFs
)>
&&
all_of_v
<
Concepts
::
HasOrder
<
LFs
>
...
>
)
>
&&
(
Concepts
::
HasOrder
<
LFs
>
&&
...
)
)
>
int
order
(
FunctorLocalFunction
<
Sig
,
F
,
LFs
...
>
const
&
lf
)
{
return
Tools
::
apply
([
&
lf
](
auto
const
&
...
lgfs
)
{
return
order
(
lf
.
fct
(),
order
(
*
lgfs
)...);
},
lf
.
localFcts
());
return
Tools
::
apply
([
&
lf
](
auto
const
&
...
lgfs
)
{
return
order
(
lf
.
fct
(),
order
(
*
lgfs
)...);
},
lf
.
localFcts
());
}
...
...
@@ -239,7 +240,7 @@ namespace AMDiS
template
<
class
Functor
,
class
...
GridFcts
>
auto
makeFunctorGridFunction
(
Functor
const
&
f
,
GridFcts
const
&
...
gridFcts
)
{
static_assert
(
all_of_v
<
Concepts
::
GridFunction
<
GridFcts
>
...
>
,
static_assert
(
(
Concepts
::
GridFunction
<
GridFcts
>
&&
...
)
,
"All passed parameters must be GridFunctions."
);
static_assert
(
Concepts
::
Callable
<
Functor
,
typename
GridFcts
::
Range
...
>
,
"Range types of grid functions are not compatible with the functor."
);
...
...
amdis/gridfunctions/GridFunction.hpp
View file @
991acbfc
...
...
@@ -80,8 +80,8 @@ namespace AMDiS
/// can be converted to a GridFunction, or is already a GridFunction.
template
<
class
...
GFs
>
constexpr
bool
AnyGridFunction
=
any_of_v
<
GridFunction
<
remove_cvref_t
<
GFs
>>
...
>
||
any_of_v
<
Traits
::
IsPreGridFunction
<
remove_cvref_t
<
GFs
>>::
value
...
>
;
(
GridFunction
<
remove_cvref_t
<
GFs
>>
||
...
)
||
(
Traits
::
IsPreGridFunction
<
remove_cvref_t
<
GFs
>>::
value
||
...
)
;
template
<
class
...
GFs
>
using
AnyGridFunction_t
=
bool_t
<
AnyGridFunction
<
GFs
...
>>
;
...
...
amdis/operations/Composer.hpp
View file @
991acbfc
...
...
@@ -72,7 +72,7 @@ namespace AMDiS
// Polynomial order or composed function combines the orders of the sub-functions
template
<
class
F
,
class
...
Gs
,
class
...
Int
,
REQUIRES
(
Concepts
::
HasFunctorOrder
<
F
,
sizeof
...(
Gs
)>
&&
all_of_v
<
Concepts
::
HasFunctorOrder
<
Gs
,
sizeof
...(
Int
)
>
...
>
)
>
&&
(
Concepts
::
HasFunctorOrder
<
Gs
,
sizeof
...(
Int
)
>
&&
...
)
)
>
int
order
(
Composer
<
F
,
Gs
...
>
const
&
c
,
Int
...
degrees
)
{
auto
deg
=
[
&
](
auto
const
&
g
)
{
return
order
(
g
,
int
(
degrees
)...);
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment