Helpers for complex number arithemetic with mpfr. More...
#include <mpfr.h>
Go to the source code of this file.
Data Structures | |
struct | C |
Complex number type. More... |
Macros | |
#define | c_set_prec(o, p) |
Set the precision of both parts of a complex number. | |
#define | c_set(o, l) |
Set both parts of a complex number. | |
#define | c_mag2(o, l, t1, t2) |
Compute complex magnitude squared. | |
#define | c_add(o, l, r) |
Add two complex numbers. | |
#define | c_sqr(o, l, t1, t2, t3) |
Square a complex number. | |
#define | c_mul(o, l, r, t1, t2, t3, t4) |
Multiply two complex numbers. | |
#define | c_mul_2ui(o, l, r) |
Multiply a complex number by a power of two. |
Typedefs | |
typedef mpfr_t | R |
Real number type. |
Helpers for complex number arithemetic with mpfr.
All variables must already be mpfr_init2()
d with appropriate precision. Implemented as CPP macros as a last resort (the C++ version used reference parameters).
Definition in file complex.h.
struct C |
#define c_add | ( | o, | |
l, | |||
r | |||
) |
Add two complex numbers.
o | The complex number for output. |
l | The first complex number input. |
r | The second complex number input. |
Definition at line 75 of file complex.h.
Referenced by fpxx_approx_do().
#define c_mag2 | ( | o, | |
l, | |||
t1, | |||
t2 | |||
) |
Compute complex magnitude squared.
o | The real number for output. |
l | The complex number input. |
t1 | A real temporary variable. |
t2 | A real temporary variable. |
Definition at line 62 of file complex.h.
Referenced by fpxx_approx_do().
#define c_mul | ( | o, | |
l, | |||
r, | |||
t1, | |||
t2, | |||
t3, | |||
t4 | |||
) |
Multiply two complex numbers.
o | The complex number for output. |
l | The first complex number input. |
r | The first complex number input. |
t1 | A real temporary variable. |
t2 | A real temporary variable. |
t3 | A real temporary variable. |
t4 | A real temporary variable. |
Definition at line 108 of file complex.h.
Referenced by fpxx_approx_do().
#define c_mul_2ui | ( | o, | |
l, | |||
r | |||
) |
Multiply a complex number by a power of two.
o | The complex number for output. |
l | The complex number input. |
r | The unsigned integer power of two. |
Definition at line 124 of file complex.h.
Referenced by fpxx_approx_do().
#define c_set | ( | o, | |
l | |||
) |
Set both parts of a complex number.
o | The complex number to modify. |
l | The complex number to use as source. |
Definition at line 49 of file complex.h.
Referenced by fpxx_approx_do().
#define c_set_prec | ( | o, | |
p | |||
) |
Set the precision of both parts of a complex number.
o | The complex number. |
p | The precision. |
Definition at line 38 of file complex.h.
Referenced by fpxx_approx_do().
#define c_sqr | ( | o, | |
l, | |||
t1, | |||
t2, | |||
t3 | |||
) |
Square a complex number.
o | The complex number for output. |
l | The complex number input. |
t1 | A real temporary variable. |
t2 | A real temporary variable. |
t3 | A real temporary variable. |
Definition at line 89 of file complex.h.
Referenced by fpxx_approx_do().