slu_scomplex.h
Go to the documentation of this file.
1 
14 #ifndef __SUPERLU_SCOMPLEX /* allow multiple inclusions */
15 #define __SUPERLU_SCOMPLEX
16 
17 
18 #ifndef SCOMPLEX_INCLUDE
19 #define SCOMPLEX_INCLUDE
20 
21 typedef struct { float r, i; } complex;
22 
23 
24 /* Macro definitions */
25 
27 #define c_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
28  (c)->i = (a)->i + (b)->i; }
29 
31 #define c_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
32  (c)->i = (a)->i - (b)->i; }
33 
35 #define cs_mult(c, a, b) { (c)->r = (a)->r * (b); \
36  (c)->i = (a)->i * (b); }
37 
39 #define cc_mult(c, a, b) { \
40  float 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 cc_conj(a, b) { \
48  (a)->r = (b)->r; \
49  (a)->i = -((b)->i); \
50  }
51 
53 #define c_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 scomplex.c */
61 void c_div(complex *, complex *, complex *);
62 double c_abs(complex *); /* exact */
63 double c_abs1(complex *); /* approximate */
64 void c_exp(complex *, complex *);
65 void r_cnjg(complex *, complex *);
66 double r_imag(complex *);
69 
70 
71 
72 #ifdef __cplusplus
73  }
74 #endif
75 
76 #endif
77 
78 #endif /* __SUPERLU_SCOMPLEX */
r
Definition: UniformPSDSelfTest.py:20
void r_cnjg(complex *, complex *)
double r_imag(complex *)
void c_exp(complex *, complex *)
double c_abs1(complex *)
void c_div(complex *, complex *, complex *)
complex c_sgn(complex *)
complex c_sqrt(complex *)
double c_abs(complex *)
Definition: datatypes.h:12
float i
Definition: slu_scomplex.h:21