include/types.h

Go to the documentation of this file.
00001 /********************************************************************************
00002  *  Neural Network Framework.                                                   *
00003  *  Copyright (C) 2005-2008 Gianluca Massera <emmegian@yahoo.it>                *
00004  *                                                                              *
00005  *  This program is free software; you can redistribute it and/or modify        *
00006  *  it under the terms of the GNU General Public License as published by        *
00007  *  the Free Software Foundation; either version 2 of the License, or           *
00008  *  (at your option) any later version.                                         *
00009  *                                                                              *
00010  *  This program is distributed in the hope that it will be useful,             *
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               *
00013  *  GNU General Public License for more details.                                *
00014  *                                                                              *
00015  *  You should have received a copy of the GNU General Public License           *
00016  *  along with this program; if not, write to the Free Software                 *
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  *
00018  ********************************************************************************/
00019 
00020 #ifndef TYPES_H
00021 #define TYPES_H
00022 
00031 #ifdef WIN32
00032     #define _CRT_SECURE_NO_DEPRECATE
00033     #ifdef NNFW_BUILDING_DLL
00034         #define NNFW_API __declspec(dllexport)
00035         #define NNFW_TEMPLATE __declspec(dllexport)
00036     #else
00037         #define NNFW_API __declspec(dllimport)
00038         #define NNFW_TEMPLATE 
00039     #endif
00040     #ifdef NNFW_DONT_EXPORT
00041         #define NNFW_API 
00042         #define NNFW_TEMPLATE 
00043     #endif
00044     #define NNFW_INTERNAL 
00045 #else
00046     #ifdef NNFW_DONT_EXPORT
00047         #define NNFW_API __attribute__ ((visibility ("hidden")))
00048         #define NNFW_TEMPLATE __attribute__ ((visibility ("hidden")))
00049     #else
00050         #define NNFW_API
00051         #define NNFW_TEMPLATE 
00052     #endif
00053     #define NNFW_INTERNAL __attribute__ ((visibility ("hidden")))
00054 #endif
00055 
00056 #define NNFW_VERSION 10400
00057 
00058 #include <vector>
00059 #include <string>
00060 
00061 // --- Define NNFW_DOUBLE_PRECISION for defining Real as double
00062 //#define  NNFW_DOUBLE_PRECISION
00063 
00064 #define TYPES_INCLUDES
00065 
00066 #include "messages.h"
00067 #include "primtypes.h"
00068 #include "observ.h"
00069 #include "vectordata.h"
00070 #include "matrixdata.h"
00071 
00072 namespace nnfw {
00073     class RealMat;
00074 }
00075 #include "realvec.h"
00076 #include "realmat.h"
00077 
00078 #undef TYPES_INCLUDES
00079 
00080 
00081 namespace nnfw {
00082 
00084 template<class T>
00085 inline T max( T a, T b ) {
00086     return (a>b) ? a : b;
00087 }
00088 
00090 template<class T>
00091 inline T min( T a, T b ) {
00092     return (a<b) ? a : b;
00093 }
00094 
00096 typedef VectorData<bool> BoolVec;
00097 
00099 typedef VectorData<u_int> U_IntVec;
00100 
00101 class Updatable;
00103 typedef VectorData<Updatable*> UpdatableVec;
00104 
00105 class Cluster;
00107 typedef VectorData<Cluster*> ClusterVec;
00108 
00109 class Linker;
00111 typedef VectorData<Linker*> LinkerVec;
00112 
00114 extern NNFW_API const LinkerVec emptyLinkerVec;
00115 
00117 extern NNFW_API const ClusterVec emptyClusterVec;
00118 
00119 class BaseTeachBlock;
00121 typedef VectorData<BaseTeachBlock*> TeachBlockVec;
00122 
00123 }
00124 
00125 #endif
BerliOS Developer Logo Valid XHTML 1.0 Transitional Valid CSS!