00001 #ifndef DEFINES_H
00002 #define DEFINES_H
00003
00004 #include "config.h"
00005 #include <string>
00006 #include "Exception.h"
00007 #include <limits>
00008
00009
00010
00011 #define ANNIE_VERSION "0.70"
00012 #define MAX_NEURONS_IN_LAYER 1000
00013
00014 #define _SIMPLE_NEURON_STRING "SimpleNeuron"
00015 #define _ABSTRACT_NEURON_STRING "AbstractNeuron"
00016 #define _PARAMETRIZED_NEURON_STRING "ParametrizedNeuron"
00017 #define _GAB_NEURON_STRING "GABNeuron"
00018
00019 #define _CENTER_NEURON_STRING "CenterNeuron"
00020 #define _RECURRENT_NEURON_STRING "RecurrentNeuron"
00021 #define _INPUT_NEURON_STRING "InputNeuron"
00022 #define _KOHONEN_NEURON_STRING "KohonenNeuron"
00023
00024 #define VM_ENABLED
00025 namespace annie { void assert_failed(const char *cond, const char *function, const char *file, int line); }
00026
00027 #ifdef DEBUG
00028 #define ASSERT(cond) do { if(!(cond)) assert_failed(#cond, __FUNCTION__, __FILE__, __LINE__); } while(0)
00029 #else
00030 #define ASSERT(cond) ((void)0)
00031 #endif
00032
00033 #ifdef assert
00034 #undef assert
00035 #endif
00036 #define assert ASSERT
00037
00044 #define PARANOID(assert_expression, exception_text) { if(!(assert_expression)) throw Exception(exception_text);}
00045
00046
00047 #define CONTROL
00048 #define SIGMOID_APPROX //should result in faster sigmoid (and derivation) function computation, is not yet throughly tested, hovewer
00049
00050
00051 typedef unsigned int uint;
00052
00053 namespace annie
00054 {
00056 typedef double real;
00057
00058 const real REAL_MAX=std::numeric_limits<double>::max(), REAL_MIN=std::numeric_limits<double>::min();
00059
00060
00068 const int BINARY_FILE = 0;
00069
00071 const int TEXT_FILE = 1;
00072
00073 #ifdef SIGMOID_APPROX
00074 const real SIGMOID_APROX_THRESHOLD=30;
00075 #endif
00076
00077
00078 }
00079
00080 #include "Vector.h"
00081 #include "Control.h"
00082 #ifdef VM_ENABLED
00083 #define VM(a) if(!!defaultControl.get("verbose")) cerr << a; //verbose MLP - only for heavy debugging, it's too slowwwww for std usage
00084 #else
00085 #define VM(a) {}
00086 #endif
00087 #endif // define DEFINES_H
00088