kopia lustrzana https://github.com/f4exb/sdrangel
DATV demod: apply commit90c280f03339fe173baf2f908c37135b9b4c05bd Add complex ops.
rodzic
8f46029457
commit
d0f97d0a5c
|
@ -45,6 +45,11 @@ struct complex
|
||||||
im = re * c.im + im * c.re;
|
im = re * c.im + im * c.re;
|
||||||
re = tre;
|
re = tre;
|
||||||
}
|
}
|
||||||
|
inline void operator-=(const complex<T> &x)
|
||||||
|
{
|
||||||
|
re-=x.re;
|
||||||
|
im-=x.im;
|
||||||
|
}
|
||||||
inline void operator*=(const T &k)
|
inline void operator*=(const T &k)
|
||||||
{
|
{
|
||||||
re *= k;
|
re *= k;
|
||||||
|
@ -58,6 +63,11 @@ complex<T> operator+(const complex<T> &a, const complex<T> &b)
|
||||||
return complex<T>(a.re + b.re, a.im + b.im);
|
return complex<T>(a.re + b.re, a.im + b.im);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
complex<T> operator -(const complex<T> &a, const complex<T> &b) {
|
||||||
|
return complex<T>(a.re - b.re, a.im - b.im);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
complex<T> operator*(const complex<T> &a, const complex<T> &b)
|
complex<T> operator*(const complex<T> &a, const complex<T> &b)
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue