Changeset 194c2e7 in git for IntegerProgramming


Ignore:
Timestamp:
Feb 9, 2010, 6:50:36 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
6c939eebfd221f2512b1e27d158d1b5457206987
Parents:
a477f80136c773f8acffd73512f53bf88a7c6fe8
Message:
short -> int

git-svn-id: file:///usr/local/Singular/svn/trunk@12539 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
IntegerProgramming
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • IntegerProgramming/Buchberger.cc

    ra477f80 r194c2e7  
    6363    // we reach this element.
    6464
    65     short supp2=bin2.head_support%Number_of_Lists;
    66     short supp_union=(bin1.head_support%Number_of_Lists)|supp2;
     65    int supp2=bin2.head_support%Number_of_Lists;
     66    int supp_union=(bin1.head_support%Number_of_Lists)|supp2;
    6767    // supp_union (read as binary vector) is the union of the supports of
    6868    // first_iter.get_element() and second_iter.get_element()
    6969    // (restricted to List_Support_Variables variables).
    7070
    71     for(short i=0;i<S.number_of_subsets[supp_union];i++)
     71    for(int i=0;i<S.number_of_subsets[supp_union];i++)
    7272      // Go through the lists that contain elements whose support is a
    7373      // subset of supp_union.
    7474    {
    75       short actual_list=S.subsets_of_support[supp_union][i];
     75      int actual_list=S.subsets_of_support[supp_union][i];
    7676      iter.set_to_list(generators[actual_list]);
    7777      // This is the i-th list among the generator list with elements
     
    136136    // Additionally,we can override lists whose support is to small.
    137137
    138     short supp1=bin1.head_support%Number_of_Lists;
    139     short supp2=bin2.head_support%Number_of_Lists;
    140     short supp_union=supp1|supp2;
     138    int supp1=bin1.head_support%Number_of_Lists;
     139    int supp2=bin2.head_support%Number_of_Lists;
     140    int supp_union=supp1|supp2;
    141141    // supp_union (read as binary vector) is the union of the supports of
    142142    // first_iter.get_element() and second_iter.get_element()
    143143    // (restricted to List_Support_Variables variables).
    144144
    145     for(short i=0;i<S.number_of_subsets[supp_union];i++)
     145    for(int i=0;i<S.number_of_subsets[supp_union];i++)
    146146      // Go through the lists that contain elements whose support is a
    147147      // subset of supp_union.
    148148    {
    149       short actual_list=S.subsets_of_support[supp_union][i];
     149      int actual_list=S.subsets_of_support[supp_union][i];
    150150
    151151      if((actual_list|supp2) != supp_union)
     
    221221    // (second_iter.get_element()).head_support.
    222222
    223     short supp2=bin2.head_support%Number_of_Lists;
    224     short supp_union=(bin1.head_support%Number_of_Lists)|supp2;
     223    int supp2=bin2.head_support%Number_of_Lists;
     224    int supp_union=(bin1.head_support%Number_of_Lists)|supp2;
    225225    // supp_union (read as binary vector) is the union of the supports of
    226226    // first_iter.get_element() and second_iter.get_element()
     
    231231      // subset of supp_union.
    232232    {
    233       short actual_list=S.subsets_of_support[supp_union][i];
     233      int actual_list=S.subsets_of_support[supp_union][i];
    234234
    235235      if(actual_list<=supp2)
     
    291291    // and (second_iter.get_element()).head_support.
    292292
    293     short supp1=bin1.head_support%Number_of_Lists;
    294     short supp2=bin2.head_support%Number_of_Lists;
    295     short supp_union=supp1|supp2;
     293    int supp1=bin1.head_support%Number_of_Lists;
     294    int supp2=bin2.head_support%Number_of_Lists;
     295    int supp_union=supp1|supp2;
    296296    // supp_union (read as binary vector) is the union of the supports of
    297297    // first_iter.get_element() and second_iter.get_element()
    298298    // (restricted to List_Support_Variables variables)
    299299
    300     for(short i=0;i<S.number_of_subsets[supp_union];i++)
     300    for(int i=0;i<S.number_of_subsets[supp_union];i++)
    301301      // Go through the lists that contain elements whose support is a
    302302      // subset of supp_union.
    303303    {
    304       short actual_list=S.subsets_of_support[supp_union][i];
     304      int actual_list=S.subsets_of_support[supp_union][i];
    305305
    306306      if((actual_list==supp1) || (actual_list==supp2))
     
    434434  list_iterator first_iter;
    435435
    436   for(short i=0;i<Number_of_Lists;i++)
     436  for(int i=0;i<Number_of_Lists;i++)
    437437  {
    438438    first_iter.set_to_list(generators[i]);
     
    460460      // Then search over the remaining lists.
    461461
    462       for(short j=i+1;j<Number_of_Lists;j++)
     462      for(int j=i+1;j<Number_of_Lists;j++)
    463463      {
    464464        second_iter.set_to_list(generators[j]);
     
    485485      list_iterator second_iter;
    486486
    487       for(short j=i+1;j<Number_of_Lists;j++)
     487      for(int j=i+1;j<Number_of_Lists;j++)
    488488        // search over remaining lists
    489489      {
     
    548548  list_iterator first_iter;
    549549
    550   for(short i=0;i<Number_of_Lists;i++)
     550  for(int i=0;i<Number_of_Lists;i++)
    551551  {
    552552    first_iter.set_to_list(generators[i]);
     
    575575      // Then search over the remaining lists.
    576576
    577       for(short j=i+1;j<Number_of_Lists;j++)
     577      for(int j=i+1;j<Number_of_Lists;j++)
    578578      {
    579579        second_iter.set_to_list(generators[j]);
     
    601601      list_iterator second_iter;
    602602
    603       for(short j=i+1;j<Number_of_Lists;j++)
     603      for(int j=i+1;j<Number_of_Lists;j++)
    604604        // search over remaining lists
    605605      {
     
    731731
    732732
    733   for(short i=0;i<Number_of_Lists;i++)
     733  for(int i=0;i<Number_of_Lists;i++)
    734734  {
    735735    first_iter.set_to_list(generators[i]);
     
    784784      // Then search over the remaining lists.
    785785
    786       for(short j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
     786      for(int j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
    787787      {
    788788        second_iter.set_to_list(generators[j]);
     
    841841      second_iter.next();
    842842
    843      for(short j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
     843     for(int j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
    844844      {
    845845        second_iter.set_to_list(generators[j]);
     
    995995
    996996
    997   for(short i=0;i<Number_of_Lists;i++)
     997  for(int i=0;i<Number_of_Lists;i++)
    998998  {
    999999    first_iter.set_to_list(generators[i]);
     
    10481048      // Then search over the remaining lists.
    10491049
    1050       for(short j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
     1050      for(int j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
    10511051      {
    10521052        second_iter.set_to_list(generators[j]);
     
    11051105      second_iter.next();
    11061106
    1107      for(short j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
     1107     for(int j=i+1;(j<Number_of_Lists) && (first_reduced<=0);j++)
    11081108      {
    11091109        second_iter.set_to_list(generators[j]);
     
    12581258#ifdef SUPPORT_DRIVEN_METHODS_EXTENDED
    12591259
    1260   short supp1=(first_iter.get_element()).head_support%Number_of_Lists;
    1261   short supp2=(second_iter.get_element()).head_support%Number_of_Lists;
     1260  int supp1=(first_iter.get_element()).head_support%Number_of_Lists;
     1261  int supp2=(second_iter.get_element()).head_support%Number_of_Lists;
    12621262
    12631263  // Determine the lists over which we have to iterate.
     
    12701270  // With this formulation, we can use the subset tree as follows:
    12711271
    1272   short supp=bin.head_support%Number_of_Lists;
    1273   short inv_supp=Number_of_Lists-supp-1;
     1272  int supp=bin.head_support%Number_of_Lists;
     1273  int inv_supp=Number_of_Lists-supp-1;
    12741274  // This bit vector is the bitwise inverse of bin.head_support (restricted
    12751275  // to the variables considered in the list indices.
     
    12791279
    12801280
    1281   for(short i=0;i<S.number_of_subsets[inv_supp];i++)
    1282   {
    1283     short actual_list=Number_of_Lists-S.subsets_of_support[inv_supp][i]-1;
     1281  for(int i=0;i<S.number_of_subsets[inv_supp];i++)
     1282  {
     1283    int actual_list=Number_of_Lists-S.subsets_of_support[inv_supp][i]-1;
    12841284    // the actual list for iteration
    12851285    // The support of S.subsets_of_support[inv_supp][i] as a bit vector
     
    14831483
    14841484  list_iterator first_iter;
    1485   short found;
     1485  int found;
    14861486  // to control if a reduction has occurred during the actual iteration
    14871487
     
    14971497
    14981498      binomial& bin1=first_iter.get_element();
    1499       short first_changed=0;
     1499      int first_changed=0;
    15001500      // to control if the first element has been reduced
    15011501
     
    15081508      {
    15091509        binomial& bin2=second_iter.get_element();
    1510         short second_changed=0;
     1510        int second_changed=0;
    15111511
    15121512        if(bin1.reduce_head_by(bin2,w)!=0)
     
    16001600
    16011601  list_iterator first_iter;
    1602   short found;
     1602  int found;
    16031603  // to control if a reduction has occurred during the actual iteration
    16041604
     
    16141614    {
    16151615      binomial& bin1=first_iter.get_element();
    1616       short first_changed=0;
     1616      int first_changed=0;
    16171617      // to control if the first element has been reduced
    16181618
     
    17541754  list_iterator first_iter;
    17551755  list_iterator second_iter;
    1756   short found;
     1756  int found;
    17571757  // to control if a reduction has occurred during the actual iteration
    17581758
     
    17621762    // no reduction occurred yet
    17631763
    1764     for(short i=0;i<Number_of_Lists;i++)
     1764    for(int i=0;i<Number_of_Lists;i++)
    17651765    {
    17661766      first_iter.set_to_list(new_generators[i]);
     
    17821782// two iterators reference different lists.
    17831783
    1784         for(short j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
     1784        for(int j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
    17851785        {
    17861786          second_iter.set_to_list(new_generators[S.subsets_of_support[i][j]]);
     
    18801880// two iterators reference different lists.
    18811881
    1882         for(short j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
     1882        for(int j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
    18831883        {
    18841884          second_iter.set_to_list(new_generators[S.subsets_of_support[i][j]]);
     
    20502050
    20512051  list_iterator first_iter;
    2052   short found;
     2052  int found;
    20532053  // to control if a reduction has occurred during the actual iteration
    20542054
     
    20642064    {
    20652065      binomial& bin1=first_iter.get_element();
    2066       short first_changed=0;
     2066      int first_changed=0;
    20672067      // to control if the first element has been reduced
    20682068
     
    22272227  list_iterator first_iter;
    22282228  list_iterator second_iter;
    2229   short found;
     2229  int found;
    22302230  // to control if a reduction has occurred during the actual iteration
    22312231
     
    22352235    // no reduction occurred yet
    22362236
    2237     for(short i=0;i<Number_of_Lists;i++)
     2237    for(int i=0;i<Number_of_Lists;i++)
    22382238    {
    22392239      first_iter.set_to_list(generators[i]);
     
    22552255// two iterators reference different lists.
    22562256
    2257         for(short j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
     2257        for(int j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
    22582258        {
    22592259          second_iter.set_to_list(generators[S.subsets_of_support[i][j]]);
     
    23572357// two iterators reference different lists.
    23582358
    2359         for(short j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
     2359        for(int j=0;(j<S.number_of_subsets[i]-1)&&(changed==0);j++)
    23602360        {
    23612361          second_iter.set_to_list(generators[S.subsets_of_support[i][j]]);
     
    25602560  {
    25612561    binomial& bin=first_iter.get_element();
    2562     short changed;
     2562    int changed;
    25632563    // to control if bin has been reduced
    25642564
     
    25942594  list_iterator first_iter;
    25952595
    2596   for(short i=0;i<Number_of_Lists;i++)
     2596  for(int i=0;i<Number_of_Lists;i++)
    25972597  {
    25982598    first_iter.set_to_list(generators[i]);
     
    26012601    {
    26022602      binomial& bin=first_iter.get_element();
    2603       short changed;
     2603      int changed;
    26042604      // to control if bin has been reduced
    26052605
     
    26092609        list_iterator second_iter;
    26102610
    2611         short supp=bin.tail_support%Number_of_Lists;
     2611        int supp=bin.tail_support%Number_of_Lists;
    26122612        // determine the lists over which we have to iterate
    26132613
    2614         for(short j=0;(j<S.number_of_subsets[supp]) && (changed==0);j++)
     2614        for(int j=0;(j<S.number_of_subsets[supp]) && (changed==0);j++)
    26152615        {
    26162616          second_iter.set_to_list(generators[S.subsets_of_support[supp][j]]);
     
    26522652
    26532653
    2654 short ideal::add_new_generators()
     2654int ideal::add_new_generators()
    26552655{
    26562656// Reduces the binomials in the "new_generators" list(s) by the generators
     
    26602660#ifdef NO_SUPPORT_DRIVEN_METHODS_EXTENDED
    26612661
    2662   short result=0;
     2662  int result=0;
    26632663  // element inserted?
    26642664
     
    26862686#ifdef SUPPORT_DRIVEN_METHODS_EXTENDED
    26872687
    2688   short result=0;
     2688  int result=0;
    26892689  // element inserted?
    26902690
    26912691  list_iterator iter;
    26922692
    2693   for(short i=0;i<Number_of_Lists;i++)
     2693  for(int i=0;i<Number_of_Lists;i++)
    26942694  {
    26952695    iter.set_to_list(new_generators[i]);
     
    27852785    // not yet reduced
    27862786
    2787     short supp=bin.head_support%Number_of_Lists;
     2787    int supp=bin.head_support%Number_of_Lists;
    27882788    // determine the lists over which we have to iterate
    27892789
     
    27922792    // that cannot contain reducers any more.
    27932793
    2794     for(short i=0;(i<S.number_of_subsets[supp]) && (reduced==0);i++)
     2794    for(int i=0;(i<S.number_of_subsets[supp]) && (reduced==0);i++)
    27952795    {
    27962796      iter.set_to_list(generators[S.subsets_of_support[supp][i]]);
     
    28162816      // not yet reduced
    28172817
    2818       short supp=bin.tail_support%Number_of_Lists;
     2818      int supp=bin.tail_support%Number_of_Lists;
    28192819      // determine the lists over which we have to iterate
    28202820
     
    28232823      // lists that cannot contain reducers any more.
    28242824
    2825       for(short i=0;(i<S.number_of_subsets[supp]) && (reduced==0);i++)
     2825      for(int i=0;(i<S.number_of_subsets[supp]) && (reduced==0);i++)
    28262826      {
    28272827        iter.set_to_list(generators[S.subsets_of_support[supp][i]]);
     
    28592859
    28602860
    2861 ideal& ideal::reduced_Groebner_basis_1(const short& S_pair_criteria,
     2861ideal& ideal::reduced_Groebner_basis_1(const int& S_pair_criteria,
    28622862                                       const float& interred_percentage)
    28632863{
     
    28722872  interreduction_percentage=interred_percentage;
    28732873
    2874   short done;
     2874  int done;
    28752875  // control variable for recognizing when Buchberger's algorithm has reached
    28762876  // his end
     
    29402940
    29412941
    2942 ideal& ideal::reduced_Groebner_basis_1a(const short& S_pair_criteria,
     2942ideal& ideal::reduced_Groebner_basis_1a(const int& S_pair_criteria,
    29432943                                        const float& interred_percentage)
    29442944{
     
    29532953  interreduction_percentage=interred_percentage;
    29542954
    2955   short done;
     2955  int done;
    29562956  // control variable for recognizing when Buchberger's algorithm has reached
    29572957  // his end
     
    30213021
    30223022
    3023 ideal& ideal::reduced_Groebner_basis_2(const short& S_pair_criteria,
     3023ideal& ideal::reduced_Groebner_basis_2(const int& S_pair_criteria,
    30243024                                       const float& interred_percentage)
    30253025{
     
    30343034  interreduction_percentage=interred_percentage;
    30353035
    3036   short done;
     3036  int done;
    30373037  // control variable for recognizing when Buchberger's algorithm has reached
    30383038  // his end
     
    31023102
    31033103
    3104 ideal& ideal::reduced_Groebner_basis_3(const short& S_pair_criteria,
     3104ideal& ideal::reduced_Groebner_basis_3(const int& S_pair_criteria,
    31053105                                       const float& interred_percentage)
    31063106{
     
    31153115  interreduction_percentage=interred_percentage;
    31163116
    3117   short not_done;
     3117  int not_done;
    31183118  // control variable for recognizing when Buchberger's algorithm has reached
    31193119  // his end
     
    31683168
    31693169
    3170 ideal& ideal::reduced_Groebner_basis(const short& version,
    3171                                      const short& S_pair_criteria,
     3170ideal& ideal::reduced_Groebner_basis(const int& version,
     3171                                     const int& S_pair_criteria,
    31723172                                     const float& interred_percentage)
    31733173{
     
    31833183        return reduced_Groebner_basis_3(S_pair_criteria, interred_percentage);
    31843184      default:
    3185         cerr<<"WARNING: ideal& ideal::reduced_Groebner_basis(const short&, "
    3186           "const short&, const float&):\n"
     3185        cerr<<"WARNING: ideal& ideal::reduced_Groebner_basis(const int&, "
     3186          "const int&, const float&):\n"
    31873187          "version argument out of range, nothing done"<<endl;
    31883188        return*this;
  • IntegerProgramming/IP_algorithms.cc

    ra477f80 r194c2e7  
    6161
    6262int 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,
    6565                   const float& interred_percentage,
    6666                   const BOOLEAN& verbose)
     
    7171
    7272  char format_string[128]; // to verifie file format
    73   short constraints;       // number of equality constraints
    74   short variables;         // number of variables (without auxiliary variables)
     73  int constraints;       // number of equality constraints
     74  int variables;         // number of variables (without auxiliary variables)
    7575
    7676  ifstream input(MATRIX);
     
    265265
    266266  char GROEBNER[128];
    267   short i=0;
     267  int i=0;
    268268  while(MATRIX[i]!='\0' && MATRIX[i]!='.')
    269269  {
     
    349349
    350350int 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,
    353353                            const float& interred_percentage,
    354354                            const BOOLEAN& verbose)
     
    359359
    360360  char format_string[128]; // to verifie file format
    361   short constraints;       // number of equality constraints
    362   short variables;         // number of variables (without auxiliary variables)
     361  int constraints;       // number of equality constraints
     362  int variables;         // number of variables (without auxiliary variables)
    363363
    364364  ifstream input(MATRIX);
     
    561561
    562562  char GROEBNER[128];
    563   short i=0;
     563  int i=0;
    564564  while(MATRIX[i]!='\0' && MATRIX[i]!='.')
    565565  {
     
    646646
    647647int 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,
    650650                        const float& interred_percentage,
    651651                        const BOOLEAN& verbose)
     
    656656
    657657  char format_string[128]; // to verifie file format
    658   short constraints;       // number of equality constraints
    659   short variables;         // number of variables (without auxiliary variables)
     658  int constraints;       // number of equality constraints
     659  int variables;         // number of variables (without auxiliary variables)
    660660
    661661  ifstream input(MATRIX);
     
    852852
    853853  char GROEBNER[128];
    854   short i=0;
     854  int i=0;
    855855  while(MATRIX[i]!='\0' && MATRIX[i]!='.')
    856856  {
     
    935935
    936936int Pottier(INPUT_FILE MATRIX,
    937             const short& version,
    938             const short& S_pair_criteria,
     937            const int& version,
     938            const int& S_pair_criteria,
    939939            const float& interred_percentage,
    940940            const BOOLEAN& verbose)
     
    945945
    946946  char format_string[128]; // to verifie file format
    947   short constraints;       // number of equality constraints
    948   short variables;         // number of variables (without auxiliary variables)
     947  int constraints;       // number of equality constraints
     948  int variables;         // number of variables (without auxiliary variables)
    949949
    950950  ifstream input(MATRIX);
     
    11401140
    11411141  char GROEBNER[128];
    1142   short i=0;
     1142  int i=0;
    11431143  while(MATRIX[i]!='\0' && MATRIX[i]!='.')
    11441144  {
     
    12231223
    12241224int 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,
    12271227                     const float& interred_percentage,
    12281228                     const BOOLEAN& verbose)
     
    12331233
    12341234  char format_string[128]; // to verifie file format
    1235   short constraints;       // number of equality constraints
    1236   short variables;         // number of variables
     1235  int constraints;       // number of equality constraints
     1236  int variables;         // number of variables
    12371237
    12381238  ifstream input(MATRIX);
     
    14651465  float *hom_grad=new float[variables];
    14661466
    1467   for(short i=0;i<variables;i++)
     1467  for(int i=0;i<variables;i++)
    14681468  {
    14691469    input>>hom_grad[i];
     
    15061506
    15071507  // 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);
    15101510  // memory for sat_var is allocated in the hosten_shapiro procedure
    15111511
    15121512  // 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++)
    15141514  {
    15151515    I.swap_variables(sat_var[i],variables-1);
     
    15511551
    15521552  char GROEBNER[128];
    1553   short i=0;
     1553  int i=0;
    15541554  while(MATRIX[i]!='\0' && MATRIX[i]!='.')
    15551555  {
     
    16341634
    16351635int 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,
    16381638                    const float& interred_percentage,
    16391639                    const BOOLEAN& verbose)
     
    16441644
    16451645  char format_string[128]; // to verify file format
    1646   short constraints;       // number of equality constraints
    1647   short variables;         // number of variables
     1646  int constraints;       // number of equality constraints
     1647  int variables;         // number of variables
    16481648
    16491649  ifstream input(MATRIX);
     
    18221822
    18231823  // 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);
    18261826
    18271827  if(r<0)
     
    18621862
    18631863    float* weights=new float[variables];
    1864     for(short j=0;j<variables;j++)
     1864    for(int j=0;j<variables;j++)
    18651865      weights[j]=0;
    18661866    weights[F[0]]=1;
     
    18801880    // But the following change of the term ordering will correct this.
    18811881
    1882     for(short l=1;l<r;l++)
     1882    for(int l=1;l<r;l++)
    18831883    {
    18841884      w.swap_weights(F[l-1],F[l]);
     
    19101910
    19111911  char GROEBNER[128];
    1912   short i=0;
     1912  int i=0;
    19131913  while(MATRIX[i]!='\0' && MATRIX[i]!='.')
    19141914  {
     
    20002000
    20012001int 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,
    20042004                             const float& interred_percentage,
    20052005                             const BOOLEAN& verbose)
     
    20102010
    20112011  char format_string[128];     // to verifie file format
    2012   short constraints;       // number of equality constraints
    2013   short variables;         // number of variables
     2012  int constraints;       // number of equality constraints
     2013  int variables;         // number of variables
    20142014
    20152015  ifstream input(MATRIX);
     
    22532253  float *hom_grad=new float[variables];
    22542254 
    2255   for(short _i=0;_i<variables;_i++)
     2255  for(int _i=0;_i<variables;_i++)
    22562256  {
    22572257    input>>hom_grad[_i];
     
    23242324
    23252325  char GROEBNER[128];
    2326   short i=0;
     2326  int i=0;
    23272327  while(MATRIX[i]!='\0' && MATRIX[i]!='.')
    23282328  {
     
    24102410
    24112411  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;
    24152415  char elimination_refinement[128];
    24162416  char weighted_refinement[128];
     
    26832683  }
    26842684
    2685   short weighted_ref;
     2685  int weighted_ref;
    26862686  if(!strcmp(weighted_refinement,"W_LEX"))
    26872687    weighted_ref=W_LEX;
     
    27122712  if(elimination_variables>0)
    27132713  {
    2714     short elimination_ref;
     2714    int elimination_ref;
    27152715    if(!strcmp(elimination_refinement,"LEX"))
    27162716      elimination_ref=LEX;
     
    30373037  char SOLUTION[128];
    30383038
    3039   short i=0;
     3039  int i=0;
    30403040  while(GROEBNER[i]!='\0' && GROEBNER[i]!='.')
    30413041  {
     
    30833083    Integer right_hand[weighted_variables+elimination_variables];
    30843084
    3085     for(short k=0;k<instances;k++)
     3085    for(int k=0;k<instances;k++)
    30863086    {
    30873087      // at the beginning, the variables of interest are zero
     
    31903190      BOOLEAN error=FALSE;    // to test legality of right hand vectors
    31913191
    3192       for(short k=0;k<instances;k++)
     3192      for(int k=0;k<instances;k++)
    31933193      {
    31943194        // at the beginning, the variables of interest are zero
     
    32953295      Integer initial_solution[weighted_variables];
    32963296
    3297       for(short k=0;k<instances;k++)
     3297      for(int k=0;k<instances;k++)
    32983298      {
    32993299        // initial solution vector is read from the input stream into the
     
    33633363
    33643364int 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,
    33673367                const float& interred_percentage,
    33683368                const BOOLEAN& verbose)
     
    33703370
    33713371  char format_string[128];
    3372   short elimination_variables;
    3373   short weighted_variables;
     3372  int elimination_variables;
     3373  int weighted_variables;
    33743374  char elimination_refinement[128];
    33753375  char weighted_refinement[128];
    3376   short new_variables;
     3376  int new_variables;
    33773377  char algorithm[128];
    33783378  long old_size;
     
    37583758  // the term ordering to refine the weight is taken to be the same as that
    37593759  // for the old Groebner basis
    3760   short weighted_ref;
     3760  int weighted_ref;
    37613761  if(!strcmp(weighted_refinement,"W_LEX"))
    37623762    weighted_ref=W_LEX;
     
    37873787  if(elimination_variables>0)
    37883788  {
    3789     short elimination_ref;
     3789    int elimination_ref;
    37903790    if(!strcmp(elimination_refinement,"LEX"))
    37913791      elimination_ref=LEX;
     
    39143914  char NEW_GROEBNER[128];
    39153915
    3916   short i=0;
     3916  int i=0;
    39173917  while(NEW_COST[i]!='\0' && NEW_COST[i]!='.')
    39183918  {
  • IntegerProgramming/IP_algorithms.h

    ra477f80 r194c2e7  
    4949
    5050extern int Conti_Traverso(INPUT_FILE MATRIX,
    51                           const short& version=1,
    52                           const short& S_pair_criteria=11,
     51                          const int& version=1,
     52                          const int& S_pair_criteria=11,
    5353                          const float& interred_percentage=12.0,
    5454                          const BOOLEAN& verbose=FALSE);
     
    5858
    5959extern int Positive_Conti_Traverso(INPUT_FILE MATRIX,
    60                                    const short& version=1,
    61                                    const short& S_pair_criteria=11,
     60                                   const int& version=1,
     61                                   const int& S_pair_criteria=11,
    6262                                   const float& interred_percentage=12.0,
    6363                                   const BOOLEAN& verbose=FALSE);
     
    6666
    6767extern int Elim_Conti_Traverso(INPUT_FILE MATRIX,
    68                                const short& version=1,
    69                                const short& S_pair_criteria=11,
     68                               const int& version=1,
     69                               const int& S_pair_criteria=11,
    7070                               const float& interred_percentage=12.0,
    7171                               const BOOLEAN& verbose=FALSE);
     
    7575
    7676extern int Pottier(INPUT_FILE MATRIX,
    77                    const short& version=1,
    78                    const short& S_pair_criteria=11,
     77                   const int& version=1,
     78                   const int& S_pair_criteria=11,
    7979                   const float& interred_percentage=12.0,
    8080                   const BOOLEAN& verbose=FALSE);
     
    8383
    8484extern int Hosten_Sturmfels(INPUT_FILE MATRIX,
    85                             const short& version=1,
    86                             const short& S_pair_criteria=11,
     85                            const int& version=1,
     86                            const int& S_pair_criteria=11,
    8787                            const float& interred_percentage=12.0,
    8888                            const BOOLEAN& verbose=FALSE);
     
    9292
    9393extern int DiBiase_Urbanke(INPUT_FILE MATRIX,
    94                            const short& version=1,
    95                            const short& S_pair_criteria=11,
     94                           const int& version=1,
     95                           const int& S_pair_criteria=11,
    9696                           const float& interred_percentage=12.0,
    9797                           const BOOLEAN& verbose=FALSE);
     
    100100
    101101extern int Bigatti_LaScala_Robbiano(INPUT_FILE MATRIX,
    102                                     const short& version=1,
    103                                     const short& S_pair_criteria=11,
     102                                    const int& version=1,
     103                                    const int& S_pair_criteria=11,
    104104                                    const float& interred_percentage=12.0,
    105105                                    const BOOLEAN& verbose=FALSE);
     
    128128
    129129extern int change_cost(INPUT_FILE GROEBNER, INPUT_FILE NEW_COST,
    130                        const short& version=1,
    131                        const short& S_pair_criteria=11,
     130                       const int& version=1,
     131                       const int& S_pair_criteria=11,
    132132                       const float& interred_percentage=12.0,
    133133                       const BOOLEAN& verbose=FALSE);
  • IntegerProgramming/globals.h

    ra477f80 r194c2e7  
    6060// The general data type to deal with can be short, long or int...
    6161
    62 #define _SHORT_
     62//#define _SHORT_
    6363// For an overflow control for thE result of the LLL algorithm, we have to
    6464// know the data type used.
  • IntegerProgramming/ideal.cc

    ra477f80 r194c2e7  
    1919void ideal::create_subset_tree()
    2020{
    21   for(short i=0;i<Number_of_Lists;i++)
     21  for(int i=0;i<Number_of_Lists;i++)
    2222  {
    2323
     
    2727// bits in i that are 1. Hence the desired number is 2^s.
    2828
    29     short s=0;
    30 
    31     for(short k=0;k<List_Support_Variables;k++)
     29    int s=0;
     30
     31    for(int k=0;k<List_Support_Variables;k++)
    3232      if( (i&(1<<k)) == (1<<k) )
    3333        // bit k of i is 1
     
    4343// in this function.)
    4444
    45     S.subsets_of_support[i]=new short[S.number_of_subsets[i]];
     45    S.subsets_of_support[i]=new int[S.number_of_subsets[i]];
    4646    // memory allocation for subsets_of_support[i]
    4747
    48     short index=0;
    49     for(short j=0;j<Number_of_Lists;j++)
     48    int index=0;
     49    for(int j=0;j<Number_of_Lists;j++)
    5050      if((i&j)==j)
    5151        // If the support of j as a bit vector is contained in the support of
     
    6060void ideal::destroy_subset_tree()
    6161{
    62   for(short i=0;i<Number_of_Lists;i++)
     62  for(int i=0;i<Number_of_Lists;i++)
    6363    delete[] S.subsets_of_support[i];
    64   // The arrays number_of_subsets and subsets_of_support (the (short*)-array)
     64  // The arrays number_of_subsets and subsets_of_support (the (int*)-array)
    6565  // are not dynamically allocated and do not have to be deleted.
    6666}
     
    134134
    135135  // build initial ideal generators
    136   for(short j=0;j<A.columns;j++)
    137   {
    138     for(short k=0;k<A.columns;k++)
     136  for(int j=0;j<A.columns;j++)
     137  {
     138    for(int k=0;k<A.columns;k++)
    139139      // original variables
    140140      if(j==k)
     
    143143        generator[k]=0;
    144144
    145     for(short i=0;i<A.rows;i++)
     145    for(int i=0;i<A.rows;i++)
    146146      // elimination variables
    147147      generator[A.columns+i]=A.coefficients[i][j];
     
    159159
    160160  // now add the "inversion generator"
    161   for(short j=0;j<A.columns;j++)
     161  for(int j=0;j<A.columns;j++)
    162162    generator[j]=0;
    163   for(short i=0;i<A.rows+1;i++)
     163  for(int i=0;i<A.rows+1;i++)
    164164    generator[A.columns+i]=1;
    165165  binomial* bin=new binomial(A.rows+1+A.columns,generator,w);
     
    188188
    189189  // build the initial ideal generators
    190   for(short j=0;j<A.columns;j++)
    191   {
    192     for(short k=0;k<A.columns;k++)
     190  for(int j=0;j<A.columns;j++)
     191  {
     192    for(int k=0;k<A.columns;k++)
    193193      // original variables
    194194      if(j==k)
     
    197197        generator[k]=0;
    198198
    199     for(short i=0;i<A.rows;i++)
     199    for(int i=0;i<A.rows;i++)
    200200      // elimination variables
    201201      generator[A.columns+i]=A.coefficients[i][j];
     
    239239
    240240  // compute initial generating system from the kernel of A
    241   for(short j=0;j<A._kernel_dimension;j++)
    242   {
    243 
    244     for(short k=0;k<A.columns;k++)
     241  for(int j=0;j<A._kernel_dimension;j++)
     242  {
     243
     244    for(int k=0;k<A.columns;k++)
    245245    {
    246246
     
    257257          "term_ordering&):\n"
    258258          "LLL-reduced kernel basis does not fit into the used "
    259           "basic data type short."<<endl;
     259          "basic data type int."<<endl;
    260260        size=-3;
    261261        delete[] generator;
     
    315315  // of the computed saturation generator is smaller if less variables are
    316316  // involved.
    317   short* sat_var = NULL; 
    318   short number_of_sat_var = A.hosten_shapiro(sat_var);
     317  int* sat_var = NULL; 
     318  int number_of_sat_var = A.hosten_shapiro(sat_var);
    319319  if( (number_of_sat_var == 0) || (sat_var == NULL) )
    320320  {
     
    323323  }
    324324
    325   for(short j=0;j<A.columns;j++)
     325  for(int j=0;j<A.columns;j++)
    326326    generator[j]=0;
    327327
    328   for(short k=0;k<number_of_sat_var;k++)
     328  for(int k=0;k<number_of_sat_var;k++)
    329329    generator[sat_var[k]]=1;
    330330
     
    373373
    374374  // compute initial generating system from the kernel of A
    375   for(short j=0;j<A._kernel_dimension;j++)
    376   {
    377 
    378     for(short k=0;k<A.columns;k++)
     375  for(int j=0;j<A._kernel_dimension;j++)
     376  {
     377
     378    for(int k=0;k<A.columns;k++)
    379379    {
    380380
     
    390390        cerr<<"\nWARNING: ideal& ideal::Hosten_Sturmfels_ideal(matrix&, const "
    391391          "term_ordering&):\nLLL-reduced kernel basis does not fit "
    392           "into the used basic data type short."<<endl;
     392          "into the used basic data type int."<<endl;
    393393        size=-3;
    394394        delete[] generator;
     
    462462  // now compute flip variables
    463463
    464   short* F;
     464  int* F;
    465465  // set of flip variables
    466466  // If F[i]==j, x_j will be flipped.
    467467
    468   short r=A.compute_flip_variables(F);
     468  int r=A.compute_flip_variables(F);
    469469  // number of flip variables
    470470
     
    485485  if(r>0)
    486486  {
    487     for(short i=0;i<_w.number_of_weighted_variables();i++)
     487    for(int i=0;i<_w.number_of_weighted_variables();i++)
    488488      if((_w[i]!=0) && (i!=F[0]))
    489489        ordering_okay=FALSE;
     
    499499
    500500  // compute initial generating system from the kernel of A
    501   for(short j=0;j<A._kernel_dimension;j++)
    502   {
    503 
    504     for(short k=0;k<A.columns;k++)
     501  for(int j=0;j<A._kernel_dimension;j++)
     502  {
     503
     504    for(int k=0;k<A.columns;k++)
    505505    {
    506506
     
    516516        cerr<<"\nWARNING: ideal& ideal::DiBiase_Urbanke_ideal(matrix&, const "
    517517          "term_ordering&):\nLLL-reduced kernel basis does not fit "
    518           "into the used basic data type short."<<endl;
     518          "into the used basic data type int."<<endl;
    519519        size=-3;
    520520        delete[] generator;
     
    555555
    556556    // flip variables
    557     for(short l=0;l<r;l++)
     557    for(int l=0;l<r;l++)
    558558      generator[F[l]]*=-1;
    559559
     
    599599  //   smaller in term ordering.
    600600  // - The weight of the pseudo-elimination variable is smaller.
    601   short* sat_var;
    602   short number_of_sat_var=A.hosten_shapiro(sat_var);
     601  int* sat_var;
     602  int number_of_sat_var=A.hosten_shapiro(sat_var);
    603603
    604604  float weight=0;
    605   for(short i=0;i<number_of_sat_var;i++)
     605  for(int i=0;i<number_of_sat_var;i++)
    606606    weight+=w[sat_var[i]];
    607607
     
    614614
    615615  // first build "saturation generator"
    616   for(short k=0;k<A.columns;k++)
     616  for(int k=0;k<A.columns;k++)
    617617    generator[k]=0;
    618   for(short i=0;i<number_of_sat_var;i++)
     618  for(int i=0;i<number_of_sat_var;i++)
    619619    generator[sat_var[i]]=1;
    620620  generator[A.columns]=-1;
     
    626626
    627627  // compute initial generating system from the kernel of A
    628   for(short j=0;j<A._kernel_dimension;j++)
    629   {
    630     for(short k=0;k<A.columns;k++)
     628  for(int j=0;j<A._kernel_dimension;j++)
     629  {
     630    for(int k=0;k<A.columns;k++)
    631631    {
    632632      // We should first verifie if the components of the LLL-reduced lattice
     
    641641        cerr<<"\nWARNING: ideal& ideal::Bigatti_LaScala_Robbiano_ideal"
    642642          "(matrix&, const term_ordering&):\nLLL-reduced kernel basis does "
    643           "not fit into the used basic data type short."<<endl;
     643          "not fit into the used basic data type int."<<endl;
    644644        size=-3;
    645645        delete[] generator;
     
    701701/////////////////// constructors and destructor /////////////////////////////
    702702
    703 ideal::ideal(matrix& A, const term_ordering& _w, const short& algorithm)
     703ideal::ideal(matrix& A, const term_ordering& _w, const int& algorithm)
    704704{
    705705
     
    709709  {
    710710    cerr<<"\nWARNING: ideal::ideal(matrix&, const term_ordering&, const "
    711       "short&):\ncannot create ideal from a corrupt input matrix"<<endl;
     711      "int&):\ncannot create ideal from a corrupt input matrix"<<endl;
    712712    size=-1;
    713713    return;
     
    717717  {
    718718    cerr<<"\nWARNING: ideal::ideal(matrix&, const term_ordering&, const "
    719       "short&):\ncannot create ideal with a corrupt input ordering"<<endl;
     719      "int&):\ncannot create ideal with a corrupt input ordering"<<endl;
    720720    size=-1;
    721721    return;
     
    769769      default:
    770770        cerr<<"\nWARNING: ideal::ideal(matrix&, const term_ordering&, const "
    771           "short&):\nunknown algorithm for ideal construction"<<endl;
     771          "int&):\nunknown algorithm for ideal construction"<<endl;
    772772        size=-1;
    773773        return;
     
    828828  create_subset_tree();
    829829
    830   for(short i=0;i<Number_of_Lists;i++)
     830  for(int i=0;i<Number_of_Lists;i++)
    831831  {
    832832    iter.set_to_list(I.generators[i]);
     
    840840  }
    841841
    842   for(short i=0;i<Number_of_Lists;i++)
     842  for(int i=0;i<Number_of_Lists;i++)
    843843  {
    844844    iter.set_to_list(I.new_generators[i]);
     
    865865}
    866866
    867 ideal::ideal(ifstream& input, const term_ordering& _w, const short&
     867ideal::ideal(ifstream& input, const term_ordering& _w, const int&
    868868             number_of_generators)
    869869{
     
    871871  {
    872872    cerr<<"\nWARNING: ideal::ideal(ifstream&, const term_ordering&, const "
    873       "short&):\ncannot create ideal with a corrupt input ordering"<<endl;
     873      "int&):\ncannot create ideal with a corrupt input ordering"<<endl;
    874874    size=-1;
    875875    return;
     
    895895#endif  // SUPPORT_DRIVEN_METHODS_EXTENDED
    896896
    897   short number_of_variables=
     897  int number_of_variables=
    898898    w.number_of_elimination_variables()+w.number_of_weighted_variables();
    899899  Integer* generator=new Integer[number_of_variables];
     
    901901  for(long i=0;i<number_of_generators;i++)
    902902  {
    903     for(short j=0;j<number_of_variables;j++)
     903    for(int j=0;j<number_of_variables;j++)
    904904    {
    905905      input>>generator[j];
     
    909909      {
    910910        cerr<<"\nWARNING: ideal::ideal(ifstream&, const term_ordering&, "
    911           "const short&): \ninput failure when reading generator "<<i<<endl;
     911          "const int&): \ninput failure when reading generator "<<i<<endl;
    912912        size=-2;
    913913        delete[] generator;
     
    942942}
    943943
    944 short ideal::error_status() const
     944int ideal::error_status() const
    945945{
    946946  if(size<0)
     
    961961#ifdef SUPPORT_DRIVEN_METHODS_EXTENDED
    962962
    963   for(short i=0;i<Number_of_Lists;i++)
     963  for(int i=0;i<Number_of_Lists;i++)
    964964    generators[i].ordered_print(w);
    965965
     
    10021002#ifdef SUPPORT_DRIVEN_METHODS_EXTENDED
    10031003
    1004   for(short i=0;i<Number_of_Lists;i++)
     1004  for(int i=0;i<Number_of_Lists;i++)
    10051005    generators[i].ordered_print(output,w);
    10061006
     
    10431043#ifdef SUPPORT_DRIVEN_METHODS_EXTENDED
    10441044
    1045   for(short i=0;i<Number_of_Lists;i++)
     1045  for(int i=0;i<Number_of_Lists;i++)
    10461046    generators[i].ordered_print(output,w);
    10471047
     
    10791079#ifdef SUPPORT_DRIVEN_METHODS_EXTENDED
    10801080
    1081   for(short i=0;i<Number_of_Lists;i++)
     1081  for(int i=0;i<Number_of_Lists;i++)
    10821082    generators[i].ordered_format_print(output,w);
    10831083
  • IntegerProgramming/ideal.h

    ra477f80 r194c2e7  
    3333
    3434
    35 const short Number_of_Lists=1<<List_Support_Variables;
     35const int Number_of_Lists=1<<List_Support_Variables;
    3636
    3737
     
    4242typedef struct
    4343{
    44   short* subsets_of_support[Number_of_Lists];
    45   short number_of_subsets[Number_of_Lists];
     44  int* subsets_of_support[Number_of_Lists];
     45  int number_of_subsets[Number_of_Lists];
    4646} subset_tree;
    4747
     
    8080// flags for the use of the S-pair criteria and the autoreduction
    8181
    82   short rel_primeness;
    83   short M_criterion;
    84   short F_criterion;
    85   short B_criterion;
    86   short second_criterion;
     82  int rel_primeness;
     83  int M_criterion;
     84  int F_criterion;
     85  int B_criterion;
     86  int second_criterion;
    8787  // When BuchbergerŽs algorithm is called, we only use one argument which
    8888  // describes the combination of the criteria to be used (see in globals.h).
     
    150150  // Inserts a (new) generator in the appropriate list.
    151151
    152   short add_new_generators();
     152  int add_new_generators();
    153153  // Moves the new generators to the generator lists.
    154154
     
    221221// constructors and destructor (implemented in ideal.cc)
    222222
    223   ideal(matrix&, const term_ordering&, const short& algorithm);
     223  ideal(matrix&, const term_ordering&, const int& algorithm);
    224224  // Creates a binomial ideal from the given matrix using the given algorithm
    225225  // (see in globals.h).
     
    239239  // (or of an ideal and its elimination ideal).
    240240
    241   ideal(ifstream&, const term_ordering&, const short& number_of_generators);
     241  ideal(ifstream&, const term_ordering&, const int& number_of_generators);
    242242  // Reads an ideal from a given ifstream in the following way:
    243243  // A block of integers is converted into a binomial
     
    255255  // Returns the actual number of generators.
    256256
    257   short error_status() const;
     257  int error_status() const;
    258258  // Returns -1 if an error has occurred (i.e. size<0), else 0.
    259259
    260260// Buchberger stuff (implemented in Buchberger.cc)
    261261
    262   ideal& reduced_Groebner_basis_1(const short& S_pair_criteria=11,
     262  ideal& reduced_Groebner_basis_1(const int& S_pair_criteria=11,
    263263                                  const float& interred_percentage=12.0);
    264   ideal& reduced_Groebner_basis_1a(const short& S_pair_criteria=11,
     264  ideal& reduced_Groebner_basis_1a(const int& S_pair_criteria=11,
    265265                                   const float& interred_percentage=12.0);
    266   ideal& reduced_Groebner_basis_2(const short& S_pair_criteria=11,
     266  ideal& reduced_Groebner_basis_2(const int& S_pair_criteria=11,
    267267                                  const float& interred_percentage=12.0);
    268   ideal& reduced_Groebner_basis_3(const short& S_pair_criteria=11,
     268  ideal& reduced_Groebner_basis_3(const int& S_pair_criteria=11,
    269269                                  const float& interred_percentage=12.0);
    270270  // Several different versions of BuchbergerŽs algorithm for computing
     
    294294  // "between" the input ideal and its saturation.
    295295
    296   ideal& reduced_Groebner_basis(const short& version=1,
    297                                 const short& S_pair_criteria=11,
     296  ideal& reduced_Groebner_basis(const int& version=1,
     297                                const int& S_pair_criteria=11,
    298298                                const float& interred_percentage=12.0);
    299299  // Takes the version of BuchbergerŽs algorithm as above as an argument
     
    331331  // SUPPORT_DRIVEN_METHODS_EXTENDED are enabled.
    332332
    333   ideal& swap_variables(const short& i, const short& j);
     333  ideal& swap_variables(const int& i, const int& j);
    334334  // Swaps the i-th and the j-th variable in all generators as well as the
    335335  // corresponding components of the term ordering's weight vector.
     
    337337  // according to the new order on the variables.
    338338
    339   ideal& swap_variables_unsafe(const short& i, const short& j);
     339  ideal& swap_variables_unsafe(const int& i, const int& j);
    340340  // Swaps the i-th and the j-th variable in all generators as well as the
    341341  // corresponding components of the term ordering's weight vector.
    342342  // DANGER: The head/tail structure is not rebuilt!
    343343
    344   ideal& flip_variable_unsafe(const short& i);
     344  ideal& flip_variable_unsafe(const int& i);
    345345  // Inverts the sign of the i-th variable in all generators.
    346346  // DANGER: The list structure is not rebuilt!
  • IntegerProgramming/ideal_stuff.cc

    ra477f80 r194c2e7  
    6565
    6666  // elimination
    67   for(short i=0;i<Number_of_Lists;i++)
     67  for(int i=0;i<Number_of_Lists;i++)
    6868  {
    6969    iter.set_to_list(generators[i]);
     
    125125  list_iterator iter;
    126126
    127   short last_weighted_variable=w.number_of_weighted_variables()-1;
     127  int last_weighted_variable=w.number_of_weighted_variables()-1;
    128128
    129129
     
    167167// For the time needed by this function see the remarks for ideal::eliminate().
    168168
    169   for(short i=0;i<Number_of_Lists;i++)
     169  for(int i=0;i<Number_of_Lists;i++)
    170170  {
    171171    iter.set_to_list(generators[i]);
     
    260260// the aux_list and then reinserted according to their new head.
    261261
    262   for(short i=0;i<Number_of_Lists;i++)
     262  for(int i=0;i<Number_of_Lists;i++)
    263263  {
    264264    iter.set_to_list(generators[i]);
     
    314314
    315315
    316 ideal& ideal::swap_variables_unsafe(const short& i, const short& j)
     316ideal& ideal::swap_variables_unsafe(const int& i, const int& j)
    317317{
    318318  // first check arguments
     
    320320     || (j<0) || (j>=w.number_of_weighted_variables()))
    321321  {
    322     cout<<"WARNING: ideal::swap_variables(const short&, const short&)\n "
    323       "or ideal::swap_variables_unsafe(const short&, const short&):\n"
     322    cout<<"WARNING: ideal::swap_variables(const int&, const int&)\n "
     323      "or ideal::swap_variables_unsafe(const int&, const int&):\n"
    324324      "index out of range"<<endl;
    325325    return *this;
     
    353353// But head and tail are not adapted to the new term ordering induced by
    354354// the change of the variable order - this is only done in the "safe"
    355 // routine swap_variables(const short&, const short&).
    356 
    357   for(short l=0;l<Number_of_Lists;l++)
     355// routine swap_variables(const int&, const int&).
     356
     357  for(int l=0;l<Number_of_Lists;l++)
    358358  {
    359359    iter.set_to_list(generators[l]);
     
    393393
    394394
    395 ideal& ideal::swap_variables(const short& i, const short& j)
     395ideal& ideal::swap_variables(const int& i, const int& j)
    396396{
    397397
     
    407407
    408408
    409 ideal& ideal::flip_variable_unsafe(const short& i)
     409ideal& ideal::flip_variable_unsafe(const int& i)
    410410{
    411411  // first check argument
    412412  if((i<0) || (i>=w.number_of_weighted_variables()))
    413413  {
    414     cout<<"WARNING: ideal::flip_variables(const short&):\n"
     414    cout<<"WARNING: ideal::flip_variables(const int&):\n"
    415415      "argument out of range, nothing done"<<endl;
    416416    return *this;
     
    439439// to the aux_list and then reinserted according to their new head.
    440440
    441   for(short l=0;l<Number_of_Lists;l++)
     441  for(int l=0;l<Number_of_Lists;l++)
    442442  {
    443443    iter.set_to_list(generators[l]);
  • IntegerProgramming/matrix.cc

    ra477f80 r194c2e7  
    1212typedef BigInt* BigIntP;
    1313
    14 matrix::matrix(const short& row_number, const short& column_number)
     14matrix::matrix(const int& row_number, const int& column_number)
    1515    :rows(row_number),columns(column_number)
    1616{
     
    2222    // bad input, set "error flag"
    2323  {
    24     cerr<<"\nWARNING: matrix::matrix(const short&, const short&):\n"
     24    cerr<<"\nWARNING: matrix::matrix(const int&, const int&):\n"
    2525      "argument out of range"<<endl;
    2626    columns=-1;
     
    3131
    3232  coefficients=new IntegerP[rows];
    33   for(short i=0;i<rows;i++)
     33  for(int i=0;i<rows;i++)
    3434    coefficients[i]=new Integer[columns];
    35   for(short i=0;i<rows;i++)
    36     for(short j=0;j<columns;j++)
     35  for(int i=0;i<rows;i++)
     36    for(int j=0;j<columns;j++)
    3737      coefficients[i][j]=0;
    3838}
    3939
    40 matrix::matrix(const short& row_number, const short& column_number,
     40matrix::matrix(const int& row_number, const int& column_number,
    4141               Integer** entries)
    4242    :rows(row_number),columns(column_number)
     
    4949    // bad input, set "error flag"
    5050  {
    51     cerr<<"\nWARNING: matrix::matrix(const short&, const short&, Integr**):\n"
     51    cerr<<"\nWARNING: matrix::matrix(const int&, const int&, Integr**):\n"
    5252      "argument out of range"<<endl;
    5353    columns=-1;
     
    5858
    5959  coefficients=new IntegerP[rows];
    60   for(short i=0;i<rows;i++)
     60  for(int i=0;i<rows;i++)
    6161    coefficients[i]=new Integer[columns];
    62   for(short i=0;i<rows;i++)
    63     for(short j=0;j<columns;j++)
     62  for(int i=0;i<rows;i++)
     63    for(int j=0;j<columns;j++)
    6464      coefficients[i][j]=entries[i][j];
    6565  // coefficients[i] is the i-th row vector
     
    101101
    102102  coefficients=new IntegerP[rows];
    103   for(short i=0;i<rows;i++)
     103  for(int i=0;i<rows;i++)
    104104    coefficients[i]=new Integer[columns];
    105   for(short i=0;i<rows;i++)
    106     for(short j=0;j<columns;j++)
     105  for(int i=0;i<rows;i++)
     106    for(int j=0;j<columns;j++)
    107107    {
    108108      input>>coefficients[i][j];
     
    120120
    121121
    122 matrix::matrix(const short& m, const short& n, ifstream& input)
     122matrix::matrix(const int& m, const int& n, ifstream& input)
    123123{
    124124  _kernel_dimension=-2;
     
    129129    // bad input, set "error flag"
    130130  {
    131     cerr<<"\nWARNING: matrix::matrix(const short&, const short&, ifstream&):\n"
     131    cerr<<"\nWARNING: matrix::matrix(const int&, const int&, ifstream&):\n"
    132132      "argument out of range"<<endl;
    133133    columns=-1;
     
    141141
    142142  coefficients=new IntegerP[rows];
    143   for(short i=0;i<rows;i++)
     143  for(int i=0;i<rows;i++)
    144144    coefficients[i]=new Integer[columns];
    145   for(short i=0;i<rows;i++)
    146     for(short j=0;j<columns;j++)
     145  for(int i=0;i<rows;i++)
     146    for(int j=0;j<columns;j++)
    147147    {
    148148      input>>coefficients[i][j];
     
    173173
    174174  coefficients=new IntegerP[rows];
    175   for(short i=0;i<rows;i++)
     175  for(int i=0;i<rows;i++)
    176176    coefficients[i]=new Integer[columns];
    177   for(short i=0;i<rows;i++)
    178     for(short j=0;j<columns;j++)
     177  for(int i=0;i<rows;i++)
     178    for(int j=0;j<columns;j++)
    179179      coefficients[i][j]=A.coefficients[i][j];
    180180
     
    182182  {
    183183    H=new BigIntP[_kernel_dimension];
    184     for(short k=0;k<_kernel_dimension;k++)
     184    for(int k=0;k<_kernel_dimension;k++)
    185185      H[k]=new BigInt[columns];
    186     for(short k=0;k<_kernel_dimension;k++)
    187       for(short j=0;j<columns;j++)
     186    for(int k=0;k<_kernel_dimension;k++)
     187      for(int j=0;j<columns;j++)
    188188        H[k][j]=(A.H)[k][j];
    189189  }
     
    195195matrix::~matrix()
    196196{
    197   for(short i=0;i<rows;i++)
     197  for(int i=0;i<rows;i++)
    198198    delete[] coefficients[i];
    199199  delete[] coefficients;
     
    202202    // LLL-algorithm performed
    203203  {
    204     for(short i=0;i<_kernel_dimension;i++)
     204    for(int i=0;i<_kernel_dimension;i++)
    205205      delete[] H[i];
    206206    delete[] H;
     
    218218BOOLEAN matrix::is_nonnegative() const
    219219{
    220   for(short i=0;i<rows;i++)
    221     for(short j=0;j<columns;j++)
     220  for(int i=0;i<rows;i++)
     221    for(int j=0;j<columns;j++)
    222222      if(coefficients[i][j]<0)
    223223        return FALSE;
     
    227227
    228228
    229 short matrix::error_status() const
     229int matrix::error_status() const
    230230{
    231231  if(columns<0)
     
    237237
    238238
    239 short matrix::row_number() const
     239int matrix::row_number() const
    240240{
    241241  return rows;
     
    244244
    245245
    246 short matrix::column_number() const
     246int matrix::column_number() const
    247247{
    248248  return columns;
     
    257257
    258258
    259 short matrix::LLL_kernel_basis()
     259int matrix::LLL_kernel_basis()
    260260{
    261261
     
    263263  // (They are modified by the LLL-algorithm!)
    264264  BigInt** b=new BigIntP[columns];
    265   for(short n=0;n<columns;n++)
     265  for(int n=0;n<columns;n++)
    266266    b[n]=new BigInt[rows];
    267   for(short n=0;n<columns;n++)
    268     for(short m=0;m<rows;m++)
     267  for(int n=0;n<columns;n++)
     268    for(int m=0;m<rows;m++)
    269269      b[n][m]=coefficients[m][n];
    270270
     
    276276
    277277  // delete auxiliary vectors
    278   for(short n=0;n<columns;n++)
     278  for(int n=0;n<columns;n++)
    279279    delete[] b[n];
    280280  delete[] b;
     
    286286
    287287
    288 short matrix::compute_nonzero_kernel_vector()
     288int matrix::compute_nonzero_kernel_vector()
    289289{
    290290
     
    295295  if(_kernel_dimension==-1)
    296296  {
    297     cerr<<"\nWARNING: short matrix::compute_non_zero_kernel_vector(BigInt*&):"
     297    cerr<<"\nWARNING: int matrix::compute_non_zero_kernel_vector(BigInt*&):"
    298298      "\nerror in kernel basis, cannot compute the desired vector"<<endl;
    299299    return 0;
     
    302302  if(_kernel_dimension==0)
    303303  {
    304     cerr<<"\nWARNING: short matrix::compute_non_zero_kernel_vector(BigInt*&): "
     304    cerr<<"\nWARNING: int matrix::compute_non_zero_kernel_vector(BigInt*&): "
    305305      "\nkernel dimension is zero"<<endl;
    306306    return 0;
     
    318318
    319319  // determine number of zero components
    320   for(short i=0;i<_kernel_dimension;i++)
     320  for(int i=0;i<_kernel_dimension;i++)
    321321  {
    322322    M[i]=0;
    323     for(short j=0;j<columns;j++)
     323    for(int j=0;j<columns;j++)
    324324      if(H[i][j]==BigInt(0))
    325325        M[i]++;
     
    330330  // columns is an upper bound (not reached because the kernel basis cannot
    331331  // contain the zero vector)
    332   for(short i=0;i<_kernel_dimension;i++)
     332  for(int i=0;i<_kernel_dimension;i++)
    333333    if(M[i]<min)
    334334      min=M[i];
     
    337337  // and discard the others (the norm computation is why we have chosen the
    338338  // M[i] to be BigInts)
    339   for(short i=0;i<_kernel_dimension;i++)
     339  for(int i=0;i<_kernel_dimension;i++)
    340340    if(M[i]!=min)
    341341      M[i]=-1;
    342342    else
    343       for(short j=0;j<columns;j++)
     343      for(int j=0;j<columns;j++)
    344344        M[i]+=H[i][j]*H[i][j];
    345345  // As the lattice basis does not contain the zero vector, at least one M[i]
     
    348348  // determine the start vector, i.e. the one with least zero components, but
    349349  // smallest possible (euclidian) norm
    350   short min_index=-1;
    351   for(short i=0;i<_kernel_dimension;i++)
     350  int min_index=-1;
     351  for(int i=0;i<_kernel_dimension;i++)
    352352    if(M[i]>BigInt(0))
    353353      if(min_index==-1)
     
    377377// still a  l a t t i c e   basis).
    378378
    379   for(short current_position=1;current_position<columns;current_position++)
     379  for(int current_position=1;current_position<columns;current_position++)
    380380    // in fact, this loop will terminate before the condition in the
    381381    // for-statement is satisfied...
     
    386386
    387387    BOOLEAN found=TRUE;
    388     for(short j=0;j<columns;j++)
     388    for(int j=0;j<columns;j++)
    389389      if(H[0][j]==BigInt(0))
    390390        found=FALSE;
     
    401401    // determine number of components in each remaining vector that are zero
    402402    // in the vector itself as well as in the already constructed vector
    403     for(short i=current_position;i<_kernel_dimension;i++)
     403    for(int i=current_position;i<_kernel_dimension;i++)
    404404      M[i]=0;
    405405
    406     short remaining_zero_components=0;
    407 
    408     for(short j=0;j<columns;j++)
     406    int remaining_zero_components=0;
     407
     408    for(int j=0;j<columns;j++)
    409409      if(H[0][j]==BigInt(0))
    410410      {
    411411        remaining_zero_components++;
    412         for(short i=current_position;i<_kernel_dimension;i++)
     412        for(int i=current_position;i<_kernel_dimension;i++)
    413413          if(H[i][j]==BigInt(0))
    414414            M[i]++;
     
    419419    // this is the number of zero components in H[0] and an upper bound
    420420    // for the M[i]
    421     for(short i=current_position;i<_kernel_dimension;i++)
     421    for(int i=current_position;i<_kernel_dimension;i++)
    422422      if(M[i]<min)
    423423        min=M[i];
     
    431431    // components
    432432    // discard the others
    433     for(short i=current_position;i<_kernel_dimension;i++)
     433    for(int i=current_position;i<_kernel_dimension;i++)
    434434      if(M[i]!=min)
    435435        M[i]=-1;
    436436      else
    437         for(short j=0;j<columns;j++)
     437        for(int j=0;j<columns;j++)
    438438          M[i]+=H[i][j]*H[i][j];
    439439    //  Again, at least one M[i] is positive!
     
    442442    // This is the vector with the least common zero components with respect
    443443    // to H[0], but the smallest possible norm.
    444     short min_index=0;
    445     for(short i=current_position;i<_kernel_dimension;i++)
     444    int min_index=0;
     445    for(int i=current_position;i<_kernel_dimension;i++)
    446446      if(M[i]>BigInt(0))
    447447        if(min_index==0)
     
    472472    found=FALSE;
    473473
    474     for(short mult=1;found==FALSE;mult++)
     474    for(int mult=1;found==FALSE;mult++)
    475475    {
    476476      found=TRUE;
     
    478478      // check if any component !=0 of H[0] becomes zero by adding
    479479      // mult*H[current_position]
    480       for(short j=0;j<columns;j++)
     480      for(int j=0;j<columns;j++)
    481481        if(H[0][j]!=BigInt(0))
    482482          if(H[0][j]+(const BigInt&)mult*H[current_position][j]
     
    485485
    486486      if(found==TRUE)
    487         for(short j=0;j<columns;j++)
     487        for(int j=0;j<columns;j++)
    488488          H[0][j]+=(const BigInt&)mult*H[current_position][j];
    489489      else
     
    495495        // check if any component !=0 of H[0] becomes zero by subtracting
    496496        // mult*H[current_position]
    497         for(short j=0;j<columns;j++)
     497        for(int j=0;j<columns;j++)
    498498          if(H[0][j]!=BigInt(0))
    499499            if(H[0][j]-(const BigInt&)mult*H[current_position][j]
     
    502502
    503503        if(found==TRUE)
    504           for(short j=0;j<columns;j++)
     504          for(int j=0;j<columns;j++)
    505505            H[0][j]-=(const BigInt&)mult*H[current_position][j];
    506506      }
     
    509509
    510510// When reaching this line, an error must have occurred.
    511   cerr<<"FATAL ERROR in short matrix::compute_nonnegative_vector()"<<endl;
     511  cerr<<"FATAL ERROR in int matrix::compute_nonnegative_vector()"<<endl;
    512512  abort();
    513513}
    514514
    515 short matrix::compute_flip_variables(short*& F)
     515int matrix::compute_flip_variables(int*& F)
    516516{
    517517  // first compute nonzero vector
     
    520520  if(!okay)
    521521  {
    522     cout<<"\nWARNING: short matrix::compute_flip_variables(short*&):\n"
     522    cout<<"\nWARNING: int matrix::compute_flip_variables(int*&):\n"
    523523      "kernel of the matrix contains no vector with nonzero components,\n"
    524524      "no flip variables computed"<<endl;
     
    530530  // or those corresponding to the negative ones
    531531
    532   short r=0;
     532  int r=0;
    533533  // number of flip variables
    534534
    535   for(short j=0;j<columns;j++)
     535  for(int j=0;j<columns;j++)
    536536    if(H[0][j]<BigInt(0))
    537537      r++;
     
    547547  {
    548548    r=columns-r;
    549     F=new short[r];
    550     memset(F,0,r*sizeof(short));
    551     short counter=0;
    552     for(short j=0;j<columns;j++)
     549    F=new int[r];
     550    memset(F,0,r*sizeof(int));
     551    int counter=0;
     552    for(int j=0;j<columns;j++)
    553553      if(H[0][j]> BigInt(0))
    554554      {
     
    561561    // all variables corresponding to negative components will be flipped
    562562  {
    563     F=new short[r];
    564     memset(F,0,r*sizeof(short));
    565     short counter=0;
    566     for(short j=0;j<columns;j++)
     563    F=new int[r];
     564    memset(F,0,r*sizeof(int));
     565    int counter=0;
     566    for(int j=0;j<columns;j++)
    567567      if(H[0][j]< BigInt(0))
    568568      {
     
    578578
    579579
    580 short matrix::hosten_shapiro(short*& sat_var)
     580int matrix::hosten_shapiro(int*& sat_var)
    581581{
    582582
     
    587587  if(_kernel_dimension==-1)
    588588  {
    589     cerr<<"\nWARNING: short matrix::hosten_shapiro(short*&):\n"
     589    cerr<<"\nWARNING: int matrix::hosten_shapiro(int*&):\n"
    590590      "error in kernel basis, cannot compute the saturation variables"<<endl;
    591591    return 0;
     
    604604    return 0;
    605605
    606   short number_of_sat_var=0;
    607   sat_var=new short[columns/2];
    608   memset(sat_var,0,sizeof(short)*(columns/2));
     606  int number_of_sat_var=0;
     607  sat_var=new int[columns/2];
     608  memset(sat_var,0,sizeof(int)*(columns/2));
    609609
    610610  BOOLEAN* ideal_saturated_by_var=new BOOLEAN[columns];
    611611  // auxiliary array used to remember by which variables the ideal has still to
    612612  // be saturated
    613   for(short j=0;j<columns;j++)
     613  for(int j=0;j<columns;j++)
    614614    ideal_saturated_by_var[j]=FALSE;
    615615
    616   for(short k=0;k<_kernel_dimension;k++)
     616  for(int k=0;k<_kernel_dimension;k++)
    617617  {
    618618    // determine number of positive and negative components in H[k]
    619619    // corresponding to variables by which the ideal has still to be saturated
    620     short pos_sat_var=0;
    621     short neg_sat_var=0;
    622 
    623     for(short j=0;j<columns;j++)
     620    int pos_sat_var=0;
     621    int neg_sat_var=0;
     622
     623    for(int j=0;j<columns;j++)
    624624    {
    625625      if(ideal_saturated_by_var[j]==FALSE)
     
    637637    if(pos_sat_var<=neg_sat_var)
    638638    {
    639       for(short j=0;j<columns;j++)
     639      for(int j=0;j<columns;j++)
    640640        if(ideal_saturated_by_var[j]==FALSE)
    641641          if(H[k][j]> BigInt(0))
     
    655655    else
    656656    {
    657       for(short j=0;j<columns;j++)
     657      for(int j=0;j<columns;j++)
    658658        if(ideal_saturated_by_var[j]==FALSE)
    659659          if(H[k][j]< BigInt(0))
     
    691691  printf("\n%3d x %3d\n",rows,columns);
    692692
    693   for(short i=0;i<rows;i++)
    694   {
    695     for(short j=0;j<columns;j++)
     693  for(int i=0;i<rows;i++)
     694  {
     695    for(int j=0;j<columns;j++)
    696696      printf("%6d",coefficients[i][j]);
    697697    printf("\n");
     
    704704  fprintf(output,"\n%3d x %3d\n",rows,columns);
    705705
    706   for(short i=0;i<rows;i++)
    707   {
    708     for(short j=0;j<columns;j++)
     706  for(int i=0;i<rows;i++)
     707  {
     708    for(int j=0;j<columns;j++)
    709709      fprintf(output,"%6d",coefficients[i][j]);
    710710    fprintf(output,"\n");
     
    717717  output<<endl<<setw(3)<<rows<<" x "<<setw(3)<<columns<<endl;
    718718
    719   for(short i=0;i<rows;i++)
    720   {
    721     for(short j=0;j<columns;j++)
     719  for(int i=0;i<rows;i++)
     720  {
     721    for(int j=0;j<columns;j++)
    722722      output<<setw(6)<<coefficients[i][j];
    723723    output<<endl;
  • IntegerProgramming/matrix.h

    ra477f80 r194c2e7  
    3232private:
    3333
    34   short rows;
     34  int rows;
    3535
    36   short columns;
     36  int columns;
    3737  // Also used as error flag (values <0):
    3838  // -1 indicates a "semantic" error (which occurs e.g. if some constructor
     
    4848  // allocated if such a basis is really computed.
    4949
    50   short _kernel_dimension;
     50  int _kernel_dimension;
    5151  // the number of vectors stored in H (the size of these vectors is columns)
    5252  // If _kernel_dimension==-2, no kernel basis has been computed yet.
     
    6262// constructors and destructor
    6363
    64   matrix(const short& row_number, const short& column_number);
     64  matrix(const int& row_number, const int& column_number);
    6565  // Creates a zero matrix of the specified size.
    6666
    67   matrix(const short& row_number, const short& column_number,
     67  matrix(const int& row_number, const int& column_number,
    6868         Integer** entries);
    6969  // Builds a matrix from its coefficient array.
     
    8080  //    coefficients 0..n-1 of row m
    8181
    82   matrix(const short& m, const short& n, ifstream& input);
     82  matrix(const int& m, const int& n, ifstream& input);
    8383  // Reads a (m x n)-matrix from the given ifstream.
    8484  // The input stream must have the following format:
     
    102102  // Returns TRUE, if all entries of the matrix are >=0, else FALSE.
    103103
    104   short error_status() const;
     104  int error_status() const;
    105105  // Returns columns iff columns<0 (this is the "error flag"), else 0.
    106106
    107   short row_number() const;
     107  int row_number() const;
    108108  // Retuns the row number.
    109109
    110   short column_number() const;
     110  int column_number() const;
    111111  // Returns the column number.
    112112
    113   short kernel_dimension() const;
     113  int kernel_dimension() const;
    114114  // Returns the kernel dimension.
    115115
     
    118118// special routines for the IP-algorithms
    119119
    120   short LLL_kernel_basis();
     120  int LLL_kernel_basis();
    121121  // Computes a LLL-reduced integer basis of the matrix kernel and returns
    122122  // the kernel dimension (-1 if an error has occurred).
    123123  // This dimension is also stored in the member kernel_dimension.
    124124
    125   short compute_nonzero_kernel_vector();
     125  int compute_nonzero_kernel_vector();
    126126  // Transforms the kernel lattice basis stored in H so that it contains
    127127  // a vector whose components are all !=0;
     
    129129  // If no such basis has been computed before, this is done now.
    130130
    131   short compute_flip_variables(short*&);
     131  int compute_flip_variables(int*&);
    132132  // Computes a set of flip variables for the algorithm of DiBiase and
    133133  // Urbanke from a kernel vector with no zero components.
     
    137137  // is done in the routine) to be accessible for the calling function.
    138138
    139   short hosten_shapiro(short*& sat_var);
     139  int hosten_shapiro(int*& sat_var);
    140140  // Computes a set of saturation variables for the ideal defined by the
    141141  // kernel lattice and returns the size of that set.
  • IntegerProgramming/solve_IP.cc

    ra477f80 r194c2e7  
    1616  // with default settings
    1717  BOOLEAN verbose=FALSE;
    18   short version=1;
    19   short S_pair_criteria=11;
     18  int version=1;
     19  int S_pair_criteria=11;
    2020  double interreduction_percentage=12.0;
    2121
    2222///////////////////////// parse options /////////////////////////////////////
    2323
    24   short alg_option=0;
     24  int alg_option=0;
    2525  // no algorithm specified yet
    2626
     
    3030  {
    3131
    32     for(short i=1;i<argc-2;i++)
     32    for(int i=1;i<argc-2;i++)
    3333      // these are the input options
    3434    {
     
    250250      char* GROEBNER=new char[128];
    251251      memset(GROEBNER,0,128);
    252       short i=0;
     252      int i=0;
    253253      while(argv[argc-2][i]!='\0' && argv[argc-2][i]!='.' && argv[argc-2][i]>' ')
    254254      {
Note: See TracChangeset for help on using the changeset viewer.