mAlloc.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 
00013 #include <stdio.h>
00014 #include <math.h>
00015 #ifndef __APPLE__
00016 #include <malloc.h>
00017 #else
00018 #include <stdlib.h>
00019 #endif
00020 #include <AR/matrix.h>
00021 
00022 ARMat *arMatrixAlloc(int row, int clm)
00023 {
00024         ARMat *m;
00025 
00026         m = (ARMat *)malloc(sizeof(ARMat));
00027         if( m == NULL ) return NULL;
00028 
00029         m->m = (double *)malloc(sizeof(double) * row * clm);
00030         if(m->m == NULL) {
00031                 free(m);
00032                 return NULL;
00033         }
00034         else {
00035                 m->row = row;
00036                 m->clm = clm;
00037         }
00038 
00039         return m;
00040 }
 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