include/lwpr_mem.h

Go to the documentation of this file.
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 
00032 #ifndef __LWPR_MEM_H
00033 #define __LWPR_MEM_H
00034 
00035 #ifndef MATLAB
00036    #define LWPR_MALLOC(s)    malloc(s)       
00037    #define LWPR_CALLOC(n,s)  calloc(n,s)     
00038    #define LWPR_REALLOC(p,s) realloc(p,s)    
00039    #define LWPR_FREE(p)      free(p)         
00040 #else
00041    #include <mex.h>
00042    #define LWPR_MALLOC(s)    mxMalloc(s)     
00043    #define LWPR_CALLOC(n,s)  mxCalloc(n,s)   
00044    #define LWPR_REALLOC(p,s) mxRealloc(p,s)  
00045    #define LWPR_FREE(p)      mxFree(p)       
00046 #endif
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00062 int lwpr_mem_alloc_rf(LWPR_ReceptiveField *RF, const LWPR_Model *model, int nReg, int nRegStore);
00063 
00076 int lwpr_mem_realloc_rf(LWPR_ReceptiveField *RF, int nRegStore);
00077 
00085 void lwpr_mem_free_rf(LWPR_ReceptiveField *RF);
00086 
00095 int lwpr_mem_alloc_ws(LWPR_Workspace *ws, int nIn);
00096 
00104 void lwpr_mem_free_ws(LWPR_Workspace *ws);
00105 
00122 int lwpr_mem_alloc_model(LWPR_Model *model, int nIn, int nOut, int storeRFS);
00123 
00135 int lwpr_mem_alloc_sub(LWPR_SubModel *sub, int storeRFS);
00136 
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140 
00141 #endif

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