dcomplex.h
Go to the documentation of this file.
1 
11 /*
12  * This header file is to be included in source files z*.c
13  */
14 #ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */
15 #define __SUPERLU_DCOMPLEX
16 
17 #include <mpi.h>
18 
19 typedef struct { double r, i; } doublecomplex;
20 
21 /*
22  * These variables will be defined to be MPI datatypes for complex
23  * and double complex. I'm too lazy to declare
24  * these guys external in every file that needs them.
25  */
26 extern MPI_Datatype SuperLU_MPI_DOUBLE_COMPLEX;
27 
28 
29 /* Macro definitions */
30 
32 #define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
33  (c)->i = (a)->i + (b)->i; }
34 
36 #define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
37  (c)->i = (a)->i - (b)->i; }
38 
40 #define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \
41  (c)->i = (a)->i * (b); }
42 
44 #define zz_mult(c, a, b) { \
45  double cr, ci; \
46  cr = (a)->r * (b)->r - (a)->i * (b)->i; \
47  ci = (a)->i * (b)->r + (a)->r * (b)->i; \
48  (c)->r = cr; \
49  (c)->i = ci; \
50  }
51 
53 #define z_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i )
54 
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /* Prototypes for functions in dcomplex.c */
62 double slud_z_abs(doublecomplex *); /* exact */
63 double slud_z_abs1(doublecomplex *); /* approximate */
64 
65 
66 #ifdef __cplusplus
67  }
68 #endif
69 
70 
71 #endif /* __SUPERLU_DCOMPLEX */
int i
Definition: BiCGSTAB_step_by_step.cpp:9
MPI_Datatype SuperLU_MPI_DOUBLE_COMPLEX
double slud_z_abs(doublecomplex *)
double slud_z_abs1(doublecomplex *)
void slud_z_div(doublecomplex *, doublecomplex *, doublecomplex *)
r
Definition: UniformPSDSelfTest.py:20
Definition: datatypes.h:15