v0.9.0
Tensor2_transform.hpp
Go to the documentation of this file.
1 /* Applies an arbitrary function to the Tensor2_Expr. */
2 
3 #pragma once
4 
5 namespace FTensor
6 {
7  template <class A, class B, class T, int Dim0, int Dim1, char i, char j>
9  {
11  B function;
12 
13  public:
14  T operator()(const int N1, const int N2) const
15  {
16  return function(iterA(N1, N2));
17  }
18 
20  : iterA(a), function(func)
21  {}
22  };
23 
24  template <class A, class B, class T, int Dim0, int Dim1, char i, char j>
25  Tensor2_Expr<transform_Tensor2<A, B, T, Dim0, Dim1, i, j>, T, Dim0, Dim1, i,
26  j>
28  {
31  TensorExpr(a, function));
32  }
33 }
const Tensor2_Expr< A, T, Dim0, Dim1, i, j > iterA
Fully Antisymmetric Levi-Civita Tensor.
transform_Tensor2(const Tensor2_Expr< A, T, Dim0, Dim1, i, j > &a, B func)
Tensor2_Expr< transform_Tensor2< A, B, T, Dim0, Dim1, i, j >, T, Dim0, Dim1, i, j > transform(const Tensor2_Expr< A, T, Dim0, Dim1, i, j > &a, B function)
T operator()(const int N1, const int N2) const