Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-matrix-vector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
Ansgar Burchardt
dune-matrix-vector
Commits
445166cf
Commit
445166cf
authored
8 years ago
by
Max Kahnt
Browse files
Options
Downloads
Patches
Plain Diff
Use consistent ordering of (template) types and variables.
parent
24803525
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/matrix-vector/transformmatrix.hh
+46
-44
46 additions, 44 deletions
dune/matrix-vector/transformmatrix.hh
with
46 additions
and
44 deletions
dune/matrix-vector/transformmatrix.hh
+
46
−
44
View file @
445166cf
...
...
@@ -14,9 +14,9 @@ namespace MatrixVector {
// add transformed matrix A += T1^t*B*T2
// ******************************************************
template
<
class
MatrixA
,
class
MatrixB
,
class
TransformationMatrix1
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
B
isScalar
,
bool
T1
isScalar
,
bool
T2isScalar
>
template
<
class
MatrixA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
T1
isScalar
,
bool
B
isScalar
,
bool
T2isScalar
>
struct
TransformMatrixHelper
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
...
...
@@ -73,8 +73,8 @@ namespace MatrixVector {
template
<
class
K1
,
class
K2
,
class
K3
,
int
n
,
int
m
>
struct
TransformMatrixHelper
<
Dune
::
FieldMatrix
<
K1
,
m
,
m
>
,
Dune
::
FieldMatrix
<
K
3
,
n
,
n
>
,
Dune
::
FieldMatrix
<
K
2
,
n
,
m
>
,
Dune
::
FieldMatrix
<
K2
,
n
,
m
>
,
false
,
false
,
Dune
::
FieldMatrix
<
K1
,
m
,
m
>
,
Dune
::
FieldMatrix
<
K
2
,
n
,
m
>
,
Dune
::
FieldMatrix
<
K
3
,
n
,
n
>
,
Dune
::
FieldMatrix
<
K2
,
n
,
m
>
,
false
,
false
,
false
,
false
>
{
typedef
Dune
::
FieldMatrix
<
K1
,
m
,
m
>
MatrixA
;
typedef
Dune
::
FieldMatrix
<
K3
,
n
,
n
>
MatrixB
;
...
...
@@ -114,10 +114,10 @@ namespace MatrixVector {
// }
};
template
<
class
MatrixA
,
class
MatrixB
,
class
ScalarTransform1
,
template
<
class
MatrixA
,
class
ScalarTransform1
,
class
MatrixB
,
class
ScalarTransform2
,
bool
AisScalar
,
bool
BisScalar
>
struct
TransformMatrixHelper
<
MatrixA
,
MatrixB
,
ScalarTransform1
,
ScalarTransform2
,
AisScalar
,
BisScalar
,
true
,
struct
TransformMatrixHelper
<
MatrixA
,
ScalarTransform1
,
MatrixB
,
ScalarTransform2
,
AisScalar
,
true
,
BisScalar
,
true
>
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
ScalarTransform1
&
T1
,
const
MatrixB
&
B
,
...
...
@@ -126,12 +126,12 @@ namespace MatrixVector {
}
};
template
<
class
MatrixA
,
class
ScalarB
,
class
TransformationMatrix1
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
class
ScalarB
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
T1isScalar
,
bool
T2isScalar
>
struct
TransformMatrixHelper
<
MatrixA
,
ScalarB
,
TransformationMatrix1
,
TransformationMatrix2
,
AisScalar
,
true
,
T1isScalar
,
T2isScalar
>
{
struct
TransformMatrixHelper
<
MatrixA
,
TransformationMatrix1
,
ScalarB
,
TransformationMatrix2
,
AisScalar
,
T1isScalar
,
true
,
T2isScalar
>
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
ScalarB
&
B
,
...
...
@@ -147,27 +147,27 @@ namespace MatrixVector {
}
};
template
<
class
FieldType
,
int
n
,
class
ScalarB
,
class
TransformationMatrix1
,
template
<
class
FieldType
,
int
n
,
class
TransformationMatrix1
,
class
ScalarB
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
T1isScalar
,
bool
T2isScalar
>
struct
TransformMatrixHelper
<
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
ScalarB
,
TransformationMatrix1
,
TransformationMatrix2
,
AisScalar
,
true
,
T1isScalar
,
T2isScalar
>
{
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
ScalarB
,
TransformationMatrix2
,
AisScalar
,
T1isScalar
,
true
,
T2isScalar
>
{
typedef
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
MatrixA
;
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
ScalarB
&
B
,
const
TransformationMatrix2
&
T2
)
{
TransformMatrixHelper
<
FieldType
,
ScalarB
,
typename
TransformationMatrix1
::
field_type
,
FieldType
,
typename
TransformationMatrix1
::
field_type
,
ScalarB
,
typename
TransformationMatrix2
::
field_type
,
true
,
true
,
true
,
true
>::
addTransformedMatrix
(
A
.
scalar
(),
T1
.
scalar
(),
B
,
T2
.
scalar
());
}
};
template
<
class
ScalarA
,
class
Scalar
B
,
class
Scalar
Transform1
,
template
<
class
ScalarA
,
class
Scalar
Transform1
,
class
Scalar
B
,
class
ScalarTransform2
>
struct
TransformMatrixHelper
<
ScalarA
,
ScalarB
,
ScalarTransform1
,
struct
TransformMatrixHelper
<
ScalarA
,
ScalarTransform1
,
ScalarB
,
ScalarTransform2
,
true
,
true
,
true
,
true
>
{
static
void
addTransformedMatrix
(
ScalarA
&
A
,
const
ScalarTransform1
&
T1
,
const
ScalarB
&
B
,
...
...
@@ -176,11 +176,11 @@ namespace MatrixVector {
}
};
template
<
class
MatrixA
,
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
MatrixA
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
template
<
class
MatrixA
,
class
TransformationMatrix1
,
typename
FieldType
,
int
n
,
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
MatrixA
,
TransformationMatrix1
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
B
,
...
...
@@ -196,27 +196,27 @@ namespace MatrixVector {
}
};
template
<
class
MatrixA
,
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
template
<
class
MatrixA
,
class
TransformationMatrix1
,
typename
FieldType
,
int
n
,
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
MatrixA
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
MatrixA
,
TransformationMatrix1
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>&
B
,
const
TransformationMatrix2
&
T2
)
{
TransformMatrixHelper
<
MatrixA
,
FieldType
,
TransformationMatrix1
,
TransformationMatrix2
,
false
,
true
,
fals
e
,
TransformMatrixHelper
<
MatrixA
,
TransformationMatrix1
,
FieldType
,
TransformationMatrix2
,
false
,
false
,
tru
e
,
false
>::
addTransformedMatrix
(
A
,
T1
,
B
.
scalar
(),
T2
);
}
};
template
<
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
struct
TransformMatrixHelper
<
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
static
void
addTransformedMatrix
(
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
A
,
const
TransformationMatrix1
&
T1
,
const
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
B
,
...
...
@@ -231,10 +231,10 @@ namespace MatrixVector {
template
<
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
struct
TransformMatrixHelper
<
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
static
void
addTransformedMatrix
(
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>&
A
,
const
TransformationMatrix1
&
T1
,
...
...
@@ -263,34 +263,36 @@ namespace MatrixVector {
}
};
template
<
class
MatrixA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
MatrixB
&
B
,
const
TransformationMatrix2
&
T2
)
{
TransformMatrixHelper
<
MatrixA
,
MatrixB
,
TransformationMatrix1
,
TransformationMatrix2
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
MatrixA
,
TransformationMatrix1
,
MatrixB
,
TransformationMatrix2
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
TransformationMatrix1
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
ScalarTraits
<
TransformationMatrix2
>::
isScalar
>::
addTransformedMatrix
(
A
,
T1
,
B
,
T2
);
}
template
<
class
MatrixA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
void
transformMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
MatrixB
&
B
,
const
TransformationMatrix2
&
T2
)
{
A
=
0
;
TransformMatrixHelper
<
MatrixA
,
MatrixB
,
TransformationMatrix1
,
TransformationMatrix2
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
MatrixA
,
TransformationMatrix1
,
MatrixB
,
TransformationMatrix2
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
TransformationMatrix1
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
ScalarTraits
<
TransformationMatrix2
>::
isScalar
>::
addTransformedMatrix
(
A
,
T1
,
B
,
T2
);
}
template
<
class
MatrixBlockA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixBlockA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
static
void
transformMatrix
(
Dune
::
BCRSMatrix
<
MatrixBlockA
>&
A
,
const
TransformationMatrix1
&
T1
,
const
MatrixB
&
B
,
...
...
@@ -313,7 +315,7 @@ namespace MatrixVector {
}
}
template
<
class
MatrixBlockA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixBlockA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
static
void
transformMatrixPattern
(
Dune
::
BCRSMatrix
<
MatrixBlockA
>&
A
,
const
TransformationMatrix1
&
T1
,
...
...
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