Пример #1
0
 HDINLINE explicit Complex(const Complex<T_OtherType >& other) :
     real( static_cast<T_Type> (other.get_real()) ),
     imaginary( static_cast<T_Type> (other.get_imag()) ) { }
Пример #2
0
HDINLINE Complex<T_Type>
operator/(const Complex<T_Type>& lhs, const T_Type& rhs)
{
    return Complex<T_Type>(lhs.get_real() / rhs, lhs.get_imag() / rhs);
}
Пример #3
0
HDINLINE Complex<T_Type>
operator/(const Complex<T_Type>& lhs, const Complex<T_Type>& rhs)
{
    return lhs*Complex<T_Type>(rhs.get_real()/(rhs.get_real()*rhs.get_real()+rhs.get_imag()*rhs.get_imag()),
                               -rhs.get_imag()/( rhs.get_real()*rhs.get_real()+rhs.get_imag()*rhs.get_imag() ));
}
Пример #4
0
HDINLINE Complex<T_Type>
operator*(const T_Type& lhs, const Complex<T_Type>& rhs)
{
    return Complex<T_Type>(lhs * rhs.get_real(), lhs * rhs.get_imag());
}