include/lwpr_matlab.h

00001 /*********************************************************************
00002 LWPR: A library for incremental online learning
00003 Copyright (C) 2007  Stefan Klanke, Sethu Vijayakumar
00004 Contact: sethu.vijayakumar@ed.ac.uk
00005 
00006 This library is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU Lesser General Public
00008 License as published by the Free Software Foundation; either 
00009 version 2.1 of the License, or (at your option) any later version.
00010 
00011 This library is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 Library General Public License for more details.
00015 
00016 You should have received a copy of the GNU Lesser General Public
00017 License along with this library; if not, write to the Free
00018 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 *********************************************************************/
00020 
00021 
00022 #ifndef __LWPR_MATLAB_H
00023 #define __LWPR_MATLAB_H
00024 
00025 #ifndef MATLAB
00026 #define MATLAB
00027 #endif
00028 
00029 #include <mex.h>
00030 #include <lwpr.h>
00031 #include <lwpr_aux.h>
00032 #include <lwpr_mem.h>
00033 
00034 #define RF_FIELDS     27
00035 #define SUB_FIELDS     2
00036 #define MODEL_FIELDS  25
00037 
00038 extern const char *RF_FIELD_NAMES[RF_FIELDS];
00039 extern const char *SUB_FIELD_NAMES[SUB_FIELDS];
00040 extern const char *MODEL_FIELD_NAMES[MODEL_FIELDS];
00041 
00042 double get_scalar_field(const mxArray *S,int num, const char *name);
00043 void set_scalar_field(mxArray *S,int num, int numField, double value);
00044 
00045 void get_field(const mxArray *S,int num, const char *name,int m,int n, double *dest);
00046 void set_field(mxArray *S,int num, int numField, int m, int n, const double *src);
00047 void create_RF_from_matlab(LWPR_ReceptiveField *RF, const LWPR_Model *model, const mxArray *S, int num);
00048 void fill_matlab_from_RF(LWPR_ReceptiveField *RF, mxArray *S, int num);
00049 void model_consts_from_matlab(LWPR_Model *model, const mxArray *S);
00050 
00051 void fill_matlab_from_sub(LWPR_SubModel *sub, mxArray *S, int dim);
00052 void create_sub_from_matlab(LWPR_SubModel *sub, const mxArray *S, int dim);
00053 void create_model_from_matlab(LWPR_Model *model, const mxArray *S);
00054 mxArray *create_matlab_from_model(LWPR_Model *model);
00055 
00056 LWPR_Model *get_pointer_from_array(const mxArray *A);
00057 mxArray *create_array_from_pointer(LWPR_Model *model);
00058 
00059 #endif

Generated on Wed Apr 2 13:44:42 2008 for LWPR Library by  doxygen 1.4.6