complex.h 943 B

123456789101112131415161718192021222324252627
  1. /* CAUTION: This is the ANSI C (only) version of the Numerical Recipes
  2. utility file complex.h. Do not confuse this file with the same-named
  3. file complex.h that is supplied in the 'misc' subdirectory.
  4. *That* file is the one from the book, and contains both ANSI and
  5. traditional K&R versions, along with #ifdef macros to select the
  6. correct version. *This* file contains only ANSI C. */
  7. #ifndef _NR_COMPLEX_H_
  8. #define _NR_COMPLEX_H_
  9. #ifndef _FCOMPLEX_DECLARE_T_
  10. typedef struct FCOMPLEX {float r,i;} fcomplex;
  11. #define _FCOMPLEX_DECLARE_T_
  12. #endif /* _FCOMPLEX_DECLARE_T_ */
  13. fcomplex Cadd(fcomplex a, fcomplex b);
  14. fcomplex Csub(fcomplex a, fcomplex b);
  15. fcomplex Cmul(fcomplex a, fcomplex b);
  16. fcomplex Complex(float re, float im);
  17. fcomplex Conjg(fcomplex z);
  18. fcomplex Cdiv(fcomplex a, fcomplex b);
  19. float Cabs(fcomplex z);
  20. fcomplex Csqrt(fcomplex z);
  21. fcomplex RCmul(float x, fcomplex a);
  22. #endif /* _NR_COMPLEX_H_ */