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