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

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

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)
 
 Tensor1 (const int i=1)
 
T & operator() (const int N)
 
operator() (const int N) const
 
T * ptr (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
 

Private Attributes

const int inc
 
T *restrict data [Tensor_Dim]
 

Detailed Description

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

Definition at line 100 of file Tensor1_pointer.hpp.

Constructor & Destructor Documentation

◆ Tensor1() [1/4]

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

Definition at line 114 of file Tensor1_pointer.hpp.

114  : inc(i)
115  {
116  Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0, d1);
117  }

◆ Tensor1() [2/4]

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 118 of file Tensor1_pointer.hpp.

118  : inc(i)
119  {
120  Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0, d1, d2);
121  }

◆ Tensor1() [3/4]

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 122 of file Tensor1_pointer.hpp.

122  : inc(i)
123  {
124  Tensor1_constructor<T * restrict, Tensor_Dim>(data, d0, d1, d2, d3);
125  }

◆ Tensor1() [4/4]

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

Definition at line 126 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 131 of file Tensor1_pointer.hpp.

132  {
133 #ifdef FTENSOR_DEBUG
134  if(N >= Tensor_Dim || N < 0)
135  {
136  std::stringstream s;
137  s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.operator(" << N
138  << ")" << std::endl;
139  throw std::out_of_range(s.str());
140  }
141 #endif
142  return *data[N];
143  }
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 144 of file Tensor1_pointer.hpp.

145  {
146 #ifdef FTENSOR_DEBUG
147  if(N >= Tensor_Dim || N < 0)
148  {
149  std::stringstream s;
150  s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.operator(" << N
151  << ") const" << std::endl;
152  throw std::out_of_range(s.str());
153  }
154 #endif
155  return *data[N];
156  }
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 178 of file Tensor1_pointer.hpp.

179  {
180  return Tensor1_Expr<Tensor1<T *, Tensor_Dim>, T, Dim, i>(*this);
181  }

◆ 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 185 of file Tensor1_pointer.hpp.

186  {
187  return Tensor1_Expr<const Tensor1<T *, Tensor_Dim>, T, Dim, i>(*this);
188  }

◆ operator++()

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

Definition at line 193 of file Tensor1_pointer.hpp.

194  {
195  for(int i = 0; i < Tensor_Dim; ++i)
196  data[i] += inc;
197  return *this;
198  }

◆ ptr()

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

Definition at line 157 of file Tensor1_pointer.hpp.

158  {
159 #ifdef FTENSOR_DEBUG
160  if(N >= Tensor_Dim || N < 0)
161  {
162  std::stringstream s;
163  s << "Bad index in Tensor1<T*," << Tensor_Dim << ">.ptr(" << N << ")"
164  << std::endl;
165  throw std::out_of_range(s.str());
166  }
167 #endif
168  return data[N];
169  }
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]
mutableprivate

Definition at line 107 of file Tensor1_pointer.hpp.

◆ inc

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

Definition at line 102 of file Tensor1_pointer.hpp.


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