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
bbfea55f
Commit
bbfea55f
authored
6 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[container] fix tests
parent
0471fbc1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/xt/la/container/eigen/sparse.hh
+8
-4
8 additions, 4 deletions
dune/xt/la/container/eigen/sparse.hh
dune/xt/la/container/istl.hh
+8
-4
8 additions, 4 deletions
dune/xt/la/container/istl.hh
dune/xt/la/type_traits.hh
+43
-0
43 additions, 0 deletions
dune/xt/la/type_traits.hh
with
59 additions
and
8 deletions
dune/xt/la/container/eigen/sparse.hh
+
8
−
4
View file @
bbfea55f
...
@@ -287,8 +287,10 @@ public:
...
@@ -287,8 +287,10 @@ public:
}
}
template
<
class
V1
,
class
V2
>
template
<
class
V1
,
class
V2
>
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
,
void
>
mv
(
const
V1
&
xx
,
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
V2
&
yy
)
const
&&
!
is_eigen_vector
<
V1
>::
value
,
void
>
mv
(
const
V1
&
xx
,
V2
&
yy
)
const
{
{
EigenDenseVector
<
ScalarType
>
xx_eigen
(
xx
.
size
()),
yy_eigen
(
yy
.
size
());
EigenDenseVector
<
ScalarType
>
xx_eigen
(
xx
.
size
()),
yy_eigen
(
yy
.
size
());
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
...
@@ -305,8 +307,10 @@ public:
...
@@ -305,8 +307,10 @@ public:
}
}
template
<
class
V1
,
class
V2
>
template
<
class
V1
,
class
V2
>
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
,
void
>
mtv
(
const
V1
&
xx
,
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
V2
&
yy
)
const
&&
!
is_eigen_vector
<
V1
>::
value
,
void
>
mtv
(
const
V1
&
xx
,
V2
&
yy
)
const
{
{
EigenDenseVector
<
ScalarType
>
xx_eigen
(
xx
.
size
()),
yy_eigen
(
yy
.
size
());
EigenDenseVector
<
ScalarType
>
xx_eigen
(
xx
.
size
()),
yy_eigen
(
yy
.
size
());
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
...
...
This diff is collapsed.
Click to expand it.
dune/xt/la/container/istl.hh
+
8
−
4
View file @
bbfea55f
...
@@ -552,8 +552,10 @@ public:
...
@@ -552,8 +552,10 @@ public:
}
}
template
<
class
V1
,
class
V2
>
template
<
class
V1
,
class
V2
>
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
,
void
>
mv
(
const
V1
&
xx
,
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
V2
&
yy
)
const
&&
!
is_istl_dense_vector
<
V1
>::
value
,
void
>
mv
(
const
V1
&
xx
,
V2
&
yy
)
const
{
{
IstlDenseVector
<
ScalarType
>
xx_istl
(
xx
.
size
()),
yy_istl
(
yy
.
size
());
IstlDenseVector
<
ScalarType
>
xx_istl
(
xx
.
size
()),
yy_istl
(
yy
.
size
());
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
...
@@ -570,8 +572,10 @@ public:
...
@@ -570,8 +572,10 @@ public:
}
}
template
<
class
V1
,
class
V2
>
template
<
class
V1
,
class
V2
>
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
,
void
>
mtv
(
const
V1
&
xx
,
inline
std
::
enable_if_t
<
XT
::
Common
::
is_vector
<
V1
>::
value
&&
XT
::
Common
::
is_vector
<
V2
>::
value
V2
&
yy
)
const
&&
!
is_istl_dense_vector
<
V1
>::
value
,
void
>
mtv
(
const
V1
&
xx
,
V2
&
yy
)
const
{
{
IstlDenseVector
<
ScalarType
>
xx_istl
(
xx
.
size
()),
yy_istl
(
yy
.
size
());
IstlDenseVector
<
ScalarType
>
xx_istl
(
xx
.
size
()),
yy_istl
(
yy
.
size
());
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
for
(
size_t
ii
=
0
;
ii
<
xx
.
size
();
++
ii
)
...
...
This diff is collapsed.
Click to expand it.
dune/xt/la/type_traits.hh
+
43
−
0
View file @
bbfea55f
...
@@ -55,6 +55,12 @@ class VectorInterface;
...
@@ -55,6 +55,12 @@ class VectorInterface;
template
<
class
ScalarType
,
Backends
backend
>
template
<
class
ScalarType
,
Backends
backend
>
struct
Container
;
struct
Container
;
template
<
class
Traits
,
class
ScalarImp
>
class
EigenBaseVector
;
template
<
class
ScalarImp
>
class
IstlDenseVector
;
namespace
internal
{
namespace
internal
{
...
@@ -108,6 +114,25 @@ struct is_vector_helper
...
@@ -108,6 +114,25 @@ struct is_vector_helper
};
// class is_vector_helper
};
// class is_vector_helper
template
<
class
C
>
struct
is_eigen_vector_helper
{
DXTC_has_typedef_initialize_once
(
Traits
);
DXTC_has_typedef_initialize_once
(
ScalarType
);
static
const
bool
is_candidate
=
DXTC_has_typedef
(
Traits
)
<
C
>::
value
&&
DXTC_has_typedef
(
ScalarType
)
<
C
>::
value
;
};
// class is_eigen_vector_helper
template
<
class
C
>
struct
is_istl_dense_vector_helper
{
DXTC_has_typedef_initialize_once
(
ScalarType
);
static
const
bool
is_candidate
=
DXTC_has_typedef
(
ScalarType
)
<
C
>::
value
;
};
// class is_istl_dense_vector_helper
}
// namespace internal
}
// namespace internal
...
@@ -138,6 +163,24 @@ struct is_vector<V, false> : public std::false_type
...
@@ -138,6 +163,24 @@ struct is_vector<V, false> : public std::false_type
{};
{};
template
<
class
V
,
bool
candidate
=
internal
::
is_eigen_vector_helper
<
V
>
::
is_candidate
>
struct
is_eigen_vector
:
public
std
::
is_base_of
<
EigenBaseVector
<
typename
V
::
Traits
,
typename
V
::
ScalarType
>
,
V
>
{};
template
<
class
V
>
struct
is_eigen_vector
<
V
,
false
>
:
public
std
::
false_type
{};
template
<
class
V
,
bool
candidate
=
internal
::
is_istl_dense_vector_helper
<
V
>
::
is_candidate
>
struct
is_istl_dense_vector
:
public
std
::
is_base_of
<
IstlDenseVector
<
typename
V
::
ScalarType
>
,
V
>
{};
template
<
class
V
>
struct
is_istl_dense_vector
<
V
,
false
>
:
public
std
::
false_type
{};
template
<
class
C
,
bool
candidate
=
internal
::
provides_backend_helper
<
C
>
::
is_candidate
>
template
<
class
C
,
bool
candidate
=
internal
::
provides_backend_helper
<
C
>
::
is_candidate
>
struct
provides_backend
:
public
std
::
is_base_of
<
ProvidesBackend
<
typename
C
::
Traits
>
,
C
>
struct
provides_backend
:
public
std
::
is_base_of
<
ProvidesBackend
<
typename
C
::
Traits
>
,
C
>
{};
{};
...
...
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