Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
amdis-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
amdis
amdis-core
Commits
35d37669
Commit
35d37669
authored
5 years ago
by
Praetorius, Simon
Browse files
Options
Downloads
Patches
Plain Diff
Added outer product for FieldVector
parent
b374ce9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/amdis/common/FieldMatVec.hpp
+3
-0
3 additions, 0 deletions
src/amdis/common/FieldMatVec.hpp
src/amdis/common/FieldMatVec.inc.hpp
+12
-0
12 additions, 0 deletions
src/amdis/common/FieldMatVec.inc.hpp
with
15 additions
and
0 deletions
src/amdis/common/FieldMatVec.hpp
+
3
−
0
View file @
35d37669
...
...
@@ -367,6 +367,9 @@ namespace Dune
template
<
class
T
,
class
S
,
int
N
,
int
M
,
int
K
>
auto
outer
(
FieldMatrix
<
T
,
N
,
K
>
const
&
vec1
,
FieldMatrix
<
S
,
M
,
K
>
const
&
vec2
);
template
<
class
T
,
class
S
,
int
N
,
int
M
>
auto
outer
(
FieldVector
<
T
,
N
>
const
&
vec1
,
FieldVector
<
S
,
M
>
const
&
vec2
);
// ----------------------------------------------------------------------------
template
<
class
T
>
...
...
This diff is collapsed.
Click to expand it.
src/amdis/common/FieldMatVec.inc.hpp
+
12
−
0
View file @
35d37669
...
...
@@ -422,6 +422,18 @@ auto outer(FieldMatrix<T,N,K> const& vec1, FieldMatrix<S,M,K> const& vec2)
return
mat
;
}
/// Outer product (vec1 * vec2^T)
template
<
class
T
,
class
S
,
int
N
,
int
M
>
auto
outer
(
FieldVector
<
T
,
N
>
const
&
vec1
,
FieldVector
<
S
,
M
>
const
&
vec2
)
{
using
result_type
=
FieldMatrix
<
TYPEOF
(
std
::
declval
<
T
>
()
*
std
::
declval
<
S
>
()
),
N
,
M
>
;
result_type
mat
;
for
(
int
i
=
0
;
i
<
N
;
++
i
)
for
(
int
j
=
0
;
j
<
M
;
++
j
)
mat
[
i
][
j
]
=
vec1
[
i
]
*
vec2
[
j
];
return
mat
;
}
// ----------------------------------------------------------------------------
template
<
class
T
>
...
...
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