TBCI Numerical high perf. C++ Library  2.8.0
dcomplex.h
Go to the documentation of this file.
1 
6 /* $Id: dcomplex.h,v 1.2.2.1 2010/08/26 07:58:23 garloff Exp $ */
7 
8 
9 /*
10  * -- SuperLU routine (version 1.1) --
11  * Univ. of California Berkeley, Xerox Palo Alto Research Center,
12  * and Lawrence Berkeley National Lab.
13  * November 15, 1997
14  *
15  */
16 #ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */
17 #define __SUPERLU_DCOMPLEX
18 
19 /*
20  * This header file is to be included in source files z*.c
21  */
22 #ifndef DCOMPLEX_INCLUDE
23 #define DCOMPLEX_INCLUDE
24 
25 typedef struct { double r, i; } doublecomplex;
26 
27 
28 /* Macro definitions */
29 
30 /* Complex Addition c = a + b */
31 #define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
32  (c)->i = (a)->i + (b)->i; }
33 
34 /* Complex Subtraction c = a - b */
35 #define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
36  (c)->i = (a)->i - (b)->i; }
37 
38 /* Complex-Double Multiplication */
39 #define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \
40  (c)->i = (a)->i * (b); }
41 
42 /* Complex-Complex Multiplication */
43 #define zz_mult(c, a, b) { \
44  double cr, ci; \
45  cr = (a)->r * (b)->r - (a)->i * (b)->i; \
46  ci = (a)->i * (b)->r + (a)->r * (b)->i; \
47  (c)->r = cr; \
48  (c)->i = ci; \
49  }
50 
51 /* Complex equality testing */
52 #define z_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i )
53 
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /* Prototypes for functions in dcomplex.c */
61 double z_abs(doublecomplex *); /* exact */
62 double z_abs1(doublecomplex *); /* approximate */
65 double d_imag(doublecomplex *);
66 
67 
68 #ifdef __cplusplus
69  }
70 #endif
71 
72 #endif
73 
74 #endif /* __SUPERLU_DCOMPLEX */
double z_abs(const doublecomplex *)
double r
Definition: dcomplex.h:25
const Vector< T > Vector< T > Vector< T > Vector< T > Vector< T > & z
Definition: LM_fit.h:172
double z_abs1(doublecomplex *)
void z_exp(doublecomplex *, doublecomplex *)
double d_imag(const doublecomplex *)
int i
Definition: LM_fit.h:71
#define doublecomplex
void d_cnjg(doublecomplex *r, doublecomplex *z)
void z_div(doublecomplex *, const doublecomplex *, const doublecomplex *)