typedefs.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef TYPEDEFS__HPP
  2. #define TYPEDEFS__HPP
  3. #include <limits.h>
  4. #include <vector>
  5. using namespace std;
  6. // global typedefs
  7. class VecConnection;
  8. typedef vector<VecConnection*> TVecConnectionList;
  9. class VecConnection;
  10. typedef vector<VecConnection*> TVConList;
  11. typedef TVConList::iterator VConIterator;
  12. class VecNormalize;
  13. typedef vector<VecNormalize*> TVNormList;
  14. typedef TVNormList::iterator VNormIter;
  15. class layer;
  16. typedef vector<layer*> TLayerList;
  17. class Connection;
  18. typedef vector<Connection*> TConnectionList;
  19. class connection;
  20. typedef vector<connection*> TconnectionList; //! --> ToDo bereinigen, so dass hier nur noch Connection steht
  21. typedef TConnectionList::iterator ConIter;
  22. typedef TConnectionList::iterator ConnectionIterator;
  23. typedef TconnectionList::iterator connectionIterator;
  24. class layer;
  25. typedef vector<layer*> TLayerList;
  26. typedef TLayerList::iterator LayerIterator;
  27. class input;
  28. typedef vector<input*> TInputList;
  29. typedef TInputList::iterator InputIterator;
  30. class AbstractNormalize;
  31. typedef vector<AbstractNormalize*> TNormList;
  32. typedef TNormList::iterator NormIter;
  33. #ifdef MEMSAVE
  34. #define NSYNAPSES_INT
  35. #define NNEURONS_SHORT
  36. #define DELAYS_CHAR
  37. #endif
  38. #ifdef NSYNAPSES_INT
  39. typedef int T_NSynapses;
  40. const T_NSynapses NSYNAPSES_MAX = INT_MAX;
  41. #else
  42. typedef long T_NSynapses;
  43. const T_NSynapses NSYNAPSES_MAX = LONG_MAX;
  44. #endif
  45. #ifdef NNEURONS_SHORT
  46. typedef short T_NNeurons;
  47. const T_NNeurons NNEURONS_MAX = SHRT_MAX;
  48. #else
  49. typedef int T_NNeurons;
  50. const T_NNeurons NNEURONS_MAX = INT_MAX;
  51. #endif
  52. #ifdef DELAYS_CHAR
  53. typedef char T_Delays;
  54. const T_Delays DELAYS_MAX=CHAR_MAX;
  55. #else
  56. typedef int T_Delays;
  57. const T_Delays DELAYS_MAX=INT_MAX;
  58. #endif
  59. const T_Delays DMAX = 120;
  60. inline bool compiledWithDelaysChar()
  61. {
  62. #ifdef DELAYS_CHAR
  63. return true;
  64. #else
  65. return false;
  66. #endif
  67. }
  68. inline bool compiledWithSynapsesInt()
  69. {
  70. #ifdef NSYNAPSES_INT
  71. return true;
  72. #else
  73. return false;
  74. #endif
  75. }
  76. inline bool compiledWithNNeuronsShort()
  77. {
  78. #ifdef NNEURONS_SHORT
  79. return true;
  80. #else
  81. return false;
  82. #endif
  83. }
  84. inline bool compiledWithLowMemConfig()
  85. {
  86. return compiledWithNNeuronsShort()
  87. || compiledWithSynapsesInt()
  88. || compiledWithDelaysChar();
  89. }
  90. #endif