v0.14.0
Loading...
Searching...
No Matches
Ddg_times_generic.hpp
Go to the documentation of this file.
1/* Multiplies a Ddg with a generic, yielding a
2 Ddg. */
3
4#pragma once
5
6namespace FTensor
7{
8 template <class A, class T, class U, int Dim01, int Dim23, char i, char j,
9 char k, char l>
10 auto
12 {
13 auto TensorExpr
14 = [&a, &d0](const int N1, const int N2, const int N3, const int N4) {
15 return a(N1, N2, N3, N4) * d0;
16 };
17 return Ddg_Expr<decltype(TensorExpr), typename promote<T, U>::V, Dim01,
18 Dim23, i, j, k, l>(TensorExpr);
19 }
20
21 template <class A, class T, class U, int Dim01, int Dim23, char i, char j,
22 char k, char l>
23 auto
25 {
26 auto TensorExpr
27 = [&a, &d0](const int N1, const int N2, const int N3, const int N4) {
28 return d0 * a(N1, N2, N3, N4);
29 };
30 return Ddg_Expr<decltype(TensorExpr), typename promote<T, U>::V, Dim01,
31 Dim23, i, j, k, l>(TensorExpr);
32 }
33
34 template <class A, class T, class U, int Dim01, int Dim23, char i, char j,
35 char k, char l>
37 const U &d0) {
38 auto TensorExpr
39 = [&a, &d0](const int N1, const int N2, const int N3, const int N4) {
40 return a(N1, N2, N3, N4) / d0;
41 };
42 return Ddg_Expr<decltype(TensorExpr), typename promote<T, U>::V, Dim01,
43 Dim23, i, j, k, l>(TensorExpr);
44 }
45
46}
static Number< 2 > N2
static Number< 1 > N1
constexpr double a
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
const double T
Tensors class implemented by Walter Landry.
Definition FTensor.hpp:51
promote< T, U >::V operator*(const Ddg_Expr< A, T, Dim, Dim, i, j, k, l > &a, const Ddg_Expr< B, U, Dim, Dim, i, k, j, l > &b)
auto operator/(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const U &d0)
constexpr AssemblyType A