SuperLU Distributed 8.2.1
Distributed memory sparse direct solver
dcomplex.h
Go to the documentation of this file.
1
21/*
22 * This header file is to be included in source files z*.c
23 */
24#ifndef __SUPERLU_DCOMPLEX /* allow multiple inclusions */
25#define __SUPERLU_DCOMPLEX
26
27#include <mpi.h>
28#include "superlu_defs.h"
29
30typedef struct { double r, i; } doublecomplex;
31
32/*
33 * These variables will be defined to be MPI datatypes for complex
34 * and double complex. I'm too lazy to declare them external in every
35 * file that needs them.
36 *
37 * Use WINOWS_EXPORT_ALL_SYMBOLS on windows to export all symbols when
38 * building a shared library.
39 * Introduce macro SUPERLU_DIST_EXPORT to correctly export the only
40 * remaining data symbol SuperLU_MPI_DOUBLE_COMPLEX.
41 */
42//extern SUPERLU_DIST_EXPORT MPI_Datatype SuperLU_MPI_DOUBLE_COMPLEX;
43
44/* Macro definitions */
45
47#define z_copy(c, a) { (c)->r = (a)->r ; \
48 (c)->i = (a)->i ; }
49
51#define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \
52 (c)->i = (a)->i + (b)->i; }
53
55#define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \
56 (c)->i = (a)->i - (b)->i; }
57
59#define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \
60 (c)->i = (a)->i * (b); }
61
63#define zz_mult(c, a, b) { \
64 double cr, ci; \
65 cr = (a)->r * (b)->r - (a)->i * (b)->i; \
66 ci = (a)->i * (b)->r + (a)->r * (b)->i; \
67 (c)->r = cr; \
68 (c)->i = ci; \
69 }
70
72#define z_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i )
73
74
75#ifdef __cplusplus
76extern "C" {
77#endif
78
79/* Prototypes for functions in dcomplex.c */
81double slud_z_abs(doublecomplex *); /* exact */
82double slud_z_abs1(doublecomplex *); /* approximate */
83
84
85#ifdef __cplusplus
86 }
87#endif
88
89
90#endif /* __SUPERLU_DCOMPLEX */
double slud_z_abs(doublecomplex *)
Definition: dcomplex_dist.c:59
double slud_z_abs1(doublecomplex *)
Definition: dcomplex_dist.c:82
void slud_z_div(doublecomplex *, doublecomplex *, doublecomplex *)
Definition: dcomplex_dist.c:29
int i
Definition: dutil_dist.c:248
Definition: dcomplex.h:30
Definitions which are precision-neutral.