GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71942
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vmul.c
Go to the documentation of this file.
1 /* vmul.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 void vmul(double *vp, double *mat, double *v, int n)
9 {
10  double s, *q;
11 
12  int k, i;
13 
14  for (k = 0; k < n; ++k) {
15  for (i = 0, q = v, s = 0.; i < n; ++i)
16  s += *mat++ * *q++;
17  *vp++ = s;
18  }
19 }
20 
21 double vnrm(double *u, double *v, int n)
22 {
23  double s;
24 
25  int i;
26 
27  for (i = 0, s = 0.; i < n; ++i)
28  s += *u++ * *v++;
29  return s;
30 }
void vmul(double *vp, double *mat, double *v, int n)
Definition: vmul.c:8
double vnrm(double *u, double *v, int n)
Definition: vmul.c:21