00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CHAINLINK_COMPLEX_H
00022 #define CHAINLINK_COMPLEX_H
00023
00024 #include <math.h>
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027
00030
00031
00037 typedef float real;
00038
00039
00040
00041
00042 typedef long int32;
00043
00044
00047 struct complex {
00048 real re,im;
00049 };
00050
00053 complex cplex(real re,real im);
00054
00055
00057 complex operator*(complex X1, complex X2);
00059 complex operator/(complex X1,complex X2);
00061 complex operator+(complex X1, complex X2);
00063 complex operator-(complex X1,complex X2);
00065 complex operator*(complex X1, real X2);
00067 complex operator/(complex X1,real X2);
00069 complex operator+(complex X1, real X2);
00071 complex operator-(complex X1,real X2);
00073 complex operator/(real X1, complex X2);
00075 bool operator==(complex X1, complex X2);
00077 bool operator==(complex X1, real X2);
00079 bool operator==(real X1,complex X2);
00080
00082 real abs(complex X);
00083
00085 complex conj(complex X);
00086
00088 complex exp(complex X);
00089
00091 complex log(complex X);
00092
00095 void get_complex_string(char *ret,complex X);
00096
00099 complex power(const complex &x, const complex &y);
00100
00101 #endif
00102
00103