v0.14.0
src
ftensor
src
FTensor
Tensor1
Tensor1_minus_Tensor1.hpp
Go to the documentation of this file.
1
/* Subtracts a Tensor1 from a Tensor1, 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>
8
class
Tensor1_minus_Tensor1
9
{
10
Tensor1_Expr<A, T, Dim, i>
iterA
;
11
Tensor1_Expr<B, U, Dim, i>
iterB
;
12
13
public
:
14
typename
promote<T, U>::V
operator()
(
const
int
N
)
const
15
{
16
return
iterA
(
N
) -
iterB
(
N
);
17
}
18
19
Tensor1_minus_Tensor1
(
const
Tensor1_Expr<A, T, Dim, i>
&
a
,
20
const
Tensor1_Expr<B, U, Dim, i>
&b)
21
:
iterA
(
a
),
iterB
(b)
22
{}
23
};
24
25
template
<
class
A,
class
B,
class
T,
class
U,
char
i,
int
Dim>
26
Tensor1_Expr<Tensor1_minus_Tensor1<A, B, T, U, Dim, i>
,
27
typename
promote<T, U>::V
, Dim,
i
>
28
operator-
(
const
Tensor1_Expr<A, T, Dim, i>
&
a
,
29
const
Tensor1_Expr<B, U, Dim, i>
&b)
30
{
31
using
TensorExpr =
Tensor1_minus_Tensor1<A, B, T, U, Dim, i>
;
32
return
Tensor1_Expr<TensorExpr, typename promote<T, U>::V
, Dim,
i
>(
33
TensorExpr(
a
, b));
34
}
35
}
FTensor
JSON compatible output.
Definition:
Christof_constructor.hpp:6
FTensor::Tensor1_minus_Tensor1::operator()
promote< T, U >::V operator()(const int N) const
Definition:
Tensor1_minus_Tensor1.hpp:14
FTensor::Tensor1_minus_Tensor1::iterA
Tensor1_Expr< A, T, Dim, i > iterA
Definition:
Tensor1_minus_Tensor1.hpp:10
FTensor::Tensor1_minus_Tensor1::Tensor1_minus_Tensor1
Tensor1_minus_Tensor1(const Tensor1_Expr< A, T, Dim, i > &a, const Tensor1_Expr< B, U, Dim, i > &b)
Definition:
Tensor1_minus_Tensor1.hpp:19
FTensor::Tensor1_Expr
Definition:
Tensor1_Expr.hpp:27
a
constexpr double a
Definition:
approx_sphere.cpp:30
FTensor::Tensor1_minus_Tensor1
Definition:
Tensor1_minus_Tensor1.hpp:8
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
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_Tensor1::iterB
Tensor1_Expr< B, U, Dim, i > iterB
Definition:
Tensor1_minus_Tensor1.hpp:11
Generated by
Doxygen
1.8.17 and hosted at