GRASS Programmer's Manual  6.5.svn(2012)-r51648
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
hconj.c
Go to the documentation of this file.
00001 /*  hconj.c    CCMATH mathematics library source code.
00002  *
00003  *  Copyright (C)  2000   Daniel A. Atkinson    All rights reserved.
00004  *  This code may be redistributed under the terms of the GNU library
00005  *  public license (LGPL). ( See the lgpl.license file for details.)
00006  * ------------------------------------------------------------------------
00007  */
00008 #include "ccmath.h"
00009 void hconj(Cpx * a, int n)
00010 {
00011     Cpx s, *p, *q;
00012 
00013     int i, j, e;
00014 
00015     for (i = 0, e = n - 1; i < n; ++i, --e, a += n + 1) {
00016         for (j = 0, p = a + 1, q = a + n; j < e; ++j) {
00017             s = *p;
00018             s.im = -s.im;
00019             p->re = q->re;
00020             (p++)->im = -q->im;
00021             *q = s;
00022             q += n;
00023         }
00024         a->im = -a->im;
00025     }
00026 }