v0.14.0
Public Member Functions | Private Attributes | List of all members
FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j > Class Template Reference

#include <src/ftensor/src/FTensor/Tensor2/Tensor2_Expr.hpp>

Collaboration diagram for FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >:
[legend]

Public Member Functions

 Tensor2_Expr (Tensor2< A, Tensor_Dim0, Tensor_Dim1 > &a)
 
T & operator() (const int N1, const int N2)
 
operator() (const int N1, const int N2) const
 
T * ptr (const int N1, const int N2) const
 
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto & equals (const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &rhs)
 
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto & operator= (const FTensor::Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &rhs)
 
auto & operator= (const Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j > &rhs)
 
template<class B , class U , int Dim, char i_1, char j_1>
auto & equals (const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &rhs)
 
template<class B , class U , int Dim, char i_1, char j_1>
auto & operator= (const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &rhs)
 
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto & operator+= (const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &rhs)
 
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto & operator-= (const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &rhs)
 
template<class B , class U , int Dim, char i_1, char j_1>
auto & operator+= (const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &rhs)
 
template<class B , class U , int Dim, char i_1, char j_1>
auto & operator-= (const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &rhs)
 
template<class U >
auto & operator= (const U &u)
 
template<class U >
auto & operator+= (const U &u)
 
template<class U >
auto & operator-= (const U &u)
 
template<class U >
auto & operator*= (const U &u)
 
template<class U >
auto & operator/= (const U &u)
 
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto & operator<<= (const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &rhs)
 
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto & operator>>= (const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &rhs)
 

Private Attributes

Tensor2< A, Tensor_Dim0, Tensor_Dim1 > & iter
 

Detailed Description

template<class A, class T, int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
class FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >

Definition at line 37 of file Tensor2_Expr.hpp.

Constructor & Destructor Documentation

◆ Tensor2_Expr()

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::Tensor2_Expr ( Tensor2< A, Tensor_Dim0, Tensor_Dim1 > &  a)
inline

Definition at line 42 of file Tensor2_Expr.hpp.

42 : iter(a) {}

Member Function Documentation

◆ equals() [1/2]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::equals ( const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &  rhs)
inline

Definition at line 52 of file Tensor2_Expr.hpp.

53  {
54  for(int ii = 0; ii < Dim0; ++ii)
55  for(int jj = 0; jj < Dim1; ++jj)
56  {
57  iter(ii, jj) = permute(*this, rhs, ii, jj);
58  }
59  return *this;
60  }

◆ equals() [2/2]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::equals ( const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &  rhs)
inline

Definition at line 76 of file Tensor2_Expr.hpp.

76  {
77  for (int ii = 0; ii != Dim; ++ii)
78  for (int jj = 0; jj != Dim; ++jj) {
79  iter(ii, jj) = rhs(ii, jj);
80  }
81  return *this;
82  }

◆ operator()() [1/2]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
T& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator() ( const int  N1,
const int  N2 
)
inline

Definition at line 43 of file Tensor2_Expr.hpp.

43 { return iter(N1, N2); }

◆ operator()() [2/2]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
T FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator() ( const int  N1,
const int  N2 
) const
inline

Definition at line 44 of file Tensor2_Expr.hpp.

44 { return iter(N1, N2); }

◆ operator*=()

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class U >
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator*= ( const U &  u)
inline

Definition at line 161 of file Tensor2_Expr.hpp.

162  {
163  for(int ii = 0; ii < Dim0; ++ii)
164  for(int jj = 0; jj < Dim1; ++jj)
165  {
166  iter(ii, jj) *= u;
167  }
168  return *this;
169  }

◆ operator+=() [1/3]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator+= ( const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &  rhs)
inline

Definition at line 90 of file Tensor2_Expr.hpp.

91  {
92  for(int ii = 0; ii < Dim0; ++ii)
93  for(int jj = 0; jj < Dim1; ++jj)
94  {
95  iter(ii, jj) += permute(*this, rhs, ii, jj);
96  }
97  return *this;
98  }

◆ operator+=() [2/3]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator+= ( const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &  rhs)
inline

Definition at line 112 of file Tensor2_Expr.hpp.

112  {
113  for (int ii = 0; ii != Dim; ++ii)
114  for (int jj = 0; jj != Dim; ++jj) {
115  iter(ii, jj) += rhs(ii, jj);
116  }
117  return *this;
118  }

◆ operator+=() [3/3]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class U >
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator+= ( const U &  u)
inline

Definition at line 141 of file Tensor2_Expr.hpp.

142  {
143  for(int ii = 0; ii < Dim0; ++ii)
144  for(int jj = 0; jj < Dim1; ++jj)
145  {
146  iter(ii, jj) += u;
147  }
148  return *this;
149  }

◆ operator-=() [1/3]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator-= ( const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &  rhs)
inline

Definition at line 101 of file Tensor2_Expr.hpp.

