Header file for complex operations. More...
Go to the source code of this file.
Classes | |
struct | complex |
Defines | |
#define | c_add(c, a, b) |
Complex Addition c = a + b. | |
#define | c_sub(c, a, b) |
Complex Subtraction c = a - b. | |
#define | cs_mult(c, a, b) |
Complex-Double Multiplication. | |
#define | cc_mult(c, a, b) |
Complex-Complex Multiplication. | |
#define | cc_conj(a, b) |
#define | c_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i ) |
Complex equality testing. | |
Functions | |
void | c_div (complex *, complex *, complex *) |
Complex Division c = a/b. | |
double | c_abs (complex *) |
Returns sqrt(z.r^2 + z.i^2). | |
double | c_abs1 (complex *) |
Approximates the abs. Returns abs(z.r) + abs(z.i). | |
void | c_exp (complex *, complex *) |
Return the exponentiation. | |
void | r_cnjg (complex *, complex *) |
Return the complex conjugate. | |
double | r_imag (complex *) |
Return the imaginary part. | |
complex | c_sgn (complex *) |
SIGN functions for complex number. Returns z/abs(z). | |
complex | c_sqrt (complex *) |
Square-root of a complex number. |
Header file for complex operations.
-- SuperLU routine (version 2.0) -- Univ. of California Berkeley, Xerox Palo Alto Research Center, and Lawrence Berkeley National Lab. November 15, 1997
Contains definitions for various complex operations. This header file is to be included in source files c*.c
#define c_add | ( | c, | |||
a, | |||||
b | ) |
{ (c)->r = (a)->r + (b)->r; \ (c)->i = (a)->i + (b)->i; }
Complex Addition c = a + b.
#define c_eq | ( | a, | |||
b | ) | ( (a)->r == (b)->r && (a)->i == (b)->i ) |
Complex equality testing.
#define c_sub | ( | c, | |||
a, | |||||
b | ) |
{ (c)->r = (a)->r - (b)->r; \ (c)->i = (a)->i - (b)->i; }
Complex Subtraction c = a - b.
#define cc_conj | ( | a, | |||
b | ) |
{ \ (a)->r = (b)->r; \ (a)->i = -((b)->i); \ }
#define cc_mult | ( | c, | |||
a, | |||||
b | ) |
{ \
float cr, ci; \
cr = (a)->r * (b)->r - (a)->i * (b)->i; \
ci = (a)->i * (b)->r + (a)->r * (b)->i; \
(c)->r = cr; \
(c)->i = ci; \
}
Complex-Complex Multiplication.
#define cs_mult | ( | c, | |||
a, | |||||
b | ) |
{ (c)->r = (a)->r * (b); \ (c)->i = (a)->i * (b); }
Complex-Double Multiplication.
double c_abs | ( | complex * | ) |
Returns sqrt(z.r^2 + z.i^2).
double c_abs1 | ( | complex * | ) |
Approximates the abs. Returns abs(z.r) + abs(z.i).
Complex Division c = a/b.
Return the exponentiation.
SIGN functions for complex number. Returns z/abs(z).
double r_imag | ( | complex * | ) |
Return the imaginary part.