Mercurial > hg > x
comparison xcomplex.h @ 10:c6528c38b23c
a few minor fixes
author | Wen X <xue.wen@elec.qmul.ac.uk> |
---|---|
date | Thu, 28 Jul 2011 10:36:57 +0100 |
parents | 5f3c32dc6e17 |
children | 977f541d6683 |
comparison
equal
deleted
inserted
replaced
9:91301b3d02c5 | 10:c6528c38b23c |
---|---|
24 | 24 |
25 T real(){return x;} | 25 T real(){return x;} |
26 T imag(){return y;} | 26 T imag(){return y;} |
27 | 27 |
28 cmplx<T>& operator=(const T& c){x=c; y=0; return *this;} | 28 cmplx<T>& operator=(const T& c){x=c; y=0; return *this;} |
29 template<class X> cmplx<T>& operator+=(const X& c){x+=c; y=0; return *this;} | 29 template<class X> cmplx<T>& operator+=(const X& c){x+=c; return *this;} |
30 template<class X> cmplx<T>& operator-=(const X& c){x-=c; y=0; return *this;} | 30 template<class X> cmplx<T>& operator-=(const X& c){x-=c; return *this;} |
31 template<class X> cmplx<T>& operator*=(const X& c){x*=c; y*=c; return *this;} | 31 template<class X> cmplx<T>& operator*=(const X& c){x*=c; y*=c; return *this;} |
32 template<class X> cmplx<T>& operator/=(const X& c){x/=c; y/=c; return *this;} | 32 template<class X> cmplx<T>& operator/=(const X& c){x/=c; y/=c; return *this;} |
33 template<class X> cmplx<T>& operator=(const cmplx<X>& c){x=c.x; y=c.y; return* this;} | 33 template<class X> cmplx<T>& operator=(const cmplx<X>& c){x=c.x; y=c.y; return* this;} |
34 | 34 |
35 template<class X> cmplx<T>& operator+=(const cmplx<X>& c){x+=c.x; y+=c.y; return *this;} | 35 template<class X> cmplx<T>& operator+=(const cmplx<X>& c){x+=c.x; y+=c.y; return *this;} |