|
// Complex.h
#ifndef COMPLEX_H
#define COMPLEX_H
#ifdef __hpux
#include <iostream.h>
#else
#include <iostream>
using namespace std;
#endif
// ���f���N���X //////////////////////////////////////////////////
class Complex {
public:
// ������
Complex(double a=0.0,double b=0.0) { re=a; im=b; }
// ���擾
double real() const { return(re); }
double imag() const { return(im); }
// �����o���ɂ�鉉�Z�q���d��`
Complex& operator+=(Complex& a);
Complex& operator-=(Complex& a);
Complex& operator*=(Complex& a);
Complex& operator/=(Complex& a);
// �t�����h���ɂ�鉉�Z�q���d��`
friend bool operator==(Complex& a,Complex& b);
friend bool operator!=(Complex& a,Complex& b){return(!(a==b));}
friend Complex operator +(Complex& a,Complex& b);
friend Complex operator -(Complex& a,Complex& b);
friend Complex operator *(Complex& a,Complex& b);
friend Complex operator /(Complex& a,Complex& b);
friend ostream& operator <<(ostream& ios,Complex& a);
// �Z�p���̑��d��`
friend double abs(Complex& a);
friend Complex exp(Complex& a);
private:
double re,im;
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.