GRASS Programmer's Manual  6.4.1(2011)
m_mult.c
Go to the documentation of this file.
00001 /*  @(#)m_mult.c        2.1  6/26/87  */
00002 #include <stdio.h>
00003 #include <grass/libtrans.h>
00004 
00005 #define         N       3
00006 
00007 /*
00008  * m_mult: matrix multiplication (return c = a * b)
00009  *  3x3 matric by 3x1 matric
00010  */
00011 
00012 int m_mult(double a[N][N], double b[N], double c[N])
00013 {
00014     register int i, j;
00015 
00016     for (i = 0; i < N; i++) {
00017         c[i] = 0.0;
00018 
00019         for (j = 0; j < N; j++)
00020             c[i] += (a[i][j] * b[j]);
00021     }
00022 
00023     return 1;
00024 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines