Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Tobias Leibner
dune-common
Commits
9e176a0d
Commit
9e176a0d
authored
9 years ago
by
Elias Pipping
Committed by
Christoph Grüninger
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Clean up after have_istl_assign_to_fmatrix removal
See also
flyspray/FS#1669
parent
a48c33a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/common/densematrix.hh
+3
-43
3 additions, 43 deletions
dune/common/densematrix.hh
with
3 additions
and
43 deletions
dune/common/densematrix.hh
+
3
−
43
View file @
9e176a0d
...
...
@@ -93,52 +93,12 @@ namespace Dune
template
<
class
DenseMatrix
,
class
RHS
>
class
DenseMatrixAssignerImplementation
<
DenseMatrix
,
RHS
,
false
>
{
template
<
class
M
,
class
T
>
struct
have_istl_assign_to_fmatrix
{
struct
yes
{
char
dummy
[
1
];
};
struct
no
{
char
dummy
[
2
];
};
template
<
class
C
>
static
C
&
get_ref
();
template
<
class
C
>
static
yes
test
(
decltype
(
istl_assign_to_fmatrix
(
get_ref
<
M
>
(),
get_ref
<
C
>
()
)
)
*
);
template
<
class
C
>
static
no
test
(...);
public
:
static
const
bool
v
=
sizeof
(
test
<
const
T
>
(
0
)
)
==
sizeof
(
yes
);
};
template
<
class
M
,
class
T
,
bool
=
have_istl_assign_to_fmatrix
<
M
,
T
>
::
v
>
struct
DefaultImplementation
;
// forward to istl_assign_to_fmatrix()
template
<
class
M
,
class
T
>
struct
DefaultImplementation
<
M
,
T
,
true
>
{
static
void
apply
(
M
&
m
,
const
T
&
t
)
{
istl_assign_to_fmatrix
(
m
,
t
);
}
};
// static_cast
template
<
class
M
,
class
T
>
struct
DefaultImplementation
<
M
,
T
,
false
>
{
static
void
apply
(
M
&
m
,
const
T
&
t
)
{
static_assert
(
(
std
::
is_convertible
<
const
T
,
const
M
>::
value
),
"No template specialization of DenseMatrixAssigner found"
);
m
=
static_cast
<
const
M
&
>
(
t
);
}
};
public:
static
void
apply
(
DenseMatrix
&
denseMatrix
,
const
RHS
&
rhs
)
{
DefaultImplementation
<
DenseMatrix
,
RHS
>::
apply
(
denseMatrix
,
rhs
);
static_assert
(
(
Conversion
<
const
RHS
,
const
DenseMatrix
>::
exists
),
"No template specialization of DenseMatrixAssigner found"
);
denseMatrix
=
static_cast
<
const
DenseMatrix
&
>
(
rhs
);
}
};
}
...
...
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