hconj.c 671 B

123456789101112131415161718192021222324252627
  1. /* hconj.c CCMATH mathematics library source code.
  2. *
  3. * Copyright (C) 2000 Daniel A. Atkinson All rights reserved.
  4. * This code may be redistributed under the terms of the GNU library
  5. * public license (LGPL). ( See the lgpl.license file for details.)
  6. * ------------------------------------------------------------------------
  7. */
  8. #include "ccmath.h"
  9. void hconj(Cpx * a, int n)
  10. {
  11. Cpx s, *p, *q;
  12. int i, j, e;
  13. for (i = 0, e = n - 1; i < n; ++i, --e, a += n + 1) {
  14. for (j = 0, p = a + 1, q = a + n; j < e; ++j) {
  15. s = *p;
  16. s.im = -s.im;
  17. p->re = q->re;
  18. (p++)->im = -q->im;
  19. *q = s;
  20. q += n;
  21. }
  22. a->im = -a->im;
  23. }
  24. }