Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
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
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
Sander, Oliver
dune-gfe
Commits
4f69c98c
Commit
4f69c98c
authored
14 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add methods axpy and left-multiplication by a FieldMatrix
[[Imported from SVN: r7135]]
parent
f053f105
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/gfe/tensor3.hh
+23
-0
23 additions, 0 deletions
dune/gfe/tensor3.hh
with
23 additions
and
0 deletions
dune/gfe/tensor3.hh
+
23
−
0
View file @
4f69c98c
...
@@ -35,6 +35,13 @@ class Tensor3
...
@@ -35,6 +35,13 @@ class Tensor3
return
norm
;
return
norm
;
}
}
Tensor3
<
T
,
N1
,
N2
,
N3
>&
axpy
(
const
T
&
alpha
,
const
Tensor3
<
T
,
N1
,
N2
,
N3
>&
other
)
{
for
(
int
i
=
0
;
i
<
N1
;
i
++
)
(
*
this
)[
i
].
axpy
(
alpha
,
other
[
i
]);
return
*
this
;
}
static
Tensor3
<
T
,
N1
,
N2
,
N3
>
product
(
const
Dune
::
FieldVector
<
T
,
N1
>&
a
,
const
Dune
::
FieldVector
<
T
,
N2
>&
b
,
const
Dune
::
FieldVector
<
T
,
N3
>&
c
)
static
Tensor3
<
T
,
N1
,
N2
,
N3
>
product
(
const
Dune
::
FieldVector
<
T
,
N1
>&
a
,
const
Dune
::
FieldVector
<
T
,
N2
>&
b
,
const
Dune
::
FieldVector
<
T
,
N3
>&
c
)
{
{
Tensor3
<
T
,
N1
,
N2
,
N3
>
result
;
Tensor3
<
T
,
N1
,
N2
,
N3
>
result
;
...
@@ -87,6 +94,22 @@ class Tensor3
...
@@ -87,6 +94,22 @@ class Tensor3
return
result
;
return
result
;
}
}
template
<
int
N4
>
friend
Tensor3
<
T
,
N1
,
N3
,
N4
>
operator
*
(
const
Dune
::
FieldMatrix
<
T
,
N1
,
N2
>&
a
,
const
Tensor3
<
T
,
N2
,
N3
,
N4
>&
b
)
{
Tensor3
<
T
,
N1
,
N3
,
N4
>
result
;
for
(
int
i
=
0
;
i
<
N1
;
i
++
)
for
(
int
j
=
0
;
j
<
N3
;
j
++
)
for
(
int
k
=
0
;
k
<
N4
;
k
++
)
{
result
[
i
][
j
][
k
]
=
0
;
for
(
int
l
=
0
;
l
<
N2
;
l
++
)
result
[
i
][
j
][
k
]
+=
a
[
i
][
l
]
*
b
[
l
][
j
][
k
];
}
return
result
;
}
friend
Tensor3
<
T
,
N1
,
N2
,
N3
>
operator
+
(
const
Tensor3
<
T
,
N1
,
N2
,
N3
>&
a
,
const
Tensor3
<
T
,
N1
,
N2
,
N3
>&
b
)
friend
Tensor3
<
T
,
N1
,
N2
,
N3
>
operator
+
(
const
Tensor3
<
T
,
N1
,
N2
,
N3
>&
a
,
const
Tensor3
<
T
,
N1
,
N2
,
N3
>&
b
)
{
{
Tensor3
<
T
,
N1
,
N2
,
N3
>
result
;
Tensor3
<
T
,
N1
,
N2
,
N3
>
result
;
...
...
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