GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
m_mult.c
Go to the documentation of this file.
1 /* @(#)m_mult.c 2.1 6/26/87 */
2 #include <stdio.h>
3 #include <grass/libtrans.h>
4 
5 #define N 3
6 
7 /*
8  * m_mult: matrix multiplication (return c = a * b)
9  * 3x3 matric by 3x1 matric
10  */
11 
12 int m_mult(double a[N][N], double b[N], double c[N])
13 {
14  register int i, j;
15 
16  for (i = 0; i < N; i++) {
17  c[i] = 0.0;
18 
19  for (j = 0; j < N; j++)
20  c[i] += (a[i][j] * b[j]);
21  }
22 
23  return 1;
24 }
float b
Definition: named_colr.c:8
int m_mult(double a[N][N], double b[N], double c[N])
Definition: m_mult.c:12
#define N
Definition: m_mult.c:5