Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
iwr
amdis
Commits
fd417732
Commit
fd417732
authored
8 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
functors with arbitrary nr of arguments
parent
083a5c96
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Issue/functor expression args
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AMDiS/src/expressions/expr_traits.hpp
+8
-8
8 additions, 8 deletions
AMDiS/src/expressions/expr_traits.hpp
AMDiS/src/traits/basic.hpp
+42
-6
42 additions, 6 deletions
AMDiS/src/traits/basic.hpp
with
50 additions
and
14 deletions
AMDiS/src/expressions/expr_traits.hpp
+
8
−
8
View file @
fd417732
...
...
@@ -41,10 +41,10 @@ namespace AMDiS
struct
is_constant
:
is_numeric
<
T
>::
type
{};
template
<
typename
T
>
struct
is_constant
<
WorldVector
<
T
>
>
:
boost
::
mpl
::
bool_
<
true
>
{};
struct
is_constant
<
WorldVector
<
T
>
>
:
bool_
<
true
>
{};
template
<
typename
T
>
struct
is_constant
<
WorldMatrix
<
T
>
>
:
boost
::
mpl
::
bool_
<
true
>
{};
struct
is_constant
<
WorldMatrix
<
T
>
>
:
bool_
<
true
>
{};
// type-traits for terms
...
...
@@ -56,18 +56,18 @@ namespace AMDiS
// type-traits for arguments, filter terms and constants
// ___________________________________________________________________________
template
<
typename
T
>
struct
is_valid_arg
:
boost
::
mpl
::
or_
struct
is_valid_arg
:
or_
<
typename
is_expr
<
T
>::
type
,
typename
is_constant
<
T
>::
type
>::
type
{};
template
<
typename
T1
,
typename
T2
>
struct
is_valid_arg2
:
boost
::
mpl
::
and_
struct
is_valid_arg2
:
and_
<
typename
is_valid_arg
<
T1
>::
type
,
typename
is_valid_arg
<
T2
>::
type
,
typename
boost
::
mpl
::
or_
typename
or_
<
typename
is_expr
<
T1
>::
type
,
typename
is_expr
<
T2
>::
type
...
...
@@ -75,12 +75,12 @@ namespace AMDiS
>::
type
{};
template
<
typename
T1
,
typename
T2
,
typename
T3
>
struct
is_valid_arg3
:
boost
::
mpl
::
and_
struct
is_valid_arg3
:
and_
<
typename
is_valid_arg
<
T1
>::
type
,
typename
is_valid_arg
<
T2
>::
type
,
typename
is_valid_arg
<
T3
>::
type
,
typename
boost
::
mpl
::
or_
typename
or_
<
typename
is_expr
<
T1
>::
type
,
typename
is_expr
<
T2
>::
type
,
...
...
@@ -92,7 +92,7 @@ namespace AMDiS
// expressions
template
<
typename
T
>
struct
category
<
T
,
typename
boost
::
enable_if
<
typename
is_expr
<
T
>::
type
>::
type
>
struct
category
<
T
,
typename
enable_if
<
typename
is_expr
<
T
>::
type
>::
type
>
{
typedef
tag
::
expression
tag
;
typedef
typename
T
::
value_type
value_type
;
...
...
This diff is collapsed.
Click to expand it.
AMDiS/src/traits/basic.hpp
+
42
−
6
View file @
fd417732
...
...
@@ -35,7 +35,7 @@
#include
<boost/utility/enable_if.hpp>
#endif
#ifdef HAS_C
PP
11
#ifdef HAS_C
XX
11
#include
<type_traits>
#endif
...
...
@@ -44,11 +44,52 @@ namespace AMDiS
// introduce some shortcuts for boost::mpl
// ---------------------------------------
#ifdef HAS_CXX11
template
<
bool
B
>
using
bool_
=
std
::
integral_constant
<
bool
,
B
>
;
using
true_
=
bool_
<
true
>
;
using
false_
=
bool_
<
false
>
;
namespace
aux
{
template
<
class
...
Ts
>
struct
or_
;
template
<
class
T0
,
class
...
Ts
>
struct
or_
<
T0
,
Ts
...
>
:
bool_
<
T0
::
value
||
or_
<
Ts
...
>::
value
>
{};
template
<
>
struct
or_
<>
:
false_
{};
template
<
class
...
Ts
>
struct
and_
;
template
<
class
T0
,
class
...
Ts
>
struct
and_
<
T0
,
Ts
...
>
:
bool_
<
T0
::
value
&&
and_
<
Ts
...
>::
value
>
{};
template
<
>
struct
and_
<>
:
true_
{};
}
// end namespace aux
template
<
class
...
Ts
>
using
and_
=
aux
::
and_
<
Ts
...
>
;
template
<
class
...
Ts
>
using
or_
=
aux
::
or_
<
Ts
...
>
;
template
<
class
A
>
using
not_
=
bool_
<!
(
A
::
value
)
>
;
#else
using
boost
::
mpl
::
bool_
;
using
boost
::
mpl
::
true_
;
using
boost
::
mpl
::
false_
;
using
boost
::
mpl
::
and_
;
using
boost
::
mpl
::
or_
;
using
boost
::
mpl
::
not_
;
#endif
using
boost
::
enable_if
;
using
boost
::
enable_if_c
;
...
...
@@ -74,13 +115,8 @@ namespace AMDiS
boost
::
is_same
<
typename
mtl
::
Addable
<
A
,
B
>::
result_type
,
no_valid_type
>
>
{};
#ifdef HAS_CPP11
template
<
typename
T
>
struct
is_trivially_copyable
:
std
::
is_trivially_copyable
<
T
>
{};
#else
template
<
typename
T
>
struct
is_trivially_copyable
:
boost
::
is_pod
<
T
>
{};
#endif
template
<
class
T
,
T
A
,
T
B
>
struct
equal
:
boost
::
mpl
::
if_c
<
A
==
B
,
true_
,
false_
>
{};
...
...
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