00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __SUPERLU_SCOMPLEX
00017 #define __SUPERLU_SCOMPLEX
00018
00019
00020
00021
00022 #ifndef SCOMPLEX_INCLUDE
00023 #define SCOMPLEX_INCLUDE
00024
00025 typedef struct { float r, i; } complex;
00026
00027
00028
00029
00030
00031 #define c_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
00032 (c)->i = (a)->i + (b)->i; }
00033
00034
00035 #define c_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
00036 (c)->i = (a)->i - (b)->i; }
00037
00038
00039 #define cs_mult(c, a, b) { (c)->r = (a)->r * (b); \
00040 (c)->i = (a)->i * (b); }
00041
00042
00043 #define cc_mult(c, a, b) { \
00044 float cr, ci; \
00045 cr = (a)->r * (b)->r - (a)->i * (b)->i; \
00046 ci = (a)->i * (b)->r + (a)->r * (b)->i; \
00047 (c)->r = cr; \
00048 (c)->i = ci; \
00049 }
00050
00051
00052 #define c_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i )
00053
00054
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058
00059
00060 void c_div(complex *, complex *, complex *);
00061 double c_abs(complex *);
00062 double c_abs1(complex *);
00063 void c_exp(complex *, complex *);
00064 void r_cnjg(complex *, complex *);
00065 double r_imag(complex *);
00066
00067
00068 #ifdef __cplusplus
00069 }
00070 #endif
00071
00072 #endif
00073
00074 #endif