Plan 9 from Bell Labs’s /usr/web/sources/contrib/pac/sys/src/ape/cmd/bio/MrBayes_2.01/complex.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include <math.h>

struct complex
	{
	double re;
	double im;
	};

typedef struct complex complex;

extern complex     Complex (double a, double b);
extern complex     Cadd (complex a, complex b);
extern complex     Csub (complex a, complex b);
extern complex     Cmul (complex a, complex b);
extern complex     Conj (complex a);
extern complex     Cdiv (complex a, complex b);
extern double      Cabs (complex a);
extern complex     Csqrt (complex a);
extern complex     RCmul (double a, complex b);
extern complex     Cexp (complex a);
extern complex     Clog (complex a);
extern complex **  pscmatrix (int dim);   // mallocs a square complex matrix
extern void        free_pscmatrix (complex **m); // frees the square complex matrix
extern void        dump_pscmatrix (complex **m, int dim); // prints a square complex matrix
extern void        copy_pscmatrix (complex **from, complex **to, int dim); // copies
extern void        dump_complexVector (complex *vec, int dim);
extern int         ComplexInvertMatrix (complex **a, int n, double *dwork, int *indx, complex **a_inv, complex *col);
extern int         ComplexLUDecompose (complex **a, int n, double *vv, int *indx, double *pd);
extern void        ComplexLUBackSubst (complex **a, int n, int *indx, complex *b);

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.