home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d199 / asimplex.lha / ASimplex / simplex.h < prev   
C/C++ Source or Header  |  1989-03-31  |  5KB  |  135 lines

  1. /*****************************************************************************
  2.  * Variablendeklaration : simplex.h                                          *
  3.  * Autor                : Stefan Förster                                     *
  4.  *                                                                           *
  5.  * Datum      | Version | Bemerkung                                          *
  6.  * -----------|---------|--------------------------------------------------- *
  7.  * 06.02.1989 | 0.0     |                                                    *
  8.  * 26.02.1989 | 0.1     | EPS_NULL                                           *
  9.  * 26.02.1989 | 0.2     | VERBOSE, INVERT_FREQUENCY                          *
  10.  * 05.03.1989 | 0.3     | #include <errno.h>                                 *
  11.  * 06.03.1989 | 0.4     | PERCENT auf 0.03 geändert                          *
  12.  * 08.03.1989 | 0.5     | Definitionen für mpsx.c                            *
  13.  * 14.03.1989 | 1.0     | #define ERR_...                                    *
  14.  *****************************************************************************/ 
  15.  
  16. #include <stdio.h>
  17. #include <signal.h>
  18. #include <errno.h>
  19. #include <ctype.h>
  20. #include <stat.h>
  21. #include <math.h>
  22. #include <exec/exec.h>
  23. #include <exec/tasks.h>
  24. #include <intuition/intuition.h>
  25. #include <intuition/intuitionbase.h>
  26.  
  27. #define INT               int
  28.  
  29.  
  30. #define NOT_OPTIMAL       (USHORT)0x0001
  31. #define OPTIMAL           (USHORT)0x0002
  32. #define NOT_UNBOUNDED     (USHORT)0x0004
  33. #define UNBOUNDED         (USHORT)0x0008
  34. #define CLEAR_CUT         (USHORT)0x0010
  35. #define EMPTY             (USHORT)0x0020
  36. #define INVERTABLE        (USHORT)0x0040
  37. #define NOT_INVERTABLE    (USHORT)0x0080
  38. #define PHASE_I           (USHORT)0x0100
  39. #define PHASE_II          (USHORT)0x0200
  40. #define SMALLEST_INDEX    (USHORT)0x0400
  41. #define STEEPEST_ASCENT   (USHORT)0x0800
  42. #define LAMBDA_0          (USHORT)0x1000
  43. #define LAMBDA_1          (USHORT)0x2000
  44. #define LAMBDA_2          (USHORT)0x4000
  45. #define VERBOSE           (USHORT)0x8000
  46.  
  47. #define _TRUE             1
  48. #define _FALSE            0
  49.  
  50. #define PERCENT           0.03    /* 3% : Kriterium, welche PRICE-     */
  51.                                   /* methode angewendet wird           */
  52. #define INVERT_FREQUENCY  50L
  53.  
  54. #define EPS_INV           1e-15   /* Kriterium, daß Matrix singulär    */
  55. #define EPS_NULL          1e-13   /* == 0 */
  56.  
  57. #define ABS(x)            ((SHORT)( (x)<0 ? -(x) : (x) ))
  58. #define SGN(x)            ((SHORT)( (x)<0 ? -1 : 1))  /* SGN(0)==1 */
  59.  
  60. #define S_DOUBLE          ((LONG)sizeof(DOUBLE))
  61. #define S_SHORT           ((LONG)sizeof(SHORT))
  62.  
  63.  
  64. #define MAX_STRLEN        8       /* Namen dürfen max. 8 Zeichen lang sein */
  65. #define BUFFER            256
  66. #define BUFFER2           80
  67. #define MAX_FILELEN       80      /* willkürlich */
  68.  
  69. #define NAME              0
  70. #define ROWS              1
  71. #define GOAL              ROWS
  72. #define COLUMNS           2
  73. #define RHS               3
  74. #define RANGES            4
  75. #define BOUNDS            5
  76.  
  77. #define NUM_SYMBOLS       6
  78.  
  79.  
  80. #define VAR_LIST          0
  81. #define ROWS_LIST         1
  82. #define GOALS_LIST        2
  83. #define RHS_LIST          3
  84. #define RANGES_LIST       4
  85. #define BOUNDS_LIST       5
  86.  
  87. #define NUM_LISTS         6
  88.  
  89.  
  90. #define BIT_NAME          (USHORT)0x0001
  91. #define BIT_ROWS          (USHORT)0x0002
  92. #define BIT_COLUMNS       (USHORT)0x0004
  93. #define BIT_RHS           (USHORT)0x0008
  94. #define BIT_RANGES        (USHORT)0x0010
  95. #define BIT_BOUNDS        (USHORT)0x0020
  96. #define BIT_ENDATA        (USHORT)0x0040
  97. #define BIT_GOAL          (USHORT)0x0080
  98.  
  99.  
  100. typedef struct item {
  101.           TEXT          string[MAX_STRLEN+2];
  102.           SHORT         nr, anz;
  103.           struct item   *next;
  104.         } ITEM, *ITEMPTR;
  105.  
  106. #define SIZE_ITEM         (LONG)sizeof(ITEM)
  107.  
  108.  
  109.  
  110. #define ERR_INVALID_ARGS    sys_nerr+1
  111. #define ERR_NAME_TOO_LONG   sys_nerr+2
  112. #define ERR_DOUBLE          sys_nerr+3
  113. #define ERR_UNKNOWN_ID      sys_nerr+4
  114. #define ERR_SECTIONS        sys_nerr+5
  115. #define ERR_2SECTIONS       sys_nerr+6
  116. #define ERR_UNKNOWN_SEC     sys_nerr+7
  117. #define ERR_ORDER           sys_nerr+8
  118. #define ERR_NO_NAME         sys_nerr+9
  119. #define ERR_NO_ROWS         sys_nerr+10
  120. #define ERR_NO_GOAL         sys_nerr+11
  121. #define ERR_NO_COLUMNS      sys_nerr+12
  122. #define ERR_NO_RHS          sys_nerr+13
  123. #define ERR_NO_ENDATA       sys_nerr+14
  124. #define ERR_INV_ROWS_TYPE   sys_nerr+15
  125. #define ERR_INV_BOUNDS_TYPE sys_nerr+16
  126. #define ERR_UP_LO           sys_nerr+17
  127. #define ERR_INV_RANGES      sys_nerr+18
  128. #define ERR_MISSING         sys_nerr+19
  129. #define ERR_FILE_TOO_LONG   sys_nerr+20
  130. #define ERR_NOT_READ        sys_nerr+21
  131. #define ERR_NOT_WRITE       sys_nerr+22
  132. #define ERR_EOF             sys_nerr+23
  133. #define ERR_MEM             sys_nerr+24
  134. #define ERR_FATAL           sys_nerr+25
  135.