aboutsummaryrefslogtreecommitdiffstats
path: root/tests/libsample/complex.h
blob: f8efb790c5cb58cf3705993f858e34cbd42ebbf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef COMPLEX_H
#define COMPLEX_H

class Complex
{
public:
    Complex(double real = 0.0, double imag = 0.0);
    ~Complex() {}

    double real() const { return m_real; }
    void setReal(double real) { m_real = real; }
    double imag() const { return m_imag; }
    void setImaginary(double imag) { m_imag = imag; }

    Complex operator+(Complex& other);

    void show();

private:
    double m_real;
    double m_imag;
};

#endif // COMPLEX_H