102  {
103  for(int ii = 0; ii < Dim0; ++ii)
104  for(int jj = 0; jj < Dim1; ++jj)
105  {
106  iter(ii, jj) -= permute(*this, rhs, ii, jj);
107  }
108  return *this;
109  }

◆ operator-=() [2/3]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator-= ( const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &  rhs)
inline

Definition at line 121 of file Tensor2_Expr.hpp.

121  {
122  for (int ii = 0; ii != Dim; ++ii)
123  for (int jj = 0; jj != Dim; ++jj) {
124  iter(ii, jj) -= rhs(ii, jj);
125  }
126  return *this;
127  }

◆ operator-=() [3/3]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class U >
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator-= ( const U &  u)
inline

Definition at line 151 of file Tensor2_Expr.hpp.

152  {
153  for(int ii = 0; ii < Dim0; ++ii)
154  for(int jj = 0; jj < Dim1; ++jj)
155  {
156  iter(ii, jj) -= u;
157  }
158  return *this;
159  }

◆ operator/=()

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class U >
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator/= ( const U &  u)
inline

Definition at line 171 of file Tensor2_Expr.hpp.

172  {
173  for(int ii = 0; ii < Dim0; ++ii)
174  for(int jj = 0; jj < Dim1; ++jj)
175  {
176  iter(ii, jj) /= u;
177  }
178  return *this;
179  }

◆ operator<<=()

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator<<= ( const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &  rhs)
inline

Definition at line 184 of file Tensor2_Expr.hpp.

185  {
186  for(int ii = 0; ii < Dim0; ++ii)
187  for(int jj = 0; jj < Dim1; ++jj)
188  {
189  iter(ii, jj) <<= permute(*this, rhs, ii, jj);
190  }
191  return *this;
192  }

◆ operator=() [1/4]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator= ( const FTensor::Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &  rhs)
inline

Definition at line 64 of file Tensor2_Expr.hpp.

65  {
66  return equals(rhs);
67  }

◆ operator=() [2/4]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator= ( const Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j > &  rhs)
inline

Definition at line 69 of file Tensor2_Expr.hpp.

71  {
72  return equals(rhs);
73  }

◆ operator=() [3/4]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator= ( const Tensor2_symmetric_Expr< B, U, Dim, i_1, j_1 > &  rhs)
inline

Definition at line 85 of file Tensor2_Expr.hpp.

85  {
86  return equals(rhs);
87  }

◆ operator=() [4/4]

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class U >
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator= ( const U &  u)
inline

Definition at line 131 of file Tensor2_Expr.hpp.

132  {
133  for(int ii = 0; ii < Dim0; ++ii)
134  for(int jj = 0; jj < Dim1; ++jj)
135  {
136  iter(ii, jj) = u;
137  }
138  return *this;
139  }

◆ operator>>=()

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
template<class B , class U , int Dim1_0, int Dim1_1, char i_1, char j_1>
auto& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::operator>>= ( const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &  rhs)
inline

Definition at line 195 of file Tensor2_Expr.hpp.

196  {
197  for(int ii = 0; ii < Dim0; ++ii)
198  for(int jj = 0; jj < Dim1; ++jj)
199  {
200  iter(ii, jj) >>= permute_ref(*this, rhs, ii, jj);
201  }
202  return *this;
203  }

◆ ptr()

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
T* FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::ptr ( const int  N1,
const int  N2 
) const
inline

Definition at line 45 of file Tensor2_Expr.hpp.

45 { return iter.ptr(N1, N2); }

Member Data Documentation

◆ iter

template<class A , class T , int Tensor_Dim0, int Tensor_Dim1, int Dim0, int Dim1, char i, char j>
Tensor2<A, Tensor_Dim0, Tensor_Dim1>& FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::iter
private

Definition at line 39 of file Tensor2_Expr.hpp.


The documentation for this class was generated from the following file:
FTensor::permute_ref
U & permute_ref(const Tensor2_Expr< A, T, Dim0_0, Dim0_1, i0, j0 > &, const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i1, j1 > &rhs, const int N0, const int N1)
Definition: permute.hpp:66
FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::iter
Tensor2< A, Tensor_Dim0, Tensor_Dim1 > & iter
Definition: Tensor2_Expr.hpp:39
FTensor::permute
U permute(const Tensor2_Expr< A, T, Dim0_0, Dim0_1, i0, j0 > &, const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i1, j1 > &rhs, const int N0, const int N1)
Definition: permute.hpp:11
a
constexpr double a
Definition: approx_sphere.cpp:30
FTensor::Tensor2_Expr< Tensor2< A, Tensor_Dim0, Tensor_Dim1 >, T, Dim0, Dim1, i, j >::equals
auto & equals(const Tensor2_Expr< B, U, Dim1_0, Dim1_1, i_1, j_1 > &rhs)
Definition: Tensor2_Expr.hpp:52
FTensor::Tensor2::ptr
T * ptr(const int N1, const int N2) const
Definition: Tensor2_value.hpp:33