SRC/slu_dcomplex.h

Go to the documentation of this file.
00001 
00014 #ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */
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 /* Macro definitions */
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 /* Prototypes for functions in dcomplex.c */
00061 void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
00062 double z_abs(doublecomplex *);     /* exact */
00063 double z_abs1(doublecomplex *);    /* approximate */
00064 void z_exp(doublecomplex *, doublecomplex *);
00065 void d_cnjg(doublecomplex *r, doublecomplex *z);
00066 double d_imag(doublecomplex *);
00067 
00068 
00069 #ifdef __cplusplus
00070   }
00071 #endif
00072 
00073 #endif
00074 
00075 #endif  /* __SUPERLU_DCOMPLEX */

Generated on Fri Aug 1 22:40:39 2008 for SuperLU by  doxygen 1.4.6