v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > Class Template Reference

#include <src/ftensor/src/FTensor/Tensor3/Tensor3_pointer.hpp>

Inheritance diagram for FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >:
[legend]
Collaboration diagram for FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >:
[legend]

Public Member Functions

 Tensor3 ()
 
 Tensor3 (T *d000, T *d001, T *d010, T *d011, T *d100, T *d101, T *d110, T *d111, const int i)
 
 Tensor3 (T *d000, T *d001, T *d002, T *d010, T *d011, T *d012, T *d020, T *d021, T *d022, T *d100, T *d101, T *d102, T *d110, T *d111, T *d112, T *d120, T *d121, T *d122, T *d200, T *d201, T *d202, T *d210, T *d211, T *d212, T *d220, T *d221, T *d222, const int i)
 
 Tensor3 (T *d000, T *d001, T *d002, T *d003, T *d010, T *d011, T *d012, T *d013, T *d020, T *d021, T *d022, T *d023, T *d030, T *d031, T *d032, T *d033, T *d100, T *d101, T *d102, T *d103, T *d110, T *d111, T *d112, T *d113, T *d120, T *d121, T *d122, T *d123, T *d130, T *d131, T *d132, T *d133, T *d200, T *d201, T *d202, T *d203, T *d210, T *d211, T *d212, T *d213, T *d220, T *d221, T *d222, T *d223, T *d230, T *d231, T *d232, T *d233, T *d300, T *d301, T *d302, T *d303, T *d310, T *d311, T *d312, T *d313, T *d320, T *d321, T *d322, T *d323, T *d330, T *d331, T *d332, T *d333, const int i)
 
template<class... U>
 Tensor3 (U *...d)
 
template<class U >
 Tensor3 (std::array< U *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 > &a, const int i=1)
 
Toperator() (const int N1, const int N2, const int N3)
 
T operator() (const int N1, const int N2, const int N3) const
 
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr< Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >, T, Dim0, Dim1, Dim2, i, j, koperator() (const Index< i, Dim0 >, const Index< j, Dim1 >, const Index< k, Dim2 >)
 
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr< const Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >, T, Dim0, Dim1, Dim2, i, j, koperator() (const Index< i, Dim0 >, const Index< j, Dim1 >, const Index< k, Dim2 >) const
 
template<int Current_Dim0, int Current_Dim1, int Current_Dim2>
void increment (const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &) const
 
const Tensor3operator++ () const
 

Protected Attributes

T *restrict data [Tensor_Dim0][Tensor_Dim1][Tensor_Dim2]
 

Private Member Functions

template<int I>
 Tensor3 (const Tensor3< PackPtr< T *, I >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > &)=delete
 

Private Attributes

const int inc
 

Detailed Description

template<class T, int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
class FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >

Definition at line 45 of file Tensor3_pointer.hpp.

Constructor & Destructor Documentation

◆ Tensor3() [1/7]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( )
inline

Definition at line 52 of file Tensor3_pointer.hpp.

52{}

◆ Tensor3() [2/7]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( T d000,
T d001,
T d010,
T d011,
T d100,
T d101,
T d110,
T d111,
const int  i 
)
inline

Definition at line 55 of file Tensor3_pointer.hpp.

57 : inc(i) {
58 Tensor3_constructor<T *restrict, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(
59 data, d000, d001, d010, d011, d100, d101, d110, d111);
60 }
T *restrict data[Tensor_Dim0][Tensor_Dim1][Tensor_Dim2]
FTensor::Index< 'i', SPACE_DIM > i

◆ Tensor3() [3/7]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( T d000,
T d001,
T d002,
T d010,
T d011,
T d012,
T d020,
T d021,
T d022,
T d100,
T d101,
T d102,
T d110,
T d111,
T d112,
T d120,
T d121,
T d122,
T d200,
T d201,
T d202,
T d210,
T d211,
T d212,
T d220,
T d221,
T d222,
const int  i 
)
inline

Definition at line 63 of file Tensor3_pointer.hpp.

67 : inc(i) {
68 Tensor3_constructor<T *restrict, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(
69 data, d000, d001, d002, d010, d011, d012, d020, d021, d022, d100, d101,
70 d102, d110, d111, d112, d120, d121, d122, d200, d201, d202, d210, d211,
71 d212, d220, d221, d222);
72 }

◆ Tensor3() [4/7]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( T d000,
T d001,
T d002,
T d003,
T d010,
T d011,
T d012,
T d013,
T d020,
T d021,
T d022,
T d023,
T d030,
T d031,
T d032,
T d033,
T d100,
T d101,
T d102,
T d103,
T d110,
T d111,
T d112,
T d113,
T d120,
T d121,
T d122,
T d123,
T d130,
T d131,
T d132,
T d133,
T d200,
T d201,
T d202,
T d203,
T d210,
T d211,
T d212,
T d213,
T d220,
T d221,
T d222,
T d223,
T d230,
T d231,
T d232,
T d233,
T d300,
T d301,
T d302,
T d303,
T d310,
T d311,
T d312,
T d313,
T d320,
T d321,
T d322,
T d323,
T d330,
T d331,
T d332,
T d333,
const int  i 
)
inline

Definition at line 75 of file Tensor3_pointer.hpp.

