v0.8.13
Public Member Functions | Protected Attributes | Private Attributes | 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, 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)
 
template<class... U>
 Tensor1 (U *... d)
 
 Tensor1 (const int i=1)
 
Toperator() (const int N)
 
T operator() (const int N) const
 
Tptr (const int N) const
 
template<char i, int Dim>
Tensor1_Expr< Tensor1< T *, Tensor_Dim >, T, Dim, i > operator() (const Index< i, Dim > &index)
 
template<char i, int Dim>
Tensor1_Expr< const Tensor1< T *, Tensor_Dim >, T, Dim, i > operator() (const Index< i, Dim > &index) const
 
const Tensor1operator++ () const
 

Protected Attributes

T *restrict data [Tensor_Dim]
 

Private Attributes

const int inc
 

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/5]

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

Definition at line 24 of file Tensor1_pointer.hpp.

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

◆ Tensor1() [2/5]

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

Definition at line 27 of file Tensor1_pointer.hpp.

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

◆ Tensor1() [3/5]

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

Definition at line 30 of file Tensor1_pointer.hpp.

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

◆ Tensor1() [4/5]

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

Definition at line 34 of file Tensor1_pointer.hpp.

34 : 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() [5/5]

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

Definition at line 36 of file Tensor1_pointer.hpp.

Member Function Documentation

◆ operator()() [1/4]

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

Definition at line 41 of file Tensor1_pointer.hpp.

41  {
42 #ifdef FTENSOR_DEBUG
43  if(N >= Tensor_Dim || N < 0)
44  {
45  std::stringstream s;
46  s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.operator(" << N
47  << ")" << std::endl;
48  throw std::out_of_range(s.str());
49  }
50 #endif
51  return *data[N];
52  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [2/4]

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

Definition at line 53 of file Tensor1_pointer.hpp.

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

◆ operator()() [3/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)

Definition at line 87 of file Tensor1_pointer.hpp.

88  {
89  return Tensor1_Expr<Tensor1<T *, Tensor_Dim>, T, Dim, i>(*this);
90  }

◆ operator()() [4/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

Definition at line 94 of file Tensor1_pointer.hpp.

95  {
96  return Tensor1_Expr<const Tensor1<T *, Tensor_Dim>, T, Dim, i>(*this);
97  }

◆ operator++()

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

Definition at line 102 of file Tensor1_pointer.hpp.

103  {
104  for(int i = 0; i < Tensor_Dim; ++i)
105  data[i] += inc;
106  return *this;
107  }

◆ ptr()

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

Definition at line 66 of file Tensor1_pointer.hpp.

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

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
private

Definition at line 10 of file Tensor1_pointer.hpp.


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