slu_dcomplex.h
Go to the documentation of this file.
1 
14 #ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */
15 #define __SUPERLU_DCOMPLEX
16 
17 
18 #ifndef DCOMPLEX_INCLUDE
19 #define DCOMPLEX_INCLUDE
20 
21 typedef struct { double r, i; } doublecomplex;
22 
23 
24 /* Macro definitions */
25 
27 #define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
28  (c)->i = (a)->i + (b)->i; }
29 
31 #define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
32  (c)->i = (a)->i - (b)->i; }
33 
35 #define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \
36  (c)->i = (a)->i * (b); }
37 
39 #define zz_mult(c, a, b) { \
40  double cr, ci; \
41  cr = (a)->r * (b)->r - (a)->i * (b)->i; \
42  ci = (a)->i * (b)->r + (a)->r * (b)->i; \
43  (c)->r = cr; \
44  (c)->i = ci; \
45  }
46 
47 #define zz_conj(a, b) { \
48  (a)->r = (b)->r; \
49  (a)->i = -((b)->i); \
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 z_abs(doublecomplex *); /* exact */
63 double z_abs1(doublecomplex *); /* approximate */
69 
70 
71 
72 #ifdef __cplusplus
73  }
74 #endif
75 
76 #endif
77 
78 #endif /* __SUPERLU_DCOMPLEX */
r
Definition: UniformPSDSelfTest.py:20
double z_abs1(doublecomplex *)
double z_abs(doublecomplex *)
void d_cnjg(doublecomplex *r, doublecomplex *z)
double d_imag(doublecomplex *)
void z_exp(doublecomplex *, doublecomplex *)
doublecomplex z_sgn(doublecomplex *)
void z_div(doublecomplex *, doublecomplex *, doublecomplex *)
doublecomplex z_sqrt(doublecomplex *)
Definition: datatypes.h:15
double i
Definition: slu_dcomplex.h:21