SUNphi  1.0
Compl.hpp
Go to the documentation of this file.
1 #ifndef _COMPL_HPP
2 #define _COMPL_HPP
3 
4 /// \file Compl.hpp
5 ///
6 /// \brief Header file for the definition of complex numbers
7 
8 #include <tens/TensComp.hpp>
9 #include <smet/Bind.hpp>
10 
11 namespace SUNphi
12 {
13  // Define complex number tens comp
15 
16  /// Index of the real part of a \c Compl
18  0;
19 
20  /// Returns a reference to the real part
21  template <typename T> // Type of variable to be bound
22  DECLAUTO real(T&& ref) // Variable to be bound
23  {
24  return reIm(forw<T>(ref),REAL_PART_ID);
25  }
26 
27  /// Index of the imag part of a \c Compl
29  1;
30 
31  /// Returns a reference to the imag part
32  template <typename T> // Type of variable to be bound
33  DECLAUTO imag(T&& ref) // Variable to be bound
34  {
35  return reIm(forw<T>(ref),IMAG_PART_ID);
36  }
37 }
38 
39 #endif
decltype(auto) reIm(T &&ref, const int id)
Definition: Compl.hpp:14
decltype(auto) real(T &&ref)
Returns a reference to the real part.
Definition: Compl.hpp:22
decltype(auto) operator+(T1 &&smet1, T2 &&smet2)
Implement smet1+smet2.
Definition: Add.hpp:87
#define DECLAUTO
Short name for decltype(auto)
decltype(auto) imag(T &&ref)
Returns a reference to the imag part.
Definition: Compl.hpp:33
#define DEFINE_TENS_COMP(BINDER,TYPE,CONST_NAME,HMANY)
Definition: TensComp.hpp:73