GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends 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 }
void free(void *)
double l
Definition: r_raster.c:39
double b
Definition: r_raster.c:39
void rmmult(double *mat, double *a, double *b, int m, int k, int n)
Definition: rmmult.c:9