Jspice3
complex.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SPcomplex
 

Macros

#define CMPLX   "complex.h $Revision: 1.5 $ on $Date: 88/11/22 02:51:07 $ "
 
#define DC_ABS(a, b)   (FABS(a) + FABS(b))
 
#define DC_DIVEQ(a, b, c, d)
 
#define DC_MULT(a, b, c, d, x, y)
 
#define DC_MINUSEQ(a, b, c, d)
 
#define C_SQRT(A)
 
#define C_MAG2(A)
 
#define C_CONJ(A)   ((A).imag *= -1.0)
 
#define C_CONJEQ(A, B)
 
#define C_EQ(A, B)
 
#define C_NORM(A, B)
 
#define C_ABS(A)   (sqrt((A).real * (A.real) + (A.imag * A.imag)))
 
#define C_MUL(A, B)
 
#define C_MULEQ(A, B, C)
 
#define C_DIV(A, B)
 
#define C_DIVEQ(A, B, C)
 
#define C_ADD(A, B)
 
#define C_ADDEQ(A, B, C)
 
#define C_SUB(A, B)
 
#define C_SUBEQ(A, B, C)
 

Macro Definition Documentation

#define C_ABS (   A)    (sqrt((A).real * (A.real) + (A.imag * A.imag)))

Definition at line 154 of file complex.h.

#define C_ADD (   A,
 
)
Value:
{ \
(A).real += (B.real); \
(A).imag += (B.imag); \
}

Definition at line 188 of file complex.h.

#define C_ADDEQ (   A,
  B,
 
)
Value:
{ \
(A).real = (B.real) + (C.real); \
(A).imag = (B.imag) + (C.imag); \
}

Definition at line 193 of file complex.h.

#define C_CONJ (   A)    ((A).imag *= -1.0)

Definition at line 125 of file complex.h.

#define C_CONJEQ (   A,
 
)
Value:
{ \
(A).real = (B.real); \
(A).imag = - (B.imag); \
}

Definition at line 127 of file complex.h.

#define C_DIV (   A,
 
)
Value:
{ \
double _tmp, _mag; \
_tmp = (A.real); \
(A).real = _tmp * (B.real) + (A).imag * (B.imag); \
(A).imag = - _tmp * (B.imag) + (A.imag) * (B.real); \
_mag = (B.real) * (B.real) + (B.imag) * (B.imag); \
(A).real /= _mag; \
(A).imag /= _mag; \
}

Definition at line 169 of file complex.h.

#define C_DIVEQ (   A,
  B,
 
)
Value:
{ \
double _mag; \
(A).real = (B.real) * (C.real) + (B.imag) * (C.imag); \
(A).imag = (B.imag) * (C.real) - (B.real) * (C.imag); \
_mag = (C.real) * (C.real) + (C.imag) * (C.imag); \
(A).real /= _mag; \
(A).imag /= _mag; \
}

Definition at line 179 of file complex.h.

#define C_EQ (   A,
 
)
Value:
{ \
(A).real = (B.real); \
(A).imag = (B.imag); \
}

Definition at line 132 of file complex.h.

#define C_MAG2 (   A)
Value:
(((A).real = (A).real * (A).real + (A).imag * (A).imag), \
(A).imag = 0.0)

Definition at line 122 of file complex.h.

#define C_MUL (   A,
 
)
Value:
{ \
double TMP1, TMP2; \
TMP1 = (A.real); \
TMP2 = (B.real); \
(A).real = TMP1 * TMP2 - (A.imag) * (B.imag); \
(A).imag = TMP1 * (B.imag) + (A.imag) * TMP2; \
}

Definition at line 156 of file complex.h.

#define C_MULEQ (   A,
  B,
 
)
Value:
{ \
(A).real = (B.real) * (C.real) - (B.imag) * (C.imag); \
(A).imag = (B.real) * (C.imag) + (B.imag) * (C.real); \
}

Definition at line 164 of file complex.h.

#define C_NORM (   A,
 
)
Value:
{ \
if ((A).real == 0.0 && (A).imag == 0.0) { \
(B) = 0; \
} else { \
while (FABS((A).real) > 1.0 || FABS((A).imag) > 1.0) { \
(B) += 1; \
(A).real /= 2.0; \
(A).imag /= 2.0; \
} \
while (FABS((A).real) <= 0.5 && FABS((A).imag) <= 0.5) { \
(B) -= 1; \
(A).real *= 2.0; \
(A).imag *= 2.0; \
} \
} \
}
if(TDesc==NULL)
Definition: cd.c:1326
while(TDesc->tSucc!=NULL)
Definition: cd.c:1335
#define FABS(a)
Definition: util.h:41

Definition at line 137 of file complex.h.

#define C_SQRT (   A)
Value:
{ \
double _mag, _a; \
if ((A).imag == 0.0) { \
if ((A).real < 0.0) { \
(A).imag = sqrt(-(A).real); \
(A).real = 0.0; \
} else { \
(A).real = sqrt((A).real); \
(A).imag = 0.0; \
} \
} else { \
_mag = sqrt((A).real * (A).real + (A).imag * (A).imag); \
_a = (_mag - (A).real) / 2.0; \
if (_a <= 0.0) { \
(A).real = sqrt(_mag); \
(A).imag /= (2.0 * (A).real); /*XXX*/ \
} else { \
_a = sqrt(_a); \
(A).real = (A).imag / (2.0 * _a); \
(A).imag = _a; \
} \
} \
}
if(TDesc==NULL)
Definition: cd.c:1326

Definition at line 98 of file complex.h.

#define C_SUB (   A,
 
)
Value:
{ \
(A).real -= (B.real); \
(A).imag -= (B.imag); \
}

Definition at line 198 of file complex.h.

#define C_SUBEQ (   A,
  B,
 
)
Value:
{ \
(A).real = (B.real) - (C.real); \
(A).imag = (B.imag) - (C.imag); \
}

Definition at line 203 of file complex.h.

#define CMPLX   "complex.h $Revision: 1.5 $ on $Date: 88/11/22 02:51:07 $ "

Definition at line 5 of file complex.h.

#define DC_ABS (   a,
 
)    (FABS(a) + FABS(b))

Definition at line 18 of file complex.h.

#define DC_DIVEQ (   a,
  b,
  c,
  d 
)
Value:
{ \
double r,s,x,y; \
if(FABS(c)>FABS(d)) { \
r=(d)/(c); \
s=(c)+r*(d); \
x=((*(a))+(*(b))*r)/s; \
y=((*(b))-(*(a))*r)/s; \
} else { \
r=(c)/(d); \
s=(d)+r*(c); \
x=((*(a))*r+(*(b)))/s; \
y=((*(b))*r-(*(a)))/s; \
} \
(*(a)) = x; \
(*(b)) = y; \
}
Definition: cddefs.h:119
if(TDesc==NULL)
Definition: cd.c:1326
Definition: cddefs.h:237
Definition: sced.h:120
static double c
Definition: vectors.c:16
Definition: cddefs.h:177
#define FABS(a)
Definition: util.h:41
Definition: cddefs.h:162

Definition at line 38 of file complex.h.

#define DC_MINUSEQ (   a,
  b,
  c,
  d 
)
Value:
{ \
*(a) -= (c) ; \
*(b) -= (d) ; \
}
Definition: cddefs.h:237
Definition: sced.h:120
Definition: cddefs.h:177

Definition at line 85 of file complex.h.

#define DC_MULT (   a,
  b,
  c,
  d,
  x,
 
)
Value:
{ \
*(x) = (a) * (c) - (b) * (d) ; \
*(y) = (a) * (d) + (b) * (c) ; \
}
Definition: cddefs.h:237
Definition: sced.h:120
static double c
Definition: vectors.c:16

Definition at line 64 of file complex.h.