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
1c96e86f
Commit
1c96e86f
authored
6 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
Implement operator*= such that it accepts any number type
This is possible now because we have IsNumber in dune-common.
parent
09c4d040
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!282
Improve matrix testing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/multitypeblockvector.hh
+5
-25
5 additions, 25 deletions
dune/istl/multitypeblockvector.hh
with
5 additions
and
25 deletions
dune/istl/multitypeblockvector.hh
+
5
−
25
View file @
1c96e86f
...
...
@@ -159,31 +159,11 @@ namespace Dune {
});
}
// Once we have the IsNumber traits class the following
// three implementations could be replaced by:
//
// template<class T,
// std::enable_if_t< IsNumber<T>::value, int> = 0>
// void operator*= (const T& w) {
// Dune::Hybrid::forEach(*this, [&](auto&& entry) {
// entry *= w;
// });
// }
void
operator
*=
(
const
int
&
w
)
{
Dune
::
Hybrid
::
forEach
(
*
this
,
[
&
](
auto
&&
entry
)
{
entry
*=
w
;
});
}
void
operator
*=
(
const
float
&
w
)
{
Dune
::
Hybrid
::
forEach
(
*
this
,
[
&
](
auto
&&
entry
)
{
entry
*=
w
;
});
}
void
operator
*=
(
const
double
&
w
)
{
Dune
::
Hybrid
::
forEach
(
*
this
,
[
&
](
auto
&&
entry
)
{
/** \brief Multiplication with a scalar */
template
<
class
T
,
std
::
enable_if_t
<
IsNumber
<
T
>
::
value
,
int
>
=
0
>
void
operator
*=
(
const
T
&
w
)
{
Hybrid
::
forEach
(
*
this
,
[
&
](
auto
&&
entry
)
{
entry
*=
w
;
});
}
...
...
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