27 #include <cuComplex.h> 33 template <
typename ValueType>
35 inline ValueType
cos(ValueType
x){
38 template <
typename ValueType>
40 inline ValueType
sin(ValueType
x){
43 template <
typename ValueType>
45 inline ValueType
tan(ValueType
x){
48 template <
typename ValueType>
50 inline ValueType
acos(ValueType
x){
53 template <
typename ValueType>
55 inline ValueType
asin(ValueType
x){
58 template <
typename ValueType>
60 inline ValueType
atan(ValueType
x){
63 template <
typename ValueType>
65 inline ValueType
atan2(ValueType
x,ValueType
y){
68 template <
typename ValueType>
70 inline ValueType
cosh(ValueType
x){
73 template <
typename ValueType>
75 inline ValueType
sinh(ValueType
x){
78 template <
typename ValueType>
80 inline ValueType
tanh(ValueType
x){
83 template <
typename ValueType>
85 inline ValueType
exp(ValueType
x){
88 template <
typename ValueType>
90 inline ValueType
log(ValueType
x){
93 template <
typename ValueType>
98 template <
typename ValueType,
typename ExponentType>
100 inline ValueType
pow(ValueType
x, ExponentType
e){
103 template <
typename ValueType>
108 template <
typename ValueType>
110 inline ValueType
abs(ValueType
x){
113 template <
typename ValueType>
119 template <
typename ValueType>
struct complex;
120 template <>
struct complex<
float>;
121 template <>
struct complex<
double>;
125 template<
typename ValueType>
127 ValueType
abs(
const complex<ValueType>&
z);
129 template<
typename ValueType>
131 ValueType
arg(
const complex<ValueType>&
z);
133 template<
typename ValueType>
135 ValueType
norm(
const complex<ValueType>&
z);
138 template<
typename ValueType>
140 complex<ValueType>
conj(
const complex<ValueType>&
z);
143 template<
typename ValueType>
145 complex<ValueType>
polar(
const ValueType& m,
const ValueType& theta = 0);
149 template <
typename ValueType>
151 inline complex<ValueType>
operator*(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs);
152 template <
typename ValueType>
154 inline complex<ValueType>
operator*(
const complex<ValueType>& lhs,
const ValueType & rhs);
155 template <
typename ValueType>
157 inline complex<ValueType>
operator*(
const ValueType& lhs,
const complex<ValueType>& rhs);
159 template <
typename ValueType>
161 inline complex<ValueType>
operator/(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs);
170 template <
typename ValueType>
172 inline complex<ValueType>
operator+(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs);
173 template <
typename ValueType>
175 inline complex<ValueType>
operator+(
const complex<ValueType>& lhs,
const ValueType & rhs);
176 template <
typename ValueType>
178 inline complex<ValueType>
operator+(
const ValueType& lhs,
const complex<ValueType>& rhs);
180 template <
typename ValueType>
182 inline complex<ValueType>
operator-(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs);
183 template <
typename ValueType>
185 inline complex<ValueType>
operator-(
const complex<ValueType>& lhs,
const ValueType & rhs);
186 template <
typename ValueType>
188 inline complex<ValueType>
operator-(
const ValueType& lhs,
const complex<ValueType>& rhs);
191 template <
typename ValueType>
193 inline complex<ValueType>
operator+(
const complex<ValueType>& rhs);
194 template <
typename ValueType>
196 inline complex<ValueType>
operator-(
const complex<ValueType>& rhs);
200 template <
typename ValueType>
202 complex<ValueType>
cos(
const complex<ValueType>&
z);
204 template <
typename ValueType>
206 complex<ValueType>
cosh(
const complex<ValueType>&
z);
208 template <
typename ValueType>
210 complex<ValueType>
exp(
const complex<ValueType>&
z);
212 template <
typename ValueType>
214 complex<ValueType>
log(
const complex<ValueType>&
z);
216 template <
typename ValueType>
218 complex<ValueType>
log10(
const complex<ValueType>&
z);
220 template <
typename ValueType>
222 complex<ValueType>
pow(
const complex<ValueType>&
z,
const int&
n);
224 template <
typename ValueType>
226 complex<ValueType>
pow(
const complex<ValueType>&
z,
const ValueType&
x);
228 template <
typename ValueType>
230 complex<ValueType>
pow(
const complex<ValueType>&
z,
const complex<ValueType>&z2);
232 template <
typename ValueType>
234 complex<ValueType>
pow(
const ValueType&
x,
const complex<ValueType>&
z);
236 template <
typename ValueType>
238 complex<ValueType>
sin(
const complex<ValueType>&
z);
240 template <
typename ValueType>
242 complex<ValueType>
sinh(
const complex<ValueType>&
z);
244 template <
typename ValueType>
246 complex<ValueType>
sqrt(
const complex<ValueType>&
z);
248 template <
typename ValueType>
250 complex<ValueType>
tan(
const complex<ValueType>&
z);
252 template <
typename ValueType>
254 complex<ValueType>
tanh(
const complex<ValueType>&
z);
259 template <
typename ValueType>
261 complex<ValueType>
acos(
const complex<ValueType>&
z);
263 template <
typename ValueType>
265 complex<ValueType>
asin(
const complex<ValueType>&
z);
267 template <
typename ValueType>
269 complex<ValueType>
atan(
const complex<ValueType>&
z);
271 template <
typename ValueType>
273 complex<ValueType>
acosh(
const complex<ValueType>&
z);
275 template <
typename ValueType>
277 complex<ValueType>
asinh(
const complex<ValueType>&
z);
279 template <
typename ValueType>
281 complex<ValueType>
atanh(
const complex<ValueType>&
z);
286 template<
typename ValueType,
class charT,
class traits>
287 std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os,
const complex<ValueType>&
z);
288 template<
typename ValueType,
typename charT,
class traits>
289 std::basic_istream<charT, traits>&
290 operator>>(std::basic_istream<charT, traits>& is, complex<ValueType>&
z);
294 template<
typename ValueType,
class charT,
class traits>
295 std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os,
const complex<ValueType>&
z)
297 os <<
'(' <<
z.real() <<
',' <<
z.imag() <<
')';
301 template<
typename ValueType,
typename charT,
class traits>
302 std::basic_istream<charT, traits>&
303 operator>>(std::basic_istream<charT, traits>& is, complex<ValueType>&
z)
318 z = complex<ValueType>(re, im);
322 is.setstate(std::ios_base::failbit);
331 is.setstate(std::ios_base::failbit);
343 template <
typename T>
347 template <
typename T>
352 template <
typename ValueType>
360 inline complex<ValueType>(
const ValueType & re = ValueType(),
const ValueType& im = ValueType())
368 inline complex<ValueType>(
const complex<X> &
z)
376 inline complex<ValueType>(
const std::complex<X> &
z)
382 template <
typename T>
429 __host__ __device__
inline ValueType real()
const volatile;
430 __host__ __device__
inline ValueType imag()
const volatile;
431 __host__ __device__
inline ValueType real()
const;
432 __host__ __device__
inline ValueType imag()
const;
433 __host__ __device__
inline void real(ValueType)
volatile;
434 __host__ __device__
inline void imag(ValueType)
volatile;
435 __host__ __device__
inline void real(ValueType);
436 __host__ __device__
inline void imag(ValueType);
443 struct complex <
float> :
public cuFloatComplex
460 : cuFloatComplex(
z){}
464 : cuFloatComplex(
z){}
474 template <
typename T>
483 template <
typename T>
495 real(real()+
z.real());
496 imag(imag()+
z.imag());
503 real(real()-
z.real());
504 imag(imag()-
z.imag());
537 __host__ __device__
inline float real()
const volatile{
return x; }
538 __host__ __device__
inline float imag()
const volatile{
return y; }
539 __host__ __device__
inline float real()
const{
return x; }
540 __host__ __device__
inline float imag()
const{
return y; }
541 __host__ __device__
inline void real(
float re)
volatile{
x = re; }
542 __host__ __device__
inline void imag(
float im)
volatile{
y = im; }
543 __host__ __device__
inline void real(
float re){
x = re; }
544 __host__ __device__
inline void imag(
float im){
y = im; }
547 inline operator std::complex<float>()
const {
return std::complex<float>(real(),imag()); }
548 template <
typename T>
549 inline __host__ __device__
operator complex<T>()
const {
return complex<T>(
static_cast<T
>(real()),static_cast<T>(imag())); }
554 struct complex <
double> :
public cuDoubleComplex
571 : cuDoubleComplex(
z) {}
575 : cuDoubleComplex(
z) {}
585 template <
typename T>
594 template <
typename T>
606 real(real()+
z.real());
607 imag(imag()+
z.imag());
614 real(real()+
z.real());
615 imag(imag()+
z.imag());
622 real(real()-
z.real());
623 imag(imag()-
z.imag());
656 __host__ __device__
inline double real()
const volatile {
return x; }
657 __host__ __device__
inline double imag()
const volatile {
return y; }
658 __host__ __device__
inline double real()
const {
return x; }
659 __host__ __device__
inline double imag()
const {
return y; }
660 __host__ __device__
inline void real(
double re)
volatile{
x = re; }
661 __host__ __device__
inline void imag(
double im)
volatile{
y = im; }
662 __host__ __device__
inline void real(
double re){
x = re; }
663 __host__ __device__
inline void imag(
double im){
y = im; }
666 inline operator std::complex<double>()
const {
return std::complex<double>(real(),imag()); }
668 template <
typename T>
669 inline __host__ __device__
operator complex<T>()
const {
return complex<T>(
static_cast<T
>(real()),static_cast<T>(imag())); }
677 template<
typename ValueType>
679 inline complex<ValueType>
operator+(
const complex<ValueType>& lhs,
680 const complex<ValueType>& rhs){
681 return complex<ValueType>(lhs.real()+rhs.real(),lhs.imag()+rhs.imag());
685 template<
typename ValueType>
687 inline complex<ValueType>
operator+(
const volatile complex<ValueType>& lhs,
688 const volatile complex<ValueType>& rhs){
689 return complex<ValueType>(lhs.real()+rhs.real(),lhs.imag()+rhs.imag());
693 template <
typename ValueType>
695 inline complex<ValueType>
operator+(
const complex<ValueType>& lhs,
const ValueType & rhs){
696 return complex<ValueType>(lhs.real()+rhs,lhs.imag());
699 template <
typename ValueType>
701 inline complex<ValueType>
operator+(
const ValueType& lhs,
const complex<ValueType>& rhs){
702 return complex<ValueType>(rhs.real()+lhs,rhs.imag());
706 template <
typename ValueType>
708 inline complex<ValueType>
operator-(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs){
709 return complex<ValueType>(lhs.real()-rhs.real(),lhs.imag()-rhs.imag());
712 template <
typename ValueType>
714 inline complex<ValueType>
operator-(
const complex<ValueType>& lhs,
const ValueType & rhs){
715 return complex<ValueType>(lhs.real()-rhs,lhs.imag());
718 template <
typename ValueType>
720 inline complex<ValueType>
operator-(
const ValueType& lhs,
const complex<ValueType>& rhs){
721 return complex<ValueType>(lhs-rhs.real(),-rhs.imag());
725 template <
typename ValueType>
727 inline complex<ValueType>
operator*(
const complex<ValueType>& lhs,
728 const complex<ValueType>& rhs){
729 return complex<ValueType>(lhs.real()*rhs.real()-lhs.imag()*rhs.imag(),
730 lhs.real()*rhs.imag()+lhs.imag()*rhs.real());
734 template <
typename ValueType>
736 inline complex<ValueType>
operator*(
const complex<ValueType>& lhs,
const ValueType & rhs){
737 return complex<ValueType>(lhs.real()*rhs,lhs.imag()*rhs);
741 template <
typename ValueType>
743 inline complex<ValueType>
operator*(
const ValueType& lhs,
const complex<ValueType>& rhs){
744 return complex<ValueType>(rhs.real()*lhs,rhs.imag()*lhs);
749 template <
typename ValueType>
751 inline complex<ValueType>
operator/(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs){
752 const ValueType cross_norm = lhs.real() * rhs.real() + lhs.imag() * rhs.imag();
753 const ValueType rhs_norm =
norm(rhs);
754 return complex<ValueType>(cross_norm/rhs_norm,
755 (lhs.imag() * rhs.real() - lhs.real() * rhs.imag()) / rhs_norm);
761 return cuCdivf(lhs,rhs);
767 return cuCdiv(lhs,rhs);
770 template <
typename ValueType>
772 inline complex<ValueType>
operator/(
const complex<ValueType>& lhs,
const ValueType & rhs){
773 return complex<ValueType>(lhs.real()/rhs,lhs.imag()/rhs);
777 template <
typename ValueType>
779 inline complex<ValueType>
operator/(
const ValueType& lhs,
const complex<ValueType>& rhs){
780 const ValueType cross_norm = lhs * rhs.real();
781 const ValueType rhs_norm =
norm(rhs);
782 return complex<ValueType>(cross_norm/rhs_norm,(-lhs.real() * rhs.imag()) / rhs_norm);
798 template <
typename ValueType>
800 inline complex<ValueType>
operator+(
const complex<ValueType>& rhs){
803 template <
typename ValueType>
805 inline complex<ValueType>
operator-(
const complex<ValueType>& rhs){
806 return rhs*-ValueType(1);
810 template <
typename ValueType>
812 inline bool operator==(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs){
813 if(lhs.real() == rhs.real() && lhs.imag() == rhs.imag()){
819 template <
typename ValueType>
821 inline bool operator==(
const ValueType & lhs,
const complex<ValueType>& rhs){
822 if(lhs == rhs.real() && rhs.imag() == 0){
827 template <
typename ValueType>
829 inline bool operator==(
const complex<ValueType> & lhs,
const ValueType& rhs){
830 if(lhs.real() == rhs && lhs.imag() == 0){
837 template <
typename ValueType>
839 inline bool operator!=(
const complex<ValueType>& lhs,
const complex<ValueType>& rhs){
840 return !(lhs == rhs);
843 template <
typename ValueType>
845 inline bool operator!=(
const ValueType & lhs,
const complex<ValueType>& rhs){
846 return !(lhs == rhs);
849 template <
typename ValueType>
851 inline bool operator!=(
const complex<ValueType> & lhs,
const ValueType& rhs){
852 return !(lhs == rhs);
856 template <
typename ValueType>
858 inline complex<ValueType>
conj(
const complex<ValueType>&
z){
859 return complex<ValueType>(
z.real(),-
z.imag());
862 template <
typename ValueType>
864 inline ValueType
abs(
const complex<ValueType>&
z){
878 template <
typename ValueType>
880 inline ValueType
arg(
const complex<ValueType>&
z){
881 return atan2(
z.imag(),
z.real());
891 return atan2(
z.imag(),
z.real());
894 template <
typename ValueType>
896 inline ValueType
norm(
const complex<ValueType>&
z){
897 return z.real()*
z.real() +
z.imag()*
z.imag();
900 template <
typename ValueType>
902 inline complex<ValueType>
polar(
const ValueType & m,
const ValueType & theta){
903 return complex<ValueType>(m *
::cos(theta),m *
::sin(theta));
919 template <
typename ValueType>
921 inline complex<ValueType>
cos(
const complex<ValueType>&
z){
922 const ValueType re =
z.real();
923 const ValueType im =
z.imag();
930 const float re =
z.real();
931 const float im =
z.imag();
935 template <
typename ValueType>
937 inline complex<ValueType>
cosh(
const complex<ValueType>&
z){
938 const ValueType re =
z.real();
939 const ValueType im =
z.imag();
946 const float re =
z.real();
947 const float im =
z.imag();
952 template <
typename ValueType>
954 inline complex<ValueType>
exp(
const complex<ValueType>&
z){
964 template <
typename ValueType>
966 inline complex<ValueType>
log(
const complex<ValueType>&
z){
977 template <
typename ValueType>
979 inline complex<ValueType>
log10(
const complex<ValueType>&
z){
982 return log(
z)/ValueType(2.30258509299404568402);
986 template <
typename ValueType>
988 inline complex<ValueType>
pow(
const complex<ValueType>&
z,
const ValueType & exponent){
992 template <
typename ValueType>
994 inline complex<ValueType>
pow(
const complex<ValueType>&
z,
const complex<ValueType> & exponent){
998 template <
typename ValueType>
1000 inline complex<ValueType>
pow(
const ValueType &
x,
const complex<ValueType> & exponent){
1001 return exp(::
log(
x)*exponent);
1010 template <
typename ValueType>
1012 inline complex<ValueType>
pow(
const complex<ValueType>&
z,
const int & exponent){
1013 return exp(
log(
z)*ValueType(exponent));
1016 template <
typename ValueType>
1018 inline complex<ValueType>
sin(
const complex<ValueType>&
z){
1019 const ValueType re =
z.real();
1020 const ValueType im =
z.imag();
1027 const float re =
z.real();
1028 const float im =
z.imag();
1032 template <
typename ValueType>
1034 inline complex<ValueType>
sinh(
const complex<ValueType>&
z){
1035 const ValueType re =
z.real();
1036 const ValueType im =
z.imag();
1043 const float re =
z.real();
1044 const float im =
z.imag();
1048 template <
typename ValueType>
1050 inline complex<ValueType>
sqrt(
const complex<ValueType>&
z){
1054 template <
typename ValueType>
1060 template <
typename ValueType>
1062 inline complex<ValueType>
tan(
const complex<ValueType>&
z){
1066 template <
typename ValueType>
1068 inline complex<ValueType>
tanh(
const complex<ValueType>&
z){
1070 return (
exp(ValueType(2)*
z)-ValueType(1))/(
exp(ValueType(2)*
z)+ValueType(1));
1076 template <
typename ValueType>
1078 inline complex<ValueType>
acos(
const complex<ValueType>&
z){
1079 const complex<ValueType>
ret =
asin(
z);
1080 return complex<ValueType>(ValueType(M_PI/2.0) -
ret.real(),-
ret.imag());
1083 template <
typename ValueType>
1085 inline complex<ValueType>
asin(
const complex<ValueType>&
z){
1086 const complex<ValueType>
i(0,1);
1090 template <
typename ValueType>
1092 inline complex<ValueType>
atan(
const complex<ValueType>&
z){
1093 const complex<ValueType>
i(0,1);
1097 template <
typename ValueType>
1099 inline complex<ValueType>
acosh(
const complex<ValueType>&
z){
1100 quda::complex<ValueType>
ret((
z.real() -
z.imag()) * (
z.real() +
z.imag()) - ValueType(1.0),
1101 ValueType(2.0) *
z.real() *
z.imag());
1103 if (
z.real() < ValueType(0.0)){
1108 if (
ret.real() < ValueType(0.0)){
1122 template <
typename ValueType>
1124 inline complex<ValueType>
asinh(
const complex<ValueType>&
z){
1128 template <
typename ValueType>
1130 inline complex<ValueType>
atanh(
const complex<ValueType>&
z){
1131 ValueType imag2 =
z.imag() *
z.imag();
1132 ValueType
n = ValueType(1.0) +
z.real();
1135 ValueType
d = ValueType(1.0) -
z.real();
1137 complex<ValueType>
ret(ValueType(0.25) * (::
log(
n) - ::
log(
d)),0);
1139 d = ValueType(1.0) -
z.real() *
z.real() - imag2;
1141 ret.imag(ValueType(0.5) * ::
atan2(ValueType(2.0) *
z.imag(),
d));
1146 template <
typename ValueType>
1149 float imag2 =
z.imag() *
z.imag();
1150 float n =
float(1.0) +
z.real();
1153 float d =
float(1.0) -
z.real();
1157 d =
float(1.0) -
z.real() *
z.real() - imag2;
1159 ret.imag(
float(0.5) * ::
atan2f(
float(2.0) *
z.imag(),
d));
__host__ __device__ complex< float > sinh(const complex< float > &z)
__host__ __device__ ValueType tanh(ValueType x)
__host__ __device__ ValueType sinh(ValueType x)
__host__ __device__ complex< float > & operator-=(const complex< float > z)
__host__ __device__ complex< double > & operator=(const complex< T > z)
__host__ __device__ ValueType norm(const complex< ValueType > &z)
Returns the magnitude of z squared.
__host__ __device__ complex< double > & operator+=(const complex< float > z)
__host__ __device__ ValueType atan(ValueType x)
__host__ __device__ complex< double > & operator-=(const complex< double > z)
__host__ __device__ ValueType exp(ValueType x)
__host__ __device__ complex< float > & operator*=(const complex< float > z)
__host__ __device__ ValueType cosh(ValueType x)
__host__ __device__ void real(double re) volatile
__host__ __device__ ValueType sqrt(ValueType x)
__host__ __device__ complex< float > cosh(const complex< float > &z)
__host__ __device__ void real(float re)
__host__ __device__ ValueType imag() const volatile
__host__ __device__ complex< ValueType > tanh(const complex< ValueType > &z)
__host__ __device__ void imag(float im)
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, complex< ValueType > &z)
__host__ __device__ double imag() const
__host__ __device__ ValueType tan(ValueType x)
__host__ __device__ void imag(double im) volatile
__host__ __device__ complex< ValueType > & operator+=(const complex< ValueType > z)
__host__ __device__ void real(float re) volatile
__host__ __device__ complex< float > & operator=(const complex< T > z)
__host__ __device__ complex< ValueType > tan(const complex< ValueType > &z)
__host__ __device__ complex< ValueType > & operator-=(const complex< ValueType > z)
__host__ __device__ complex< ValueType > & operator*=(const complex< ValueType > z)
__host__ __device__ complex< ValueType > asin(const complex< ValueType > &z)
__host__ __device__ void imag(float im) volatile
__host__ __device__ ValueType sin(ValueType x)
__host__ __device__ complex< ValueType > acos(const complex< ValueType > &z)
float atan2f(float, float)
__host__ __device__ complex< float > sin(const complex< float > &z)
__host__ __device__ void real(double re)
__host__ __device__ ValueType atan2(ValueType x, ValueType y)
__device__ __host__ ColorSpinor< Float, Nc, Ns > operator-(const ColorSpinor< Float, Nc, Ns > &x, const ColorSpinor< Float, Nc, Ns > &y)
ColorSpinor subtraction operator.
__host__ __device__ complex< float > cos(const complex< float > &z)
__host__ __device__ ValueType pow(ValueType x, ExponentType e)
__host__ __device__ void imag(double im)
__host__ __device__ float imag() const volatile
__host__ __device__ ValueType real() const volatile
__host__ __device__ complex< float > & operator/=(const complex< float > z)
__host__ __device__ float real() const
__host__ __device__ complex< float > exp(const complex< float > &z)
__host__ __device__ complex< float > log(const complex< float > &z)
__host__ __device__ complex< double > & operator/=(const complex< double > z)
__host__ __device__ complex< ValueType > log10(const complex< ValueType > &z)
__host__ __device__ complex< ValueType > & operator/=(const complex< ValueType > z)
__host__ __device__ complex< ValueType > asinh(const complex< ValueType > &z)
__host__ __device__ complex< ValueType > & operator*=(const ValueType z)
__host__ __device__ complex< ValueType > & operator=(const complex< T > z)
__host__ __device__ ValueType log(ValueType x)
__host__ __device__ double imag() const volatile
__host__ __device__ complex< float > & operator*=(const float z)
__host__ __device__ complex< ValueType > operator/(const complex< ValueType > &lhs, const complex< ValueType > &rhs)
__host__ __device__ volatile complex< float > & operator=(const complex< T > z) volatile
__host__ __device__ ValueType log10(ValueType x)
double hypot(double, double)
__host__ __device__ double abs(const complex< double > &z)
__device__ __host__ ColorSpinor< Float, Nc, Ns > operator+(const ColorSpinor< Float, Nc, Ns > &x, const ColorSpinor< Float, Nc, Ns > &y)
ColorSpinor addition operator.
__host__ __device__ complex< double > & operator*=(const double z)
__host__ __device__ complex< ValueType > atan(const complex< ValueType > &z)
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
__host__ __device__ complex< float > sqrt(const complex< float > &z)
__host__ __device__ double real() const
__host__ __device__ ValueType cos(ValueType x)
__host__ __device__ complex< ValueType > polar(const ValueType &m, const ValueType &theta=0)
Returns the complex with magnitude m and angle theta in radians.
__host__ __device__ ValueType abs(ValueType x)
__device__ __host__ ColorSpinor< Float, Nc, Ns > operator*(const S &a, const ColorSpinor< Float, Nc, Ns > &x)
Compute the scalar-vector product y = a * x.
__host__ __device__ ValueType acos(ValueType x)
__host__ __device__ complex< float > pow(const float &x, const complex< float > &exponent)
__host__ __device__ ValueType conj(ValueType x)
__host__ __device__ complex< double > & operator*=(const complex< double > z)
static __inline__ size_t size_t d
float hypotf(float, float)
__host__ __device__ bool operator!=(const complex< ValueType > &lhs, const complex< ValueType > &rhs)
__host__ __device__ complex< ValueType > atanh(const complex< ValueType > &z)
__host__ __device__ float imag() const
__host__ __device__ complex< float > & operator+=(const complex< float > z)
__host__ __device__ volatile complex< double > & operator=(const complex< T > z) volatile
__host__ __device__ double real() const volatile
__host__ __device__ float real() const volatile
__host__ __device__ complex< ValueType > acosh(const complex< ValueType > &z)
__host__ __device__ bool operator==(const complex< ValueType > &lhs, const complex< ValueType > &rhs)
__host__ __device__ ValueType asin(ValueType x)
__host__ __device__ complex< double > & operator+=(const complex< double > z)