TBCI Numerical high perf. C++ Library 2.8.0
dcomplex.h
Go to the documentation of this file.
1
5
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
25typedef 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
56extern "C" {
57#endif
58
59/* Prototypes for functions in dcomplex.c */
61double z_abs(doublecomplex *); /* exact */
62double z_abs1(doublecomplex *); /* approximate */
66
67
68#ifdef __cplusplus
69 }
70#endif
71
72#endif
73
74#endif /* __SUPERLU_DCOMPLEX */
double z_abs1(doublecomplex *)
double z_abs(doublecomplex *)
void d_cnjg(doublecomplex *r, doublecomplex *z)
double d_imag(doublecomplex *)
void z_exp(doublecomplex *, doublecomplex *)
void z_div(doublecomplex *, doublecomplex *, doublecomplex *)
#define doublecomplex
doublereal i
Definition f2c.h:34
doublereal r
Definition f2c.h:34