Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
54c91841
Commit
54c91841
authored
Apr 03, 2018
by
Praetorius, Simon
Browse files
missing file added
parent
98c0ebbe
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/amdis/operations/CMakeLists.txt
View file @
54c91841
...
...
@@ -5,6 +5,7 @@ install(FILES
Basic.hpp
CMath.hpp
Composer.hpp
Composer.impl.hpp
FieldMatVec.hpp
MaxMin.hpp
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/amdis/operations
)
src/amdis/operations/Composer.impl.hpp
0 → 100644
View file @
54c91841
#pragma once
#include
<amdis/operations/Composer.hpp>
#include
<amdis/operations/Arithmetic.hpp>
namespace
AMDiS
{
namespace
Operation
{
/// Partial derivative of composed function:
/// Implements: // sum_i [ d_i(f)[g...] * d_j(g_i) ]
template
<
int
J
,
class
F
,
class
...
Gs
>
auto
partial
(
Composer
<
F
,
Gs
...
>
const
&
c
,
index_t
<
J
>
_j
)
{
auto
index_seq
=
MakeSeq_t
<
sizeof
...(
Gs
)
>
{};
// d_i(f)[g...] * d_j(g_i)
auto
term_i
=
[
&
](
auto
const
_i
)
{
auto
di_f
=
Dune
::
Std
::
apply
([
&
](
auto
const
&
...
gs
)
{
return
compose
(
partial
(
c
.
f_
,
_i
),
gs
...);
},
c
.
gs_
);
auto
const
&
g_i
=
std
::
get
<
_i
>
(
c
.
gs_
);
return
compose
(
Multiplies
{},
di_f
,
partial
(
g_i
,
_j
));
};
// sum_i [ d_i(f)[g...] * d_j(g_i) ]
return
Dune
::
Std
::
apply
([
&
](
auto
const
...
_i
)
{
return
compose
(
Plus
{},
term_i
(
_i
)...);
},
index_seq
);
}
}}
// end namespace AMDiS::Operation
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment