Changeset 5e03fb in git


Ignore:
Timestamp:
Jul 19, 2013, 5:19:36 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
91ce59878acf5e8669fdebcfb3b4036d3963a6f5
Parents:
e380c094a09f6af6dd282c36d78055ec8bd24ece
git-author:
Martin Lee <martinlee84@web.de>2013-07-19 17:19:36+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-07-22 15:49:54+02:00
Message:
chg: arrange variables by deg if their leading coeff has the same size
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqFactorize.cc

    re380c09 r5e03fb  
    143143  {
    144144    degsf[i]= 0;
    145     swap [i]= new int [2];
     145    swap [i]= new int [3];
    146146    swap [i] [0]= 0;
    147147    swap [i] [1]= 0;
     148    swap [i] [2]= 0;
    148149  }
    149150  int i= 1;
     
    157158    swap[n][0]= i;
    158159    swap[n][1]= size (LC (F,i));
     160    swap[n][2]= degsf [i];
    159161    if (i != n)
    160162      result= swapvar (result, Variable (n), Variable(i));
     
    162164  }
    163165
    164   int buf1, buf2;
     166  int buf1, buf2, buf3;
    165167  n--;
    166168
     
    173175        buf1= swap [j + 1] [0];
    174176        buf2= swap [j + 1] [1];
     177        buf3= swap [j + 1] [2];
    175178        swap[j + 1] [0]= swap[j] [0];
    176179        swap[j + 1] [1]= swap[j] [1];
     180        swap[j + 1] [2]= swap[j] [2];
    177181        swap[j][0]= buf1;
    178182        swap[j][1]= buf2;
     183        swap[j][2]= buf3;
     184        result= swapvar (result, Variable (j + 1), Variable (j));
     185      }
     186      else if (swap[j][1] == swap[j + 1][1] && swap[j][2] < swap[j + 1][2])
     187      {
     188        buf1= swap [j + 1] [0];
     189        buf2= swap [j + 1] [1];
     190        buf3= swap [j + 1] [2];
     191        swap[j + 1] [0]= swap[j] [0];
     192        swap[j + 1] [1]= swap[j] [1];
     193        swap[j + 1] [2]= swap[j] [2];
     194        swap[j][0]= buf1;
     195        swap[j][1]= buf2;
     196        swap[j][2]= buf3;
    179197        result= swapvar (result, Variable (j + 1), Variable (j));
    180198      }
Note: See TracChangeset for help on using the changeset viewer.