GRASS Programmer's Manual  6.5.svn(2012)-r51648
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
trnm.c
Go to the documentation of this file.
00001 /*  trnm.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 void trnm(double *a, int n)
00009 {
00010     double s, *p, *q;
00011 
00012     int i, j, e;
00013 
00014     for (i = 0, e = n - 1; i < n - 1; ++i, --e, a += n + 1) {
00015         for (p = a + 1, q = a + n, j = 0; j < e; ++j) {
00016             s = *p;
00017             *p++ = *q;
00018             *q = s;
00019             q += n;
00020         }
00021     }
00022 }