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
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
agnumpde
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 {
...
@@ -14,9 +14,9 @@ namespace MatrixVector {
// add transformed matrix A += T1^t*B*T2
// add transformed matrix A += T1^t*B*T2
// ******************************************************
// ******************************************************
template
<
class
MatrixA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
B
isScalar
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
T1
isScalar
,
bool
T1
isScalar
,
bool
T2isScalar
>
bool
B
isScalar
,
bool
T2isScalar
>
struct
TransformMatrixHelper
{
struct
TransformMatrixHelper
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
TransformationMatrix1
&
T1
,
...
@@ -73,8 +73,8 @@ namespace MatrixVector {
...
@@ -73,8 +73,8 @@ namespace MatrixVector {
template
<
class
K1
,
class
K2
,
class
K3
,
int
n
,
int
m
>
template
<
class
K1
,
class
K2
,
class
K3
,
int
n
,
int
m
>
struct
TransformMatrixHelper
<
struct
TransformMatrixHelper
<
Dune
::
FieldMatrix
<
K1
,
m
,
m
>
,
Dune
::
FieldMatrix
<
K
3
,
n
,
n
>
,
Dune
::
FieldMatrix
<
K1
,
m
,
m
>
,
Dune
::
FieldMatrix
<
K
2
,
n
,
m
>
,
Dune
::
FieldMatrix
<
K
2
,
n
,
m
>
,
Dune
::
FieldMatrix
<
K2
,
n
,
m
>
,
false
,
false
,
Dune
::
FieldMatrix
<
K
3
,
n
,
n
>
,
Dune
::
FieldMatrix
<
K2
,
n
,
m
>
,
false
,
false
,
false
,
false
>
{
false
,
false
>
{
typedef
Dune
::
FieldMatrix
<
K1
,
m
,
m
>
MatrixA
;
typedef
Dune
::
FieldMatrix
<
K1
,
m
,
m
>
MatrixA
;
typedef
Dune
::
FieldMatrix
<
K3
,
n
,
n
>
MatrixB
;
typedef
Dune
::
FieldMatrix
<
K3
,
n
,
n
>
MatrixB
;
...
@@ -114,10 +114,10 @@ namespace MatrixVector {
...
@@ -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
>
class
ScalarTransform2
,
bool
AisScalar
,
bool
BisScalar
>
struct
TransformMatrixHelper
<
MatrixA
,
MatrixB
,
ScalarTransform1
,
struct
TransformMatrixHelper
<
MatrixA
,
ScalarTransform1
,
MatrixB
,
ScalarTransform2
,
AisScalar
,
BisScalar
,
true
,
ScalarTransform2
,
AisScalar
,
true
,
BisScalar
,
true
>
{
true
>
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
ScalarTransform1
&
T1
,
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
ScalarTransform1
&
T1
,
const
MatrixB
&
B
,
const
MatrixB
&
B
,
...
@@ -126,12 +126,12 @@ namespace MatrixVector {
...
@@ -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
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
T1isScalar
,
bool
T2isScalar
>
bool
T2isScalar
>
struct
TransformMatrixHelper
<
MatrixA
,
ScalarB
,
TransformationMatrix1
,
struct
TransformMatrixHelper
<
MatrixA
,
TransformationMatrix1
,
ScalarB
,
TransformationMatrix2
,
AisScalar
,
true
,
TransformationMatrix2
,
AisScalar
,
T1isScalar
,
T1isScalar
,
T2isScalar
>
{
true
,
T2isScalar
>
{
static
void
addTransformedMatrix
(
MatrixA
&
A
,
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
TransformationMatrix1
&
T1
,
const
ScalarB
&
B
,
const
ScalarB
&
B
,
...
@@ -147,27 +147,27 @@ namespace MatrixVector {
...
@@ -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
,
class
TransformationMatrix2
,
bool
AisScalar
,
bool
T1isScalar
,
bool
T2isScalar
>
bool
T2isScalar
>
struct
TransformMatrixHelper
<
struct
TransformMatrixHelper
<
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
ScalarB
,
TransformationMatrix1
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
ScalarB
,
TransformationMatrix2
,
AisScalar
,
true
,
T1isScalar
,
T2isScalar
>
{
TransformationMatrix2
,
AisScalar
,
T1isScalar
,
true
,
T2isScalar
>
{
typedef
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
MatrixA
;
typedef
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
MatrixA
;
static
void
addTransformedMatrix
(
MatrixA
&
A
,
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
TransformationMatrix1
&
T1
,
const
ScalarB
&
B
,
const
ScalarB
&
B
,
const
TransformationMatrix2
&
T2
)
{
const
TransformationMatrix2
&
T2
)
{
TransformMatrixHelper
<
TransformMatrixHelper
<
FieldType
,
ScalarB
,
typename
TransformationMatrix1
::
field_type
,
FieldType
,
typename
TransformationMatrix1
::
field_type
,
ScalarB
,
typename
TransformationMatrix2
::
field_type
,
true
,
true
,
true
,
typename
TransformationMatrix2
::
field_type
,
true
,
true
,
true
,
true
>::
addTransformedMatrix
(
A
.
scalar
(),
T1
.
scalar
(),
B
,
T2
.
scalar
());
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
>
class
ScalarTransform2
>
struct
TransformMatrixHelper
<
ScalarA
,
ScalarB
,
ScalarTransform1
,
struct
TransformMatrixHelper
<
ScalarA
,
ScalarTransform1
,
ScalarB
,
ScalarTransform2
,
true
,
true
,
true
,
true
>
{
ScalarTransform2
,
true
,
true
,
true
,
true
>
{
static
void
addTransformedMatrix
(
ScalarA
&
A
,
const
ScalarTransform1
&
T1
,
static
void
addTransformedMatrix
(
ScalarA
&
A
,
const
ScalarTransform1
&
T1
,
const
ScalarB
&
B
,
const
ScalarB
&
B
,
...
@@ -176,11 +176,11 @@ namespace MatrixVector {
...
@@ -176,11 +176,11 @@ namespace MatrixVector {
}
}
};
};
template
<
class
MatrixA
,
typename
FieldType
,
int
n
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
typename
FieldType
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
int
n
,
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
MatrixA
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
struct
TransformMatrixHelper
<
TransformationMatrix1
,
TransformationMatrix2
,
MatrixA
,
TransformationMatrix1
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
false
,
false
,
false
,
false
>
{
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
static
void
addTransformedMatrix
(
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
B
,
const
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
B
,
...
@@ -196,27 +196,27 @@ namespace MatrixVector {
...
@@ -196,27 +196,27 @@ namespace MatrixVector {
}
}
};
};
template
<
class
MatrixA
,
typename
FieldType
,
int
n
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
typename
FieldType
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
int
n
,
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
struct
TransformMatrixHelper
<
MatrixA
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
MatrixA
,
TransformationMatrix1
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
TransformationMatrix2
,
false
,
false
,
false
,
false
>
{
static
void
addTransformedMatrix
(
static
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>&
B
,
const
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>&
B
,
const
TransformationMatrix2
&
T2
)
{
const
TransformationMatrix2
&
T2
)
{
TransformMatrixHelper
<
MatrixA
,
FieldType
,
TransformationMatrix1
,
TransformMatrixHelper
<
MatrixA
,
TransformationMatrix1
,
FieldType
,
TransformationMatrix2
,
false
,
true
,
fals
e
,
TransformationMatrix2
,
false
,
false
,
tru
e
,
false
>::
addTransformedMatrix
(
A
,
T1
,
B
.
scalar
(),
T2
);
false
>::
addTransformedMatrix
(
A
,
T1
,
B
.
scalar
(),
T2
);
}
}
};
};
template
<
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
template
<
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
struct
TransformMatrixHelper
<
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
TransformationMatrix1
,
TransformationMatrix2
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>
,
TransformationMatrix2
,
false
,
false
,
false
,
false
,
false
,
false
>
{
false
,
false
>
{
static
void
addTransformedMatrix
(
static
void
addTransformedMatrix
(
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
A
,
const
TransformationMatrix1
&
T1
,
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
A
,
const
TransformationMatrix1
&
T1
,
const
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
B
,
const
Dune
::
DiagonalMatrix
<
FieldType
,
n
>&
B
,
...
@@ -231,10 +231,10 @@ namespace MatrixVector {
...
@@ -231,10 +231,10 @@ namespace MatrixVector {
template
<
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
template
<
typename
FieldType
,
int
n
,
class
TransformationMatrix1
,
class
TransformationMatrix2
>
class
TransformationMatrix2
>
struct
TransformMatrixHelper
<
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
struct
TransformMatrixHelper
<
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix1
,
TransformationMatrix1
,
TransformationMatrix2
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>
,
TransformationMatrix2
,
false
,
false
,
false
,
false
,
false
>
{
false
,
false
,
false
>
{
static
void
addTransformedMatrix
(
static
void
addTransformedMatrix
(
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>&
A
,
Dune
::
ScaledIdentityMatrix
<
FieldType
,
n
>&
A
,
const
TransformationMatrix1
&
T1
,
const
TransformationMatrix1
&
T1
,
...
@@ -263,34 +263,36 @@ namespace MatrixVector {
...
@@ -263,34 +263,36 @@ namespace MatrixVector {
}
}
};
};
template
<
class
MatrixA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
class
TransformationMatrix2
>
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
void
addTransformedMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
MatrixB
&
B
,
const
TransformationMatrix2
&
T2
)
{
const
MatrixB
&
B
,
const
TransformationMatrix2
&
T2
)
{
TransformMatrixHelper
<
TransformMatrixHelper
<
MatrixA
,
MatrixB
,
TransformationMatrix1
,
TransformationMatrix2
,
MatrixA
,
TransformationMatrix1
,
MatrixB
,
TransformationMatrix2
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
TransformationMatrix1
>::
isScalar
,
ScalarTraits
<
TransformationMatrix1
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
ScalarTraits
<
ScalarTraits
<
TransformationMatrix2
>::
isScalar
>::
addTransformedMatrix
(
A
,
T1
,
B
,
TransformationMatrix2
>::
isScalar
>::
addTransformedMatrix
(
A
,
T1
,
B
,
T2
);
T2
);
}
}
template
<
class
MatrixA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
class
TransformationMatrix2
>
void
transformMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
void
transformMatrix
(
MatrixA
&
A
,
const
TransformationMatrix1
&
T1
,
const
MatrixB
&
B
,
const
TransformationMatrix2
&
T2
)
{
const
MatrixB
&
B
,
const
TransformationMatrix2
&
T2
)
{
A
=
0
;
A
=
0
;
TransformMatrixHelper
<
TransformMatrixHelper
<
MatrixA
,
MatrixB
,
TransformationMatrix1
,
TransformationMatrix2
,
MatrixA
,
TransformationMatrix1
,
MatrixB
,
TransformationMatrix2
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
ScalarTraits
<
MatrixA
>::
isScalar
,
ScalarTraits
<
TransformationMatrix1
>::
isScalar
,
ScalarTraits
<
TransformationMatrix1
>::
isScalar
,
ScalarTraits
<
MatrixB
>::
isScalar
,
ScalarTraits
<
ScalarTraits
<
TransformationMatrix2
>::
isScalar
>::
addTransformedMatrix
(
A
,
T1
,
B
,
TransformationMatrix2
>::
isScalar
>::
addTransformedMatrix
(
A
,
T1
,
B
,
T2
);
T2
);
}
}
template
<
class
MatrixBlockA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixBlockA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
class
TransformationMatrix2
>
static
void
transformMatrix
(
Dune
::
BCRSMatrix
<
MatrixBlockA
>&
A
,
static
void
transformMatrix
(
Dune
::
BCRSMatrix
<
MatrixBlockA
>&
A
,
const
TransformationMatrix1
&
T1
,
const
MatrixB
&
B
,
const
TransformationMatrix1
&
T1
,
const
MatrixB
&
B
,
...
@@ -313,7 +315,7 @@ namespace MatrixVector {
...
@@ -313,7 +315,7 @@ namespace MatrixVector {
}
}
}
}
template
<
class
MatrixBlockA
,
class
MatrixB
,
class
TransformationMatrix1
,
template
<
class
MatrixBlockA
,
class
TransformationMatrix1
,
class
MatrixB
,
class
TransformationMatrix2
>
class
TransformationMatrix2
>
static
void
transformMatrixPattern
(
Dune
::
BCRSMatrix
<
MatrixBlockA
>&
A
,
static
void
transformMatrixPattern
(
Dune
::
BCRSMatrix
<
MatrixBlockA
>&
A
,
const
TransformationMatrix1
&
T1
,
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