mMul.c
Go to the documentation of this file.
00001 /*******************************************************
00002  *
00003  * Author: Shinsaku Hiura, Hirokazu Kato
00004  *
00005  *         shinsaku@sys.es.osaka-u.ac.jp
00006  *         kato@sys.im.hiroshima-cu.ac.jp
00007  *
00008  * Revision: 2.1
00009  * Date: 99/07/16
00010  *
00011 *******************************************************/
00012 #include <stdio.h>
00013 #include <math.h>
00014 #include <AR/matrix.h>
00015 
00016 int arMatrixMul(ARMat *dest, ARMat *a, ARMat *b)
00017 {
00018         int r, c, i;
00019 
00020         if(a->clm != b->row || dest->row != a->row || dest->clm != b->clm) return -1;
00021 
00022         for(r = 0; r < dest->row; r++) {
00023                 for(c = 0; c < dest->clm; c++) {
00024                         ARELEM0(dest, r, c) = 0.0;
00025                         for(i = 0; i < a->clm; i++) {
00026                                 ARELEM0(dest, r, c) += ARELEM0(a, r, i) * ARELEM0(b, i, c);
00027                         }
00028                 }
00029         }
00030 
00031         return 0;
00032 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


ar_recog
Author(s): Graylin Trevor Jay and Christopher Crick
autogenerated on Fri Jan 25 2013 12:15:00