Complex Numbers
[libbn (numerical functions)]

Collaboration diagram for Complex Numbers:


Files

file  complex.c

Data Structures

struct  bn_complex

Defines

#define bn_cx_copy(ap, bp)   {*(ap) = *(bp);}
#define bn_cx_neg(cp)   { (cp)->re = -((cp)->re);(cp)->im = -((cp)->im);}
#define bn_cx_real(cp)   (cp)->re
#define bn_cx_imag(cp)   (cp)->im
#define bn_cx_add(ap, bp)   { (ap)->re += (bp)->re; (ap)->im += (bp)->im;}
#define bn_cx_ampl(cp)   hypot( (cp)->re, (cp)->im )
#define bn_cx_amplsq(cp)   ( (cp)->re * (cp)->re + (cp)->im * (cp)->im )
#define bn_cx_conj(cp)   { (cp)->im = -(cp)->im; }
#define bn_cx_cons(cp, r, i)   { (cp)->re = r; (cp)->im = i; }
#define bn_cx_phas(cp)   atan2( (cp)->im, (cp)->re )
#define bn_cx_scal(cp, s)   { (cp)->re *= (s); (cp)->im *= (s); }
#define bn_cx_sub(ap, bp)   { (ap)->re -= (bp)->re; (ap)->im -= (bp)->im;}
#define bn_cx_mul(ap, bp)
#define bn_cx_mul2(ap, bp, cp)

Typedefs

typedef bn_complex bn_complex_t

Functions

void bn_cx_div (bn_complex_t *ap, const bn_complex_t *bp)
void bn_cx_sqrt (bn_complex_t *op, const bn_complex_t *ip)

Define Documentation

#define bn_cx_copy ap,
bp   )     {*(ap) = *(bp);}
 

Definition at line 311 of file bn.h.

#define bn_cx_neg cp   )     { (cp)->re = -((cp)->re);(cp)->im = -((cp)->im);}
 

Definition at line 312 of file bn.h.

#define bn_cx_real cp   )     (cp)->re
 

Definition at line 313 of file bn.h.

Referenced by rt_poly_checkroots().

#define bn_cx_imag cp   )     (cp)->im
 

Definition at line 314 of file bn.h.

Referenced by rt_poly_checkroots().

#define bn_cx_add ap,
bp   )     { (ap)->re += (bp)->re; (ap)->im += (bp)->im;}
 

Definition at line 316 of file bn.h.

Referenced by rt_poly_eval_w_2derivatives(), and rt_poly_findroot().

#define bn_cx_ampl cp   )     hypot( (cp)->re, (cp)->im )
 

Definition at line 317 of file bn.h.

Referenced by bn_cx_sqrt().

#define bn_cx_amplsq cp   )     ( (cp)->re * (cp)->re + (cp)->im * (cp)->im )
 

Definition at line 318 of file bn.h.

Referenced by rt_poly_deflate(), and rt_poly_findroot().

#define bn_cx_conj cp   )     { (cp)->im = -(cp)->im; }
 

Definition at line 319 of file bn.h.

#define bn_cx_cons cp,
r,
 )     { (cp)->re = r; (cp)->im = i; }
 

Definition at line 320 of file bn.h.

Referenced by rt_poly_eval_w_2derivatives().

#define bn_cx_phas cp   )     atan2( (cp)->im, (cp)->re )
 

Definition at line 321 of file bn.h.

#define bn_cx_scal cp,
 )     { (cp)->re *= (s); (cp)->im *= (s); }
 

Definition at line 322 of file bn.h.

Referenced by rt_poly_findroot().

#define bn_cx_sub ap,
bp   )     { (ap)->re -= (bp)->re; (ap)->im -= (bp)->im;}
 

Definition at line 323 of file bn.h.

Referenced by rt_poly_findroot().

#define bn_cx_mul ap,
bp   ) 
 

Value:

{ FAST fastf_t a__re, b__re; \
        (ap)->re = ((a__re=(ap)->re)*(b__re=(bp)->re)) - (ap)->im*(bp)->im; \
        (ap)->im = a__re*(bp)->im + (ap)->im*b__re; }

Definition at line 325 of file bn.h.

Referenced by rt_poly_eval_w_2derivatives().

#define bn_cx_mul2 ap,
bp,
cp   ) 
 

Value:

{ \
        (ap)->re = (cp)->re * (bp)->re - (cp)->im * (bp)->im; \
        (ap)->im = (cp)->re * (bp)->im + (cp)->im * (bp)->re; }

Definition at line 331 of file bn.h.

Referenced by rt_poly_findroot().


Typedef Documentation

typedef struct bn_complex bn_complex_t
 


Function Documentation

void bn_cx_div bn_complex_t ap,
const bn_complex_t bp
 

Referenced by rt_poly_findroot().

void bn_cx_sqrt bn_complex_t op,
const bn_complex_t ip
 

Referenced by rt_poly_findroot().


Generated on Mon Sep 18 01:25:22 2006 for BRL-CAD by  doxygen 1.4.6