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

#include <src/ftensor/src/FTensor/Tensor1/Tensor1_pointer.hpp>

Inheritance diagram for FTensor::Tensor1< T *, Tensor_Dim >:
[legend]
Collaboration diagram for FTensor::Tensor1< T *, Tensor_Dim >:
[legend]

Public Member Functions

 Tensor1 (T *d0, const int i=1)
 
 Tensor1 (T *d0, T *d1, const int i=1)
 
 Tensor1 (T *d0, T *d1, T *d2, const int i=1)
 
 Tensor1 (T *d0, T *d1, T *d2, T *d3, const int i=1)
 
 Tensor1 (T *d0, T *d1, T *d2, T *d3, T *d4, T *d5, const int i=1)
 
template<class... U>
 Tensor1 (U *... d)
 
template<class U >
 Tensor1 (std::array< U *, Tensor_Dim > &a, const int i=1)
 
 Tensor1 (const int i=1)
 
Toperator() (const int N)
 
T operator() (const int N) const
 
Tptr (const int N) const
 
T *& ptr (const int N)
 
template<char i, int Dim>
Tensor1_Expr< Tensor1< T *, Tensor_Dim >, T, Dim, ioperator() (const Index< i, Dim > &index)
 
template<char i, int Dim>
Tensor1_Expr< const Tensor1< T *, Tensor_Dim >, T, Dim, ioperator() (const Index< i, Dim > &index) const
 
const Tensor1operator++ () const
 

Protected Attributes

const int inc
 
T *restrict data [Tensor_Dim]
 

Private Member Functions

template<int I>
 Tensor1 (const Tensor1< PackPtr< T *, I >, Tensor_Dim > &)=delete
 Preventing casting on derived class. More...
 

Detailed Description

template<class T, int Tensor_Dim>
class FTensor::Tensor1< T *, Tensor_Dim >

Definition at line 9 of file Tensor1_pointer.hpp.

Constructor & Destructor Documentation

◆ Tensor1() [1/9]

template<class T , int Tensor_Dim>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( T d0,
const int  i = 1 
)
inline

Definition at line 24 of file Tensor1_pointer.hpp.

24 : inc(i) {
25 Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0);
26 }
FTensor::Index< 'i', SPACE_DIM > i

◆ Tensor1() [2/9]

template<class T , int Tensor_Dim>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( T d0,
T d1,
const int  i = 1 
)
inline

Definition at line 27 of file Tensor1_pointer.hpp.

27 : inc(i) {
28 Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0, d1);
29 }

◆ Tensor1() [3/9]

template<class T , int Tensor_Dim>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( T d0,
T d1,
T d2,
const int  i = 1 
)
inline

Definition at line 30 of file Tensor1_pointer.hpp.

30 : inc(i) {
31 Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0, d1, d2);
32 }

◆ Tensor1() [4/9]

template<class T , int Tensor_Dim>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( T d0,
T d1,
T d2,
T d3,
const int  i = 1 
)
inline

Definition at line 33 of file Tensor1_pointer.hpp.

33 : inc(i) {
34 Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0, d1, d2, d3);
35 }
static constexpr std::array< double, 3 > d3

◆ Tensor1() [5/9]

template<class T , int Tensor_Dim>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( T d0,
T d1,
T d2,
T d3,
T d4,
T d5,
const int  i = 1 
)
inline

Definition at line 36 of file Tensor1_pointer.hpp.

36 : inc(i) {
37 Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0, d1, d2, d3, d4, d5);
38 }
static constexpr std::array< double, 3 > d4

◆ Tensor1() [6/9]

template<class T , int Tensor_Dim>
template<class... U>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( U *...  d)
inline

Definition at line 40 of file Tensor1_pointer.hpp.

40: 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

◆ Tensor1() [7/9]

template<class T , int Tensor_Dim>
template<class U >
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( std::array< U *, Tensor_Dim > &  a,
const int  i = 1 
)
inline

Definition at line 44 of file Tensor1_pointer.hpp.

44 : inc(i) {
45 std::copy(a.begin(), a.end(), data);
46 }
constexpr double a

◆ Tensor1() [8/9]

template<class T , int Tensor_Dim>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( const int  i = 1)
inline

Definition at line 48 of file Tensor1_pointer.hpp.

48: inc(i) {}

◆ Tensor1() [9/9]

