v0.5.86
Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
Tensor1< T, Tensor_Dim > Class Template Reference

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

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

Public Member Functions

 Tensor1 (T d0, T d1)
 
 Tensor1 (T d0, T d1, T d2)
 
 Tensor1 (T d0, T d1, T d2, T d3)
 
 Tensor1 ()
 
T & operator() (const int N)
 
operator() (const int N) const
 
template<char i, int Dim>
Tensor1_Expr< Tensor1< T, Tensor_Dim >, T, Dim, i > operator() (const Index< i, Dim > &)
 
template<char i, int Dim>
Tensor1_Expr< const Tensor1< T, Tensor_Dim >, T, Dim, i > operator() (const Index< i, Dim > &) const
 
 Tensor1 (double d0, double d1, double d2)
 
doubleoperator() (const int N)
 
double operator() (const int N) const
 
template<char i>
Tensor1_Expr< Tensor1, i > operator() (const Index< i > index)
 

Public Attributes

double data0
 
double data1
 
double data2
 

Private Attributes

data [Tensor_Dim]
 

Friends

ostream & operator<< (ostream &s, const Tensor1 &a)
 

Detailed Description

template<class T, int Tensor_Dim>
class Tensor1< T, Tensor_Dim >

Definition at line 4 of file Tensor1_value.hpp.

Constructor & Destructor Documentation

◆ Tensor1() [1/5]

template<class T, int Tensor_Dim>
Tensor1< T, Tensor_Dim >::Tensor1 ( d0,
d1 
)

Definition at line 12 of file Tensor1_value.hpp.

◆ Tensor1() [2/5]

template<class T, int Tensor_Dim>
Tensor1< T, Tensor_Dim >::Tensor1 ( d0,
d1,
d2 
)

Definition at line 16 of file Tensor1_value.hpp.

17  {
19  }
T data[Tensor_Dim]

◆ Tensor1() [3/5]

template<class T, int Tensor_Dim>
Tensor1< T, Tensor_Dim >::Tensor1 ( d0,
d1,
d2,
d3 
)

Definition at line 20 of file Tensor1_value.hpp.

21  {
23  }
T data[Tensor_Dim]

◆ Tensor1() [4/5]

template<class T, int Tensor_Dim>
Tensor1< T, Tensor_Dim >::Tensor1 ( )

Definition at line 25 of file Tensor1_value.hpp.

25 {}

◆ Tensor1() [5/5]

template<class T, int Tensor_Dim>
Tensor1< T, Tensor_Dim >::Tensor1 ( double  d0,
double  d1,
double  d2 
)

Definition at line 52 of file single.cpp.

52 : data0(d0), data1(d1), data2(d2) {}
double data1
Definition: single.cpp:50
double data0
Definition: single.cpp:50
double data2
Definition: single.cpp:50

Member Function Documentation

◆ operator()() [1/7]

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

Definition at line 30 of file Tensor1_value.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
37  << ">.operator(" << N << ")" << std::endl;
38  throw std::runtime_error(s.str());
39  }
40 #endif
41  return data[N];
42  }
T data[Tensor_Dim]
const int N
Definition: speed_test.cpp:3

◆ operator()() [2/7]

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

Definition at line 43 of file Tensor1_value.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
50  << ">.operator(" << N << ") const" << std::endl;
51  throw std::runtime_error(s.str());
52  }
53 #endif
54  return data[N];
55  }
T data[Tensor_Dim]
const int N
Definition: speed_test.cpp:3

◆ operator()() [3/7]

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

Definition at line 53 of file single.cpp.

54  {
55  return N==0 ? data0 : (N==1 ? data1 : data2);
56  }
double data1
Definition: single.cpp:50
double data0
Definition: single.cpp:50
double data2
Definition: single.cpp:50

◆ operator()() [4/7]

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

Definition at line 58 of file single.cpp.

59  {
60  return N==0 ? data0 : (N==1 ? data1 : data2);
61  }
double data1
Definition: single.cpp:50
double data0
Definition: single.cpp:50
double data2
Definition: single.cpp:50

◆ operator()() [5/7]

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

Definition at line 64 of file Tensor1_value.hpp.

65  {
66  return Tensor1_Expr<Tensor1<T,Tensor_Dim>,T,Dim,i>(*this);
67  }

◆ operator()() [6/7]

template<class T, int Tensor_Dim>
template<char i>
Tensor1_Expr<Tensor1,i> Tensor1< T, Tensor_Dim >::operator() ( const Index< i >  index)

Definition at line 64 of file single.cpp.

65  {
66  return Tensor1_Expr<Tensor1,i>(this);
67  }

◆ operator()() [7/7]

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

Definition at line 71 of file Tensor1_value.hpp.

72  {
73  return Tensor1_Expr<const Tensor1<T,Tensor_Dim>,T,Dim,i>(*this);
74  }

Friends And Related Function Documentation

◆ operator<<

template<class T, int Tensor_Dim>
ostream& operator<< ( ostream &  s,
const Tensor1< T, Tensor_Dim > &  a 
)
friend

Definition at line 72 of file single.cpp.

73 {
74  return s << a.data0 << " " << a.data1 << " " << a.data2 << " ";
75 }
double data1
Definition: single.cpp:50
double data0
Definition: single.cpp:50
double data2
Definition: single.cpp:50

Member Data Documentation

◆ data

template<class T, int Tensor_Dim>
T Tensor1< T, Tensor_Dim >::data[Tensor_Dim]
private

Definition at line 6 of file Tensor1_value.hpp.

◆ data0

template<class T, int Tensor_Dim>
double Tensor1< T, Tensor_Dim >::data0

Definition at line 50 of file single.cpp.

◆ data1

template<class T, int Tensor_Dim>
double Tensor1< T, Tensor_Dim >::data1

Definition at line 50 of file single.cpp.

◆ data2

template<class T, int Tensor_Dim>
double Tensor1< T, Tensor_Dim >::data2

Definition at line 50 of file single.cpp.


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