00001
00014 #ifndef __SUPERLU_DCOMPLEX
00015 #define __SUPERLU_DCOMPLEX
00016
00017
00018 #ifndef DCOMPLEX_INCLUDE
00019 #define DCOMPLEX_INCLUDE
00020
00021 typedef struct { double r, i; } doublecomplex;
00022
00023
00024
00025
00027 #define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
00028 (c)->i = (a)->i + (b)->i; }
00029
00031 #define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
00032 (c)->i = (a)->i - (b)->i; }
00033
00035 #define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \
00036 (c)->i = (a)->i * (b); }
00037
00039 #define zz_mult(c, a, b) { \
00040 double cr, ci; \
00041 cr = (a)->r * (b)->r - (a)->i * (b)->i; \
00042 ci = (a)->i * (b)->r + (a)->r * (b)->i; \
00043 (c)->r = cr; \
00044 (c)->i = ci; \
00045 }
00046
00047 #define zz_conj(a, b) { \
00048 (a)->r = (b)->r; \
00049 (a)->i = -((b)->i); \
00050 }
00051
00053 #define z_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i )
00054
00055
00056 #ifdef __cplusplus
00057 extern "C" {
00058 #endif
00059
00060
00061 void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
00062 double z_abs(doublecomplex *);
00063 double z_abs1(doublecomplex *);
00064 void z_exp(doublecomplex *, doublecomplex *);
00065 void d_cnjg(doublecomplex *r, doublecomplex *z);
00066 double d_imag(doublecomplex *);
00067 doublecomplex z_sgn(doublecomplex *);
00068 doublecomplex z_sqrt(doublecomplex *);
00069
00070
00071
00072 #ifdef __cplusplus
00073 }
00074 #endif
00075
00076 #endif
00077
00078 #endif