home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_02 / 1102105a < prev    next >
Text File  |  1992-12-04  |  956b  |  46 lines

  1. main(int argc, char **argv)
  2. {
  3.     
  4.     
  5.     int i,j;                /* loop control */
  6.     char temp[10];          /* workspace */
  7.     
  8.     /* build the initial tableau */
  9.     build_basis();          
  10.     printf ("**** ORIGINAL TABLE\n");
  11.     print_table();
  12.     pass = 1;
  13.  
  14.     /* select_entering will return a 0 when 
  15.      there are no more entering VARIABLES, 
  16.      otherwise, the location of the entering 
  17.      variable is returned  */
  18.     while (enter_pos = select_entering()) {
  19.  
  20.        /* return pos for leaving variable */
  21.        leave_pos = select_leaving();
  22.  
  23.        /* calculate the pivot element */
  24.        pivot_element = table[leave_pos][enter_pos];
  25.  
  26.        /* calculate the new pivot equation */
  27.        new_pivot();
  28.  
  29.        /* calculate all the non-pivot EQUATIONS */
  30.        new_equation();
  31.  
  32.        /* label the new basis */
  33.        strcpy (basis[leave_pos], 
  34.            objective[enter_pos]);
  35.  
  36.        printf ("\n**** ITERATION %d\n\n", pass);
  37.        pass++;
  38.     
  39.        print_table();
  40.  
  41.     }
  42.  
  43. }
  44.  
  45.  
  46.