v0.14.0
Tensor1_minus_generic.hpp
Go to the documentation of this file.
1 /* Subtracts a Tensor1 from a generic (or vice versa), yielding a
2  Tensor1. Usually used for doubles, but could be used for complex,
3  etc. All that it requires is that you can add an element of the
4  Tensor1 to it. */
5 
6 /* A(i) - d0 -> Tensor1 */
7 
8 #pragma once
9 
10 namespace 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  {
34  using TensorExpr = Tensor1_minus_generic<A, T, U, Dim, i>;
36  TensorExpr(a, d0));
37  }
38 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1_minus_generic::operator()
promote< T, U >::V operator()(const int N) const
Definition: Tensor1_minus_generic.hpp:19
FTensor::Tensor1_minus_generic::iterA
Tensor1_Expr< A, T, Dim, i > iterA
Definition: Tensor1_minus_generic.hpp:15
FTensor::Tensor1_minus_generic::d
U d
Definition: Tensor1_minus_generic.hpp:16
FTensor::Tensor1_Expr
Definition: Tensor1_Expr.hpp:27
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::promote::V
T1 V
Definition: promote.hpp:17
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
N
const int N
Definition: speed_test.cpp:3
FTensor::Tensor1_minus_generic
Definition: Tensor1_minus_generic.hpp:13
Tensor1_Expr
Definition: single.cpp:11
FTensor::operator-
Ddg_Expr< Ddg_minus_Ddg< A, B, T, U, Dim01, Dim23, i, j, k, l >, typename promote< T, U >::V, Dim01, Dim23, i, j, k, l > operator-(const Ddg_Expr< A, T, Dim01, Dim23, i, j, k, l > &a, const Ddg_Expr< B, U, Dim01, Dim23, i, j, k, l > &b)
Definition: Ddg_minus_Ddg.hpp:33
FTensor::Tensor1_minus_generic::Tensor1_minus_generic
Tensor1_minus_generic(const Tensor1_Expr< A, T, Dim, i > &a, const U &d0)
Definition: Tensor1_minus_generic.hpp:24
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:193