// \****************************************************** // Datei constants.h // Autor: Peter Unruh, basierend auf der PG-Version // \****************************************************** #ifndef constants_H #define constants_H #ifndef __GNUC__ typedef int bool; #define false 0 #define true !false #endif //#define debug(r,m) //#define debug(r,m) DBG __bred__(#r); const double EPSILON = 0.0001, LOWER_ACCEPTANCE_RATIO = 0.02; const unsigned long UPPER_LOOP_BOUND = 100; #ifdef INFINITY // INFINITY was already defined, letting the parSA package redefine it here! #undef INFINITY #endif const double INFINITY = 1.0E38; const int BUFLEN = 256; const int CFROZEN = 5; #define FALSE 0 #define TRUE 1 #ifndef MIN #define MIN(x,y) ( (x) < (y) ? (x) : (y) ) #endif inline float FABS(float x) { return ( (x<0)? (-x) : (x) ); } #ifdef MPI extern int myrank; // Nummer des Prozessors in MPI_COMM_WORLD; if myrank < 0 MPI is not initialized #endif class Opt { public: static const int MIN, MAX; }; extern int OptType; // compare with f.e. Opt::MIN to find out the goal of optimization // welcher Loesung wird genommen, falls mehrere gefunden oder ob ein Message statt dem Uebergang verteilt wird enum EXCHANGE_MODE { RANDOM=0, FIRST, BEST, BOLTZMANN, MESSAGE, NO = MESSAGE}; // sollen Loesungen oder nur Veraenderungen verschickt werden enum COMM_MODE {SOLUTION=0, MOVE}; // Anzahl der unterschiedlichen Unterteilungen in Cluster; 10 entspricht 2^10=1024 Prozessoren const int MAXGROUPS = 10; #endif