trncm.c 610 B

123456789101112131415161718192021222324
  1. /* trncm.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 trncm(Cpx * a, int n)
  10. {
  11. Cpx s, *p, *q;
  12. int i, j, e;
  13. for (i = 0, e = n - 1; i < n - 1; ++i, --e, a += n + 1) {
  14. for (j = 0, p = a + 1, q = a + n; j < e; ++j) {
  15. s = *p;
  16. *p++ = *q;
  17. *q = s;
  18. q += n;
  19. }
  20. }
  21. }