Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
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
Model registry
Operate
Environments
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
Core Modules
dune-istl
Commits
35a02846
Commit
35a02846
authored
9 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
[istl][multitype] static_assert works only if we have constexpr
parent
27dba713
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/multitypeblockmatrix.hh
+28
-8
28 additions, 8 deletions
dune/istl/multitypeblockmatrix.hh
with
28 additions
and
8 deletions
dune/istl/multitypeblockmatrix.hh
+
28
−
8
View file @
35a02846
...
...
@@ -265,8 +265,13 @@ namespace Dune {
*/
template
<
typename
X
,
typename
Y
>
void
mv
(
const
X
&
x
,
Y
&
y
)
const
{
static_assert
(
x
.
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
y
.
size
()
==
N
(),
"length of y does not match row count"
);
#if HAVE_CONSTEXPR
static_assert
(
X
::
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
Y
::
size
()
==
N
(),
"length of y does not match row count"
);
#else
assert
(
x
.
size
()
==
M
()
&&
"length of x does not match row length"
);
assert
(
y
.
size
()
==
N
()
&&
"length of y does not match row count"
);
#endif
y
=
0
;
//reset y (for mv uses umv)
MultiTypeBlockMatrix_VectMul
<
0
,
N
(),
0
,
M
(),
Y
,
type
,
X
>::
umv
(
y
,
*
this
,
x
);
//iterate over all matrix elements
...
...
@@ -276,8 +281,13 @@ namespace Dune {
*/
template
<
typename
X
,
typename
Y
>
void
umv
(
const
X
&
x
,
Y
&
y
)
const
{
static_assert
(
x
.
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
y
.
size
()
==
N
(),
"length of y does not match row count"
);
#if HAVE_CONSTEXPR
static_assert
(
X
::
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
Y
::
size
()
==
N
(),
"length of y does not match row count"
);
#else
assert
(
x
.
size
()
==
M
()
&&
"length of x does not match row length"
);
assert
(
y
.
size
()
==
N
()
&&
"length of y does not match row count"
);
#endif
MultiTypeBlockMatrix_VectMul
<
0
,
N
(),
0
,
M
(),
Y
,
type
,
X
>::
umv
(
y
,
*
this
,
x
);
//iterate over all matrix elements
}
...
...
@@ -286,8 +296,13 @@ namespace Dune {
*/
template
<
typename
X
,
typename
Y
>
void
mmv
(
const
X
&
x
,
Y
&
y
)
const
{
static_assert
(
x
.
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
y
.
size
()
==
N
(),
"length of y does not match row count"
);
#if HAVE_CONSTEXPR
static_assert
(
X
::
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
Y
::
size
()
==
N
(),
"length of y does not match row count"
);
#else
assert
(
x
.
size
()
==
M
()
&&
"length of x does not match row length"
);
assert
(
y
.
size
()
==
N
()
&&
"length of y does not match row count"
);
#endif
MultiTypeBlockMatrix_VectMul
<
0
,
N
(),
0
,
M
(),
Y
,
type
,
X
>::
mmv
(
y
,
*
this
,
x
);
//iterate over all matrix elements
}
...
...
@@ -296,8 +311,13 @@ namespace Dune {
*/
template
<
typename
AlphaType
,
typename
X
,
typename
Y
>
void
usmv
(
const
AlphaType
&
alpha
,
const
X
&
x
,
Y
&
y
)
const
{
static_assert
(
x
.
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
y
.
size
()
==
N
(),
"length of y does not match row count"
);
#if HAVE_CONSTEXPR
static_assert
(
X
::
size
()
==
M
(),
"length of x does not match row length"
);
static_assert
(
Y
::
size
()
==
N
(),
"length of y does not match row count"
);
#else
assert
(
x
.
size
()
==
M
()
&&
"length of x does not match row length"
);
assert
(
y
.
size
()
==
N
()
&&
"length of y does not match row count"
);
#endif
MultiTypeBlockMatrix_VectMul
<
0
,
N
(),
0
,
M
(),
Y
,
type
,
X
>::
usmv
(
alpha
,
y
,
*
this
,
x
);
//iterate over all matrix elements
...
...
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