template<class T , int Tensor_Dim>
template<int I>
FTensor::Tensor1< T *, Tensor_Dim >::Tensor1 ( const Tensor1< PackPtr< T *, I >, Tensor_Dim > &  )
privatedelete

Preventing casting on derived class.

That can be source of errors

Member Function Documentation

◆ operator()() [1/4]

template<class T , int Tensor_Dim>
template<char i, int Dim>
Tensor1_Expr< Tensor1< T *, Tensor_Dim >, T, Dim, i > FTensor::Tensor1< T *, Tensor_Dim >::operator() ( const Index< i, Dim > &  index)
inline

Definition at line 111 of file Tensor1_pointer.hpp.

112 {
113 return Tensor1_Expr<Tensor1<T *, Tensor_Dim>, T, Dim, i>(*this);
114 }
const double T

◆ operator()() [2/4]

template<class T , int Tensor_Dim>
template<char i, int Dim>
Tensor1_Expr< const Tensor1< T *, Tensor_Dim >, T, Dim, i > FTensor::Tensor1< T *, Tensor_Dim >::operator() ( const Index< i, Dim > &  index) const
inline

Definition at line 118 of file Tensor1_pointer.hpp.

119 {
120 return Tensor1_Expr<const Tensor1<T *, Tensor_Dim>, T, Dim, i>(*this);
121 }

◆ operator()() [3/4]

template<class T , int Tensor_Dim>
T & FTensor::Tensor1< T *, Tensor_Dim >::operator() ( const int  N)
inline

Definition at line 53 of file Tensor1_pointer.hpp.

53 {
54#ifdef FTENSOR_DEBUG
55 if(N >= Tensor_Dim || N < 0)
56 {
57 std::stringstream s;
58 s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.operator(" << N
59 << ")" << std::endl;
60 throw std::out_of_range(s.str());
61 }
62#endif
63 return *data[N];
64 }
const int N
Definition: speed_test.cpp:3

◆ operator()() [4/4]

template<class T , int Tensor_Dim>
T FTensor::Tensor1< T *, Tensor_Dim >::operator() ( const int  N) const
inline

Definition at line 65 of file Tensor1_pointer.hpp.

66 {
67#ifdef FTENSOR_DEBUG
68 if(N >= Tensor_Dim || N < 0)
69 {
70 std::stringstream s;
71 s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.operator(" << N
72 << ") const" << std::endl;
73 throw std::out_of_range(s.str());
74 }
75#endif
76 return *data[N];
77 }

◆ operator++()

template<class T , int Tensor_Dim>
const Tensor1 & FTensor::Tensor1< T *, Tensor_Dim >::operator++ ( ) const
inline

Definition at line 126 of file Tensor1_pointer.hpp.

127 {
128 for(int i = 0; i < Tensor_Dim; ++i)
129 data[i] += inc;
130 return *this;
131 }

◆ ptr() [1/2]

template<class T , int Tensor_Dim>
T *& FTensor::Tensor1< T *, Tensor_Dim >::ptr ( const int  N)
inline

Definition at line 92 of file Tensor1_pointer.hpp.

92 {
93#ifdef FTENSOR_DEBUG
94 if (N >= Tensor_Dim || N < 0) {
95 std::stringstream s;
96 s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.ptr(" << N << ")"
97 << std::endl;
98 throw std::out_of_range(s.str());
99 }
100#endif
101 return data[N];
102 }

◆ ptr() [2/2]

template<class T , int Tensor_Dim>
T * FTensor::Tensor1< T *, Tensor_Dim >::ptr ( const int  N) const
inline

Definition at line 78 of file Tensor1_pointer.hpp.

79 {
80#ifdef FTENSOR_DEBUG
81 if(N >= Tensor_Dim || N < 0)
82 {
83 std::stringstream s;
84 s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.ptr(" << N << ")"
85 << std::endl;
86 throw std::out_of_range(s.str());
87 }
88#endif
89 return data[N];
90 }

Member Data Documentation

◆ data

template<class T , int Tensor_Dim>
T* restrict FTensor::Tensor1< T *, Tensor_Dim >::data[Tensor_Dim]
mutableprotected

Definition at line 17 of file Tensor1_pointer.hpp.

◆ inc

template<class T , int Tensor_Dim>
const int FTensor::Tensor1< T *, Tensor_Dim >::inc
protected

Definition at line 12 of file Tensor1_pointer.hpp.


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