v0.13.2
Loading...
Searching...
No Matches
Tensor1_plus_generic.hpp
Go to the documentation of this file.
1/* Adds a Tensor1 to a generic (or vice versa), yielding a Tensor1.
2 Usually used for doubles, but could be used for complex, etc. All
3 that it requires is that you can add an element of the Tensor1 to
4 it. */
5
6/* A(i) + d0 -> Tensor1 */
7
8#pragma once
9
10namespace FTensor
11{
12 template <class A, class T, class U, int Dim, char i>
14 {
16 U d;
17
18 public:
19 typename promote<T, U>::V operator()(const int N) const
20 {
21 return iterA(N) + d;
22 }
23
25 : iterA(a), d(d0)
26 {}
27 };
28
29 template <class A, class T, class U, int Dim, char i>
31 typename promote<T, U>::V, Dim, i>
33 {
36 TensorExpr(a, d0));
37 }
38
39 /* d0 + A(i) -> Tensor1 */
40
41 template <class A, class T, class U, int Dim, char i>
43 typename promote<T, U>::V, Dim, i>
45 {
48 TensorExpr(a, d0));
49 }
50}
constexpr double a
Tensor1_plus_generic(const Tensor1_Expr< A, T, Dim, i > &a, const U &d0)
Tensor1_Expr< A, T, Dim, i > iterA
promote< T, U >::V operator()(const int N) const
FTensor::Index< 'i', SPACE_DIM > i
Tensors class implemented by Walter Landry.
Definition: FTensor.hpp:51
Ddg_Expr< Ddg_plus_Ddg< A, B, T, U, Dim01_0, Dim23_0, Dim01_1, Dim23_1, i0, j0, k0, l0, i1, j1, k1, l1 >, typename promote< T, U >::V, Dim01_0, Dim23_0, i0, j0, k0, l0 > operator+(const Ddg_Expr< A, T, Dim01_0, Dim23_0, i0, j0, k0, l0 > &a, const Ddg_Expr< B, U, Dim01_1, Dim23_1, i1, j1, k1, l1 > &b)
const int N
Definition: speed_test.cpp:3