Changeset 194c2e7 in git for IntegerProgramming/IP_algorithms.cc
- Timestamp:
- Feb 9, 2010, 6:50:36 PM (14 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 6c939eebfd221f2512b1e27d158d1b5457206987
- Parents:
- a477f80136c773f8acffd73512f53bf88a7c6fe8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IntegerProgramming/IP_algorithms.cc
ra477f80 r194c2e7 61 61 62 62 int Conti_Traverso(INPUT_FILE MATRIX, 63 const short& version,64 const short& S_pair_criteria,63 const int& version, 64 const int& S_pair_criteria, 65 65 const float& interred_percentage, 66 66 const BOOLEAN& verbose) … … 71 71 72 72 char format_string[128]; // to verifie file format 73 short constraints; // number of equality constraints74 short variables; // number of variables (without auxiliary variables)73 int constraints; // number of equality constraints 74 int variables; // number of variables (without auxiliary variables) 75 75 76 76 ifstream input(MATRIX); … … 265 265 266 266 char GROEBNER[128]; 267 short i=0;267 int i=0; 268 268 while(MATRIX[i]!='\0' && MATRIX[i]!='.') 269 269 { … … 349 349 350 350 int Positive_Conti_Traverso(INPUT_FILE MATRIX, 351 const short& version,352 const short& S_pair_criteria,351 const int& version, 352 const int& S_pair_criteria, 353 353 const float& interred_percentage, 354 354 const BOOLEAN& verbose) … … 359 359 360 360 char format_string[128]; // to verifie file format 361 short constraints; // number of equality constraints362 short variables; // number of variables (without auxiliary variables)361 int constraints; // number of equality constraints 362 int variables; // number of variables (without auxiliary variables) 363 363 364 364 ifstream input(MATRIX); … … 561 561 562 562 char GROEBNER[128]; 563 short i=0;563 int i=0; 564 564 while(MATRIX[i]!='\0' && MATRIX[i]!='.') 565 565 { … … 646 646 647 647 int Elim_Conti_Traverso(INPUT_FILE MATRIX, 648 const short& version,649 const short& S_pair_criteria,648 const int& version, 649 const int& S_pair_criteria, 650 650 const float& interred_percentage, 651 651 const BOOLEAN& verbose) … … 656 656 657 657 char format_string[128]; // to verifie file format 658 short constraints; // number of equality constraints659 short variables; // number of variables (without auxiliary variables)658 int constraints; // number of equality constraints 659 int variables; // number of variables (without auxiliary variables) 660 660 661 661 ifstream input(MATRIX); … … 852 852 853 853 char GROEBNER[128]; 854 short i=0;854 int i=0; 855 855 while(MATRIX[i]!='\0' && MATRIX[i]!='.') 856 856 { … … 935 935 936 936 int Pottier(INPUT_FILE MATRIX, 937 const short& version,938 const short& S_pair_criteria,937 const int& version, 938 const int& S_pair_criteria, 939 939 const float& interred_percentage, 940 940 const BOOLEAN& verbose) … … 945 945 946 946 char format_string[128]; // to verifie file format 947 short constraints; // number of equality constraints948 short variables; // number of variables (without auxiliary variables)947 int constraints; // number of equality constraints 948 int variables; // number of variables (without auxiliary variables) 949 949 950 950 ifstream input(MATRIX); … … 1140 1140 1141 1141 char GROEBNER[128]; 1142 short i=0;1142 int i=0; 1143 1143 while(MATRIX[i]!='\0' && MATRIX[i]!='.') 1144 1144 { … … 1223 1223 1224 1224 int Hosten_Sturmfels(INPUT_FILE MATRIX, 1225 const short& version,1226 const short& S_pair_criteria,1225 const int& version, 1226 const int& S_pair_criteria, 1227 1227 const float& interred_percentage, 1228 1228 const BOOLEAN& verbose) … … 1233 1233 1234 1234 char format_string[128]; // to verifie file format 1235 short constraints; // number of equality constraints1236 short variables; // number of variables1235 int constraints; // number of equality constraints 1236 int variables; // number of variables 1237 1237 1238 1238 ifstream input(MATRIX); … … 1465 1465 float *hom_grad=new float[variables]; 1466 1466 1467 for( short i=0;i<variables;i++)1467 for(int i=0;i<variables;i++) 1468 1468 { 1469 1469 input>>hom_grad[i]; … … 1506 1506 1507 1507 // determine saturation variables 1508 short *sat_var;1509 short number_of_sat_var=A.hosten_shapiro(sat_var);1508 int *sat_var; 1509 int number_of_sat_var=A.hosten_shapiro(sat_var); 1510 1510 // memory for sat_var is allocated in the hosten_shapiro procedure 1511 1511 1512 1512 // saturate the ideal 1513 for( short i=0;i<number_of_sat_var;i++)1513 for(int i=0;i<number_of_sat_var;i++) 1514 1514 { 1515 1515 I.swap_variables(sat_var[i],variables-1); … … 1551 1551 1552 1552 char GROEBNER[128]; 1553 short i=0;1553 int i=0; 1554 1554 while(MATRIX[i]!='\0' && MATRIX[i]!='.') 1555 1555 { … … 1634 1634 1635 1635 int DiBiase_Urbanke(INPUT_FILE MATRIX, 1636 const short& version,1637 const short& S_pair_criteria,1636 const int& version, 1637 const int& S_pair_criteria, 1638 1638 const float& interred_percentage, 1639 1639 const BOOLEAN& verbose) … … 1644 1644 1645 1645 char format_string[128]; // to verify file format 1646 short constraints; // number of equality constraints1647 short variables; // number of variables1646 int constraints; // number of equality constraints 1647 int variables; // number of variables 1648 1648 1649 1649 ifstream input(MATRIX); … … 1822 1822 1823 1823 // compute flip variables (also to check the suitability of the algorithm) 1824 short* F;1825 short r=A.compute_flip_variables(F);1824 int* F; 1825 int r=A.compute_flip_variables(F); 1826 1826 1827 1827 if(r<0) … … 1862 1862 1863 1863 float* weights=new float[variables]; 1864 for( short j=0;j<variables;j++)1864 for(int j=0;j<variables;j++) 1865 1865 weights[j]=0; 1866 1866 weights[F[0]]=1; … … 1880 1880 // But the following change of the term ordering will correct this. 1881 1881 1882 for( short l=1;l<r;l++)1882 for(int l=1;l<r;l++) 1883 1883 { 1884 1884 w.swap_weights(F[l-1],F[l]); … … 1910 1910 1911 1911 char GROEBNER[128]; 1912 short i=0;1912 int i=0; 1913 1913 while(MATRIX[i]!='\0' && MATRIX[i]!='.') 1914 1914 { … … 2000 2000 2001 2001 int Bigatti_LaScala_Robbiano(INPUT_FILE MATRIX, 2002 const short& version,2003 const short& S_pair_criteria,2002 const int& version, 2003 const int& S_pair_criteria, 2004 2004 const float& interred_percentage, 2005 2005 const BOOLEAN& verbose) … … 2010 2010 2011 2011 char format_string[128]; // to verifie file format 2012 short constraints; // number of equality constraints2013 short variables; // number of variables2012 int constraints; // number of equality constraints 2013 int variables; // number of variables 2014 2014 2015 2015 ifstream input(MATRIX); … … 2253 2253 float *hom_grad=new float[variables]; 2254 2254 2255 for( short _i=0;_i<variables;_i++)2255 for(int _i=0;_i<variables;_i++) 2256 2256 { 2257 2257 input>>hom_grad[_i]; … … 2324 2324 2325 2325 char GROEBNER[128]; 2326 short i=0;2326 int i=0; 2327 2327 while(MATRIX[i]!='\0' && MATRIX[i]!='.') 2328 2328 { … … 2410 2410 2411 2411 char format_string[128]; 2412 short problem_variables;2413 short elimination_variables;2414 short weighted_variables;2412 int problem_variables; 2413 int elimination_variables; 2414 int weighted_variables; 2415 2415 char elimination_refinement[128]; 2416 2416 char weighted_refinement[128]; … … 2683 2683 } 2684 2684 2685 short weighted_ref;2685 int weighted_ref; 2686 2686 if(!strcmp(weighted_refinement,"W_LEX")) 2687 2687 weighted_ref=W_LEX; … … 2712 2712 if(elimination_variables>0) 2713 2713 { 2714 short elimination_ref;2714 int elimination_ref; 2715 2715 if(!strcmp(elimination_refinement,"LEX")) 2716 2716 elimination_ref=LEX; … … 3037 3037 char SOLUTION[128]; 3038 3038 3039 short i=0;3039 int i=0; 3040 3040 while(GROEBNER[i]!='\0' && GROEBNER[i]!='.') 3041 3041 { … … 3083 3083 Integer right_hand[weighted_variables+elimination_variables]; 3084 3084 3085 for( short k=0;k<instances;k++)3085 for(int k=0;k<instances;k++) 3086 3086 { 3087 3087 // at the beginning, the variables of interest are zero … … 3190 3190 BOOLEAN error=FALSE; // to test legality of right hand vectors 3191 3191 3192 for( short k=0;k<instances;k++)3192 for(int k=0;k<instances;k++) 3193 3193 { 3194 3194 // at the beginning, the variables of interest are zero … … 3295 3295 Integer initial_solution[weighted_variables]; 3296 3296 3297 for( short k=0;k<instances;k++)3297 for(int k=0;k<instances;k++) 3298 3298 { 3299 3299 // initial solution vector is read from the input stream into the … … 3363 3363 3364 3364 int change_cost(INPUT_FILE GROEBNER, INPUT_FILE NEW_COST, 3365 const short& version,3366 const short& S_pair_criteria,3365 const int& version, 3366 const int& S_pair_criteria, 3367 3367 const float& interred_percentage, 3368 3368 const BOOLEAN& verbose) … … 3370 3370 3371 3371 char format_string[128]; 3372 short elimination_variables;3373 short weighted_variables;3372 int elimination_variables; 3373 int weighted_variables; 3374 3374 char elimination_refinement[128]; 3375 3375 char weighted_refinement[128]; 3376 short new_variables;3376 int new_variables; 3377 3377 char algorithm[128]; 3378 3378 long old_size; … … 3758 3758 // the term ordering to refine the weight is taken to be the same as that 3759 3759 // for the old Groebner basis 3760 short weighted_ref;3760 int weighted_ref; 3761 3761 if(!strcmp(weighted_refinement,"W_LEX")) 3762 3762 weighted_ref=W_LEX; … … 3787 3787 if(elimination_variables>0) 3788 3788 { 3789 short elimination_ref;3789 int elimination_ref; 3790 3790 if(!strcmp(elimination_refinement,"LEX")) 3791 3791 elimination_ref=LEX; … … 3914 3914 char NEW_GROEBNER[128]; 3915 3915 3916 short i=0;3916 int i=0; 3917 3917 while(NEW_COST[i]!='\0' && NEW_COST[i]!='.') 3918 3918 {
Note: See TracChangeset
for help on using the changeset viewer.