SRC/dcomplex.h

Go to the documentation of this file.
00001 
00011 /* 
00012  * This header file is to be included in source files z*.c
00013  */
00014 #ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */
00015 #define __SUPERLU_DCOMPLEX
00016 
00017 #include <mpi.h>
00018 
00019 typedef struct { double r, i; } doublecomplex;
00020 
00021 /*
00022  * These variables will be defined to be MPI datatypes for complex
00023  * and double complex. I'm too lazy to declare
00024  * these guys external in every file that needs them.
00025  */
00026 extern MPI_Datatype SuperLU_MPI_DOUBLE_COMPLEX;
00027 
00028 
00029 /* Macro definitions */
00030 
00032 #define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
00033                          (c)->i = (a)->i + (b)->i; }
00034 
00036 #define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
00037                          (c)->i = (a)->i - (b)->i; }
00038 
00040 #define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \
00041                            (c)->i = (a)->i * (b); }
00042 
00044 #define zz_mult(c, a, b) { \
00045         double cr, ci; \
00046         cr = (a)->r * (b)->r - (a)->i * (b)->i; \
00047         ci = (a)->i * (b)->r + (a)->r * (b)->i; \
00048         (c)->r = cr; \
00049         (c)->i = ci; \
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 
00074 #endif  /* __SUPERLU_DCOMPLEX */

Generated on Sat Aug 9 23:23:51 2008 for SuperLUDistributed by  doxygen 1.4.6