v0.14.0
Tensor1_plus_Tensor1.hpp
Go to the documentation of this file.
1 /* Adds two Tensor1's together, yielding a Tensor1. */
2 
3 #pragma once
4 
5 namespace FTensor
6 {
7  template <class A, class B, class T, class U, int Dim, char i>
9  {
12 
13  public:
14  typename promote<T, U>::V operator()(const int N) const
15  {
16  return iterA(N) + iterB(N);
17  }
18 
21  : iterA(a), iterB(b)
22  {}
23  };
24 
25  template <class A, class B, class T, class U, char i, int Dim>
27  typename promote<T, U>::V, Dim, i>
30  {
33  TensorExpr(a, b));
34  }
35 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1_plus_Tensor1::Tensor1_plus_Tensor1
Tensor1_plus_Tensor1(const Tensor1_Expr< A, T, Dim, i > &a, const Tensor1_Expr< B, U, Dim, i > &b)
Definition: Tensor1_plus_Tensor1.hpp:19
FTensor::Tensor1_Expr
Definition: Tensor1_Expr.hpp:27
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Tensor1_plus_Tensor1::iterB
Tensor1_Expr< B, U, Dim, i > iterB
Definition: Tensor1_plus_Tensor1.hpp:11
FTensor::promote::V
T1 V
Definition: promote.hpp:17
FTensor::Tensor1_plus_Tensor1
Definition: Tensor1_plus_Tensor1.hpp:8
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
N
const int N
Definition: speed_test.cpp:3
Tensor1_Expr
Definition: single.cpp:11
FTensor::operator+
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)
Definition: Ddg_plus_Ddg.hpp:66
FTensor::Tensor1_plus_Tensor1::iterA
Tensor1_Expr< A, T, Dim, i > iterA
Definition: Tensor1_plus_Tensor1.hpp:10
FTensor::Tensor1_plus_Tensor1::operator()
promote< T, U >::V operator()(const int N) const
Definition: Tensor1_plus_Tensor1.hpp:14