#ifndef COMPLEX_H #define COMPLEX_H /* Collaborating Class Declarations */ /* Base Class Headers */ /* C++ Headers */ #include using namespace std; /* ====================================================================== */ /* Class Complex Interface */ template class Complex{ public: /* Constructor */ Complex(const T& re=T(), const T& im=T()) ; /* Operations */ T re() const; T im() const; T mod() const; T mod2() const; Complex coniugate() const; Complex inverse() const; private: T theReal, theImag; }; //somma template Complex operator+(const Complex& lhs, const Complex& rhs) ; // opposto: potrebbe essere dentro la classe template Complex operator-(const Complex& lhs); // differenza template Complex operator-(const Complex& lhs, const Complex& rhs) ; // prodotto template Complex operator*(const Complex& lhs, const Complex& rhs) ; // divisione template Complex operator/(const Complex& lhs, const Complex& rhs) ; template ostream& operator<<(ostream& out, const Complex& rhs) ; template istream& operator>>(istream& out, Complex& o) ; #endif // COMPLEX_H