v0.8.3
Public Member Functions | Private Attributes | List of all members
FTensor::Tensor1< PackPtr< T *, I >, Tensor_Dim > Class Template Reference

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

Public Member Functions

template<class... U>
 Tensor1 (U *... d)
 
 Tensor1 ()
 
T & operator() (const int N)
 
operator() (const int N) const
 
T * ptr (const int N) const
 
template<char i, int Dim>
Tensor1_Expr< Tensor1< PackPtr< T *, I >, Tensor_Dim >, T, Dim, i > operator() (const Index< i, Dim > &index)
 
template<char i, int Dim>
Tensor1_Expr< const Tensor1< PackPtr< T *, I >, Tensor_Dim >, T, Dim, i > operator() (const Index< i, Dim > &index) const
 
const Tensor1operator++ () const
 

Private Attributes

T *restrict data [Tensor_Dim]
 

Detailed Description

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

Definition at line 9 of file Tensor1_pointer.hpp.

Constructor & Destructor Documentation

◆ Tensor1() [1/2]

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

Definition at line 18 of file Tensor1_pointer.hpp.

18  : data{d...}
19  {
20  static_assert(sizeof...(d) == sizeof(data) / sizeof(T),
21  "Incorrect number of Arguments. Constructor should "
22  "initialize the entire Tensor");
23  }
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() [2/2]

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

Definition at line 25 of file Tensor1_pointer.hpp.

25 {}

Member Function Documentation

◆ operator()() [1/4]

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

Definition at line 30 of file Tensor1_pointer.hpp.

31  {
32 #ifdef FTENSOR_DEBUG
33  if(N >= Tensor_Dim || N < 0)
34  {
35  std::stringstream s;
36  s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.operator(" << N
37  << ")" << std::endl;
38  throw std::out_of_range(s.str());
39  }
40 #endif
41  return *data[N];
42  }
const int N
Definition: speed_test.cpp:3

◆ operator()() [2/4]

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

Definition at line 43 of file Tensor1_pointer.hpp.

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

◆ operator()() [3/4]

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

Definition at line 77 of file Tensor1_pointer.hpp.

78  {
79  return Tensor1_Expr<Tensor1<PackPtr<T *, I>, Tensor_Dim>, T, Dim, i>(*this);
80  }

◆ operator()() [4/4]

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

Definition at line 84 of file Tensor1_pointer.hpp.

85  {
86  return Tensor1_Expr<const Tensor1<PackPtr<T *, I>, Tensor_Dim>, T, Dim, i>(*this);
87  }

◆ operator++()

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

Definition at line 92 of file Tensor1_pointer.hpp.

93  {
94  for(int i = 0; i < Tensor_Dim; ++i)
95  data[i] += I;
96  return *this;
97  }

◆ ptr()

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

Definition at line 56 of file Tensor1_pointer.hpp.

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

Member Data Documentation

◆ data

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

Definition at line 14 of file Tensor1_pointer.hpp.


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