GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rmmult.c
Go to the documentation of this file.
1 /* rmmult.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 <stdlib.h>
9 void rmmult(double *rm, double *a, double *b, int n, int m, int l)
10 {
11  double z, *q0, *p, *q;
12 
13  int i, j, k;
14 
15  q0 = (double *)calloc(m, sizeof(double));
16  for (i = 0; i < l; ++i, ++rm) {
17  for (k = 0, p = b + i; k < m; p += l)
18  q0[k++] = *p;
19  for (j = 0, p = a, q = rm; j < n; ++j, q += l) {
20  for (k = 0, z = 0.; k < m;)
21  z += *p++ * q0[k++];
22  *q = z;
23  }
24  }
25  free(q0);
26 }
int l
Definition: dataquad.c:292
float b
Definition: named_colr.c:8
tuple q
Definition: forms.py:2019
void rmmult(double *mat, double *a, double *b, int m, int k, int n)
Definition: rmmult.c:9
void free(void *)
int n
Definition: dataquad.c:291