90 : inc(i) {
91 Tensor3_constructor<T *restrict, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(
92 data, d000, d001, d002, d003, d010, d011, d012, d013, d020, d021, d022,
93 d023, d030, d031, d032, d033,
94
95 d100, d101, d102, d103, d110, d111, d112, d113, d120, d121, d122, d123,
96 d130, d131, d132, d133,
97
98 d200, d201, d202, d203, d210, d211, d212, d213, d220, d221, d222, d223,
99 d230, d231, d232, d233,
100
101 d300, d301, d302, d303, d310, d311, d312, d313, d320, d321, d322, d323,
102 d330, d331, d332, d333);
103 }

◆ Tensor3() [5/7]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<class... U>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( U *...  d)
inline

Definition at line 106 of file Tensor3_pointer.hpp.

106: data{d...}, inc(1) {}
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27

◆ Tensor3() [6/7]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<class U >
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( std::array< U *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 > &  a,
const int  i = 1 
)
inline

Definition at line 109 of file Tensor3_pointer.hpp.

111 : inc(i) {
112 int l = 0;
113 for (int i = 0; i != Tensor_Dim0; ++i) {
114 for (int j = 0; j != Tensor_Dim1; ++j) {
115 for (int k = 0; k != Tensor_Dim2; ++k, ++l) {
116 data[i][j][k] = a[l];
117 }
118 }
119 }
120 }
constexpr double a
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k

◆ Tensor3() [7/7]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<int I>
FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::Tensor3 ( const Tensor3< PackPtr< T *, I >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > &  )
privatedelete

Member Function Documentation

◆ increment()

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<int Current_Dim0, int Current_Dim1, int Current_Dim2>
void FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::increment ( const Number< Current_Dim0 > &  ,
const Number< Current_Dim1 > &  ,
const Number< Current_Dim2 > &   
) const
inline

Definition at line 178 of file Tensor3_pointer.hpp.

180 {
181 data[Current_Dim0 - 1][Current_Dim1 - 1][Current_Dim2 - 1] += inc;
182 }

◆ operator()() [1/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr< Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >, T, Dim0, Dim1, Dim2, i, j, k > FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >  ,
const Index< k, Dim2 >   
)
inline

Definition at line 159 of file Tensor3_pointer.hpp.

159 {
160 return Tensor3_Expr<Tensor3<T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>, T,
161 Dim0, Dim1, Dim2, i, j, k>(*this);
162 }
const double T

◆ operator()() [2/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
template<char i, char j, char k, int Dim0, int Dim1, int Dim2>
Tensor3_Expr< const Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >, T, Dim0, Dim1, Dim2, i, j, k > FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const Index< i, Dim0 >  ,
const Index< j, Dim1 >  ,
const Index< k, Dim2 >   
) const
inline

Definition at line 167 of file Tensor3_pointer.hpp.

168 {
169 return Tensor3_Expr<
170 const Tensor3<T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>, T, Dim0,
171 Dim1, Dim2, i, j, k>(*this);
172 }

◆ operator()() [3/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
T & FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const int  N1,
const int  N2,
const int  N3 
)
inline

Definition at line 125 of file Tensor3_pointer.hpp.

125 {
126#ifdef FTENSOR_DEBUG
127 if (N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim1 || N2 < 0 ||
128 N3 >= Tensor_Dim2 || N3 < 0) {
129 std::stringstream s;
130 s << "Bad index in Tensor3<T," << Tensor_Dim0 << "," << Tensor_Dim1 << ","
131 << Tensor_Dim2 << ">.operator(" << N1 << "," << N2 << "," << N3 << ")"
132 << std::endl;
133 throw std::runtime_error(s.str());
134 }
135#endif
136 return *data[N1][N2][N3];
137 }
static Number< 2 > N2
static Number< 1 > N1

◆ operator()() [4/4]

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
T FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator() ( const int  N1,
const int  N2,
const int  N3 
) const
inline

Definition at line 139 of file Tensor3_pointer.hpp.

139 {
140#ifdef FTENSOR_DEBUG
141 if (N1 >= Tensor_Dim0 || N1 < 0 || N2 >= Tensor_Dim1 || N2 < 0 ||
142 N3 >= Tensor_Dim2 || N3 < 0) {
143 std::stringstream s;
144 s << "Bad index in Tensor3<T," << Tensor_Dim0 << "," << Tensor_Dim1 << ","
145 << Tensor_Dim2 << ">.operator(" << N1 << "," << N2 << "," << N3
146 << ") const" << std::endl;
147 throw std::runtime_error(s.str());
148 }
149#endif
150 return *data[N1][N2][N3];
151 }

◆ operator++()

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
const Tensor3 & FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::operator++ ( ) const
inline

Definition at line 184 of file Tensor3_pointer.hpp.

184 {
185 T3_increment(*this, Number<Tensor_Dim0>(), Number<Tensor_Dim1>(),
186 Number<Tensor_Dim2>());
187 return *this;
188 }
void T3_increment(const Tensor3< T, Dim0, Dim1, Dim2 > &iter, const Number< Current_Dim0 > &, const Number< Current_Dim1 > &, const Number< Current_Dim2 > &)

Member Data Documentation

◆ data

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
T* restrict FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::data[Tensor_Dim0][Tensor_Dim1][Tensor_Dim2]
mutableprotected

Definition at line 49 of file Tensor3_pointer.hpp.

◆ inc

template<class T , int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
const int FTensor::Tensor3< T *, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 >::inc
private

Definition at line 46 of file Tensor3_pointer.hpp.


The documentation for this class was generated from the following file: