Changeset a999fd in git


Ignore:
Timestamp:
Oct 18, 2010, 10:38:59 PM (14 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3a4bc649f1d0185cc9f8b122bd75f21f75ac9c9a')
Children:
ad71e3669c8c8d64f779fd51a1a2c0048ee81c44
Parents:
95643fdea6ca2ec88816aeb45336fabef78cdc5c
Message:
*levandov: update incl printlevel story and code cosmetics

git-svn-id: file:///usr/local/Singular/svn/trunk@13545 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ncfactor.lib

    r95643f ra999fd  
    434434  }
    435435  def prod = product(g);
    436   def limg = intvec(deg(prod,intvec(1,1)) ,deg(prod,intvec(1,0)),deg(prod,intvec(0,1)));
     436  intvec iv11 = intvec(1,1);
     437  intvec iv10 = intvec(1,0);
     438  intvec iv01 = intvec(0,1);
     439  def limg = intvec(deg(prod,iv11) ,deg(prod,iv10),deg(prod,iv01));
    437440  for (i = 1; i<=size(limg);i++)
    438441  {//the final check
     
    462465SEE ALSO: homogfacFirstWeyl_all
    463466"{//proc homogfacFirstWeyl
     467  int p = printlevel-voice+2;//for dbprint
    464468  def r = basering;
    465469  poly hath;
    466470  int i; int j;
    467   if (!homogwithorder(h,intvec(-1,1)))
     471  intvec ivm11 = intvec(-1,1);
     472  if (!homogwithorder(h,ivm11))
    468473  {//The given polynomial is not homogeneous
     474    ERROR("Given polynomial was not [-1,1]-homogeneous");
    469475    return(list());
    470476  }//The given polynomial is not homogeneous
     
    474480  }
    475481  list result;
    476   int m = deg(h,intvec(-1,1));
     482  int m = deg(h,ivm11);
     483  dbprint(p,"==> Splitting the polynomial in A_0 and A_k-Part");
    477484  if (m!=0)
    478485  {//The degree is not zero
     
    498505    hath = h;
    499506  }//The degree is zero
     507  dbprint(p,"==> Done");
    500508  //beginning to transform x^i*y^i in theta(theta-1)...(theta-i+1)
    501509  list mons;
     510  dbprint(p,"==> Putting the monomials in the A_0-part in a list.");
    502511  for(i = 1; i<=size(hath);i++)
    503512  {//Putting the monomials in a list
    504513    mons = mons+list(hath[i]);
    505514  }//Putting the monomials in a list
     515  dbprint(p,"==> Done");
     516  dbprint(p,"==> Mapping this monomials to K[theta]");
    506517  ring tempRing = 0,(x,y,theta),dp;
    507518  setring tempRing;
     
    518529    mons[i] = entry;
    519530  }//transforming the monomials as monomials in theta
     531  dbprint(p,"==> Done");
     532  dbprint(p,"==> Factorize the A_0-Part in K[theta]");
    520533  list azeroresult = factorize(sum(mons));
     534  dbprint(p,"==> Successful");
    521535  list azeroresult_return_form;
    522536  for (i = 1; i<=size(azeroresult[1]);i++)
     
    527541    }
    528542  }//rewrite the result of the commutative factorization
     543  dbprint(p,"==> Mapping back to A_0.");
    529544  setring(r);
    530545  map finalmap = tempRing,var(1),var(2),var(1)*var(2);
    531546  list tempresult = finalmap(azeroresult_return_form);
     547  dbprint(p,"Successful.");
    532548  for (i = 1; i<=size(tempresult);i++)
    533549  {//factorizations of theta resp. theta +1
     
    574590SEE ALSO: homogfacFirstWeyl
    575591"{//proc HomogfacFirstWeylAll
    576   if (deg(h,intvec(1,1)) <= 0 )
     592  int p=printlevel-voice+2;//for dbprint
     593  intvec iv11= intvec(1,1);
     594  if (deg(h,iv11) <= 0 )
    577595  {//h is a constant
     596    dbprint(p,"Given polynomial was not homogeneous");
    578597    return(list(list(h)));
    579598  }//h is a constant
     
    581600  list one_hom_fac; //stands for one homogeneous factorization
    582601  int i; int j; int k;
     602  intvec ivm11 = intvec(-1,1);
     603  dbprint(p,"==> Calculate one homogeneous factorization using homogfacFirstWeyl");
    583604  //Compute again a homogeneous factorization
    584605  one_hom_fac = homogfacFirstWeyl(h);
     606  dbprint(p,"Successful");
    585607  if (size(one_hom_fac) == 0)
    586608  {//there is no homogeneous factorization or the polynomial was not homogeneous
     
    594616  int is_list_azero_empty = 1;
    595617  k_factor = list(one_hom_fac[1]);
    596   if (absValue(deg(h,intvec(-1,1)))<size(one_hom_fac)-1)
     618  if (absValue(deg(h,ivm11))<size(one_hom_fac)-1)
    597619  {//There is a nontrivial A_0-part
    598     list_azero = one_hom_fac[2..(size(one_hom_fac)-absValue(deg(h,intvec(-1,1))))];
     620    list_azero = one_hom_fac[2..(size(one_hom_fac)-absValue(deg(h,ivm11)))];
    599621    is_list_azero_empty = 0;
    600622  }//There is a nontrivial A_0 part
     623  dbprint(p,"==> Combine x,y to xy in the factorization again.");
    601624  for (i = 1; i<=size(list_azero)-1;i++)
    602625  {//in homogfacFirstWeyl, we factorized theta, and this will be made undone
     
    618641    }
    619642  }//in homogfacFirstWeyl, we factorized theta, and this will be made undone
    620   if(deg(h,intvec(-1,1))!=0)
     643  dbprint(p,"==> Done");
     644  if(deg(h,ivm11)!=0)
    621645  {//list_not_azero is not empty
    622646    list_not_azero =
    623       one_hom_fac[(size(one_hom_fac)-absValue(deg(h,intvec(-1,1)))+1)..size(one_hom_fac)];
     647      one_hom_fac[(size(one_hom_fac)-absValue(deg(h,ivm11))+1)..size(one_hom_fac)];
    624648    is_list_not_azero_empty = 0;
    625649  }//list_not_azero is not empty
    626650  //Map list_azero in K[theta]
     651  dbprint(p,"==> Map list_azero to K[theta]");
    627652  ring tempRing = 0,(x,y,theta), dp;
    628653  setring(tempRing);
     
    643668  list k_factor = thetamap(k_factor);
    644669  list tempmons;
     670  dbprint(p,"==> Done");
    645671  for(i = 1; i<=size(list_azero);i++)
    646672  {//rewrite the polynomials in A1 as polynomials in K[theta]
     
    662688  }//rewrite the polynomials in A1 as polynomials in K[theta]
    663689  //Compute all permutations of the A0-part
     690  dbprint(p,"==> Compute all permutations of the A_0-part with the first resp. the snd. variable");
    664691  list result;
    665692  int shift_sign;
     
    703730    return(result);
    704731  }
     732  dbprint(p,"==> Done");
     733  dbprint(p,"==> Searching for theta resp. theta + 1 in the list and factorize them");
    705734  //Now we are going deeper and search for theta resp. theta + 1, substitute
    706735  //them by xy resp. yx and go on permuting
     
    811840    }//One entry was theta resp. theta +1
    812841  }//checking every entry of result for theta or theta +1
     842  dbprint(p,"==> Done");
    813843  //map back to the basering
     844  dbprint(p,"==> Mapping back everything to the basering");
    814845  setring(r);
    815846  map finalmap = tempRing, var(1), var(2),var(1)*var(2);
     
    819850    result[i] = k_factor + result[i];
    820851  }//adding the k-factor
     852  dbprint(p,"==> Done");
     853  dbprint(p,"==> Delete double entries in the list.");
    821854  result = delete_dublicates_noteval(result);
     855  dbprint(p,"==> Done");
    822856  return(result);
    823857}//proc HomogfacFirstWeylAll
     
    925959SEE ALSO: facSubWeyl, testNCfac, facFirstShift
    926960"{//proc facFirstWeyl
     961  //Definition of printlevel variable
     962  int p = printlevel-voice+2;
     963  dbprint(p,"==> Checking if the given algebra is a Weyl algebra");
    927964  //Redefine the ring in my standard form
    928965  if (!isWeyl())
    929966  {//Our basering is not the Weyl algebra
     967    ERROR("Ring was not the first Weyl algebra");
    930968    return(list());
    931969  }//Our basering is not the Weyl algebra
     970  dbprint(p,"==> Successful");
     971  dbprint(p,"==> Checking, if the given ring is the first Weyl algebra");
    932972  if(nvars(basering)!=2)
    933973  {//Our basering is the Weyl algebra, but not the first
     974    ERROR("==>Ring is not the first Weyl algebra");
    934975    return(list());
    935976  }//Our basering is the Weyl algebra, but not the first
     977  dbprint(p,"==> Successful");
    936978  list result = list();
    937979  int i;int j; int k; int l; //counter
    938980  if (ringlist(basering)[6][1,2] == -1) //manual of ringlist will tell you why
    939981  {
     982    dbprint(p,"==> positions of the variables have to be switched");
    940983    def r = basering;
    941984    ring tempRing = ringlist(r)[1][1],(x,y),Ws(-1,1); // very strange:
     
    944987    setring NTR ;
    945988    map transf = r, var(2), var(1);
     989    dbprint(p,"==> Successful");
     990    dbprint(p, "==> factorization of the polynomial with the routine sfacwa");
    946991    list resulttemp = sfacwa(transf(h));
     992    dbprint(p,"==> Done");
    947993    setring(r);
    948994    map transfback = NTR, var(2),var(1);
    949995    result = transfback(resulttemp);
    950996  }
    951   else { result = sfacwa(h);}
     997  else
     998  {
     999    dbprint(p, "==> factorization of the polynomial with the routine sfacwa");
     1000    result = sfacwa(h);
     1001    dbprint(p,"==> Done");
     1002  }
     1003  dbprint(p,"==> recursively check factors for irreducibility");
    9521004  list recursivetemp;
    9531005  for(i = 1; i<=size(result);i++)
     
    9761028    }//Nontrivial factorization
    9771029  }//recursively factorize factors
     1030  dbprint(p,"==> Done");
    9781031  if (size(result)==0)
    9791032  {//only the trivial factorization could be found
     
    10061059SEE ALSO: homogfacFirstWeyl_all, homogfacFirstWeyl
    10071060"{//proc sfacwa
    1008   if(homogwithorder(h,intvec(-1,1)))
    1009   {
     1061  int p=printlevel-voice+2; // for dbprint
     1062  intvec ivm11 = intvec(-1,1);
     1063  intvec iv11 = intvec(1,1);
     1064  intvec iv10 = intvec(1,0);
     1065  intvec iv01 = intvec(0,1);
     1066  intvec iv1m1 = intvec(1,-1);
     1067  if(homogwithorder(h,ivm11))
     1068  {
     1069    dbprint(p,"==> Given polynomial is -1,1 homogeneous. Starting homog. fac. and ret. its result");
    10101070    return(homogfacFirstWeyl_all(h));
    10111071  }
     
    10131073  map invo = basering,-var(1),var(2);
    10141074  int i; int j; int k;
    1015   intvec limits = deg(h,intvec(1,1)) ,deg(h,intvec(1,0)),deg(h,intvec(0,1));
     1075  dbprint(p,"==> Computing the degree-limits of the factorization");
     1076  intvec limits = deg(h,iv11) ,deg(h,iv10),deg(h,iv01);
    10161077  def prod;
    10171078  //end finding the limits
    1018   poly maxh = jet(h,deg(h,intvec(-1,1)),intvec(-1,1))-jet(h,deg(h,intvec(-1,1))-1,intvec(-1,1));
    1019   poly minh = jet(h,deg(h,intvec(1,-1)),intvec(1,-1))-jet(h,deg(h,intvec(1,-1))-1,intvec(1,-1));
     1079  dbprint(p,"==> Computing the maximal and the minimal homogeneous part of the give polynomial");
     1080  poly maxh = jet(h,deg(h,ivm11),ivm11)-jet(h,deg(h,ivm11)-1,ivm11);
     1081  poly minh = jet(h,deg(h,iv1m1),iv1m1)-jet(h,deg(h,iv1m1)-1,iv1m1);
    10201082  list result;
    10211083  list temp;
    10221084  list homogtemp;
     1085  def invhath;
     1086  def invideal;
    10231087  list M; list hatM;
     1088  dbprint(p,"==> Factorize the maximal and the minimal homog. part of the given polynomial");
    10241089  list f1 = homogfacFirstWeyl_all(maxh);
    10251090  list f2 = homogfacFirstWeyl_all(minh);
    10261091  int is_equal;
    10271092  poly hath;
     1093  dbprint(p,"==> Merging the factorizations");
    10281094  for (i = 1; i<=size(f1);i++)
    10291095  {//Merge all combinations
     
    10331099    }
    10341100  }//Merge all combinations
     1101  dbprint(p,"==> Filtering invalid combinations");
    10351102  for (i = 1 ; i<= size(M); i++)
    10361103  {//filter valid combinations
     
    10431110    else
    10441111    {
    1045       if (deg(h,intvec(-1,1))<=deg(h-product(M[i]),intvec(-1,1)))
     1112      if (deg(h,ivm11)<=deg(h-product(M[i]),ivm11))
    10461113      {
    10471114        M = delete(M,i);
    10481115        continue;
    10491116      }
    1050       if (deg(h,intvec(1,-1))<=deg(h-product(M[i]),intvec(1,-1)))
     1117      if (deg(h,iv1m1)<=deg(h-product(M[i]),iv1m1))
    10511118      {
    10521119        M = delete(M,i);
     
    10551122    }
    10561123  }//filter valid combinations
     1124  dbprint(p,"==> Deleting doublicates in the resulting list");
    10571125  M = delete_dublicates_eval(M);
     1126  dbprint(p,"==> Iterating over all possible Combinations");
    10581127  while(size(M)>0)
    10591128  {//work on the elements of M
     
    10641133      temp = list();
    10651134      //First check for common inhomogeneous factors between hath and h
    1066       if (involution(NF(involution(hath,invo), std(involution(ideal(M[i][1]),invo))),invo)==0)
     1135      invhath = involution(hath,invo);
     1136      invideal = std(involution(ideal(M[i][1]),invo));
     1137      if (involution(NF(invhath,invideal) ,invo)==0)
    10671138      {//hath and h have a common factor on the left
    10681139        j = 1;
     
    10701141        if (j+1<=size(f1))
    10711142        {//Checking for more than one common factor
    1072           while(involution(NF(involution(hath,invo),std(involution(ideal(product(f1[1..(j+1)])),invo))),invo)==0)
     1143          invideal = std(involution(ideal(product(f1[1..(j+1)])),invo));
     1144          while(involution(NF(invhath,invideal),invo)==0)
    10731145          {
    10741146            if (j+1<size(f1))
     
    10821154          }
    10831155        }//Checking for more than one common factor
    1084         f2 = list(f1[1..j])+list(involution(lift(involution(product(f1[1..j]),invo),involution(hath,invo))[1,1],invo));
     1156        invideal = lift(involution(product(f1[1..j]),invo),invhath);
     1157        f2 = list(f1[1..j])+list(involution(invideal[1,1],invo));
    10851158        temp = temp + merge_cf(f2,f1,limits);
    10861159      }//hath and h have a common factor on the left
     
    11071180      }//hath and h have a common factor on the right
    11081181      //and now the homogeneous
    1109       maxh = jet(hath,deg(hath,intvec(-1,1)),intvec(-1,1))-jet(hath,deg(hath,intvec(-1,1))-1,intvec(-1,1));
    1110       minh = jet(hath,deg(hath,intvec(1,-1)),intvec(1,-1))-jet(hath,deg(hath,intvec(1,-1))-1,intvec(1,-1));
     1182      maxh = jet(hath,deg(hath,ivm11),ivm11)-jet(hath,deg(hath,ivm11)-1,ivm11);
     1183      minh = jet(hath,deg(hath,iv1m1),iv1m1)-jet(hath,deg(hath,iv1m1)-1,iv1m1);
    11111184      f1 = homogfacFirstWeyl_all(maxh);
    11121185      f2 = homogfacFirstWeyl_all(minh);
     
    11301203          continue;
    11311204        }//This is already a result
    1132         if (deg(hath,intvec(-1,1))<=deg(hath-product(temp[j]),intvec(-1,1)))
     1205        if (deg(hath,ivm11)<=deg(hath-product(temp[j]),ivm11))
    11331206        {
    11341207          temp = delete(temp,j);
     
    11511224  }//work on the elements of M
    11521225  //In the case, that there is none, write a constant factor before the factor of interest.
     1226  dbprint(p,"==> Done");
    11531227  for (i = 1 ; i<=size(result);i++)
    11541228  {//add a constant factor
    1155     if (deg(result[i][1],intvec(1,1))!=0)
     1229    if (deg(result[i][1],iv11)!=0)
    11561230    {
    11571231      result[i] = insert(result[i],1);
    11581232    }
    11591233  }//add a constant factor
     1234  dbprint(p,"==> Deleting doublicates in the output list");
    11601235  result = delete_dublicates_noteval(result);
    11611236  return(result);
     
    12261301SEE ALSO: facFirstWeyl, facSubWeyl, facFirstShift
    12271302"{//proc testfac
     1303  int p = printlevel - voice + 2;
     1304  dbprint(p,"==> Checking the input");
    12281305  if (size(l)==0)
    12291306  {//The empty list is given
     1307    dbprint(p,"==> Given list was empty");
    12301308    return(list());
    12311309  }//The empty list is given
    12321310  if (size(#)>2)
    1233   {//We want max. one optional argument
     1311  {//We want max. two optional arguments
     1312    dbprint(p,"==> More than two optional arguments");
    12341313    return(list());
    1235   }//We want max. one optional argument
     1314  }//We want max. two optional arguments
     1315  dbprint(p,"==> Done");
    12361316  list result;
    12371317  int i; int j;
    12381318  if (size(#)==0)
    12391319  {//No optional argument is given
     1320    dbprint(p,"==> No optional arguments");
    12401321    int valid = 1;
    12411322    for (i = size(l);i>=1;i--)
     
    12551336  else
    12561337  {
     1338    dbprint(p,"==> Optional arguments are given.");
    12571339    int valid = 1;
    12581340    for (i = size(l);i>=1;i--)
     
    12641346      result = insert(result, product(l[i])-#[1]);
    12651347    }//iterate over the elements of the given list
    1266     if(size(#)==2){return(result);}
     1348    if(size(#)==2)
     1349    {
     1350      dbprint(p,"==> A third argument is given. Output is a list now.");
     1351      return(result);
     1352    }
    12671353    return(valid);
    12681354  }
     
    13051391SEE ALSO: facFirstWeyl, testNCfac, facFirstShift
    13061392"{
     1393  int p = printlevel - voice + 2;
     1394  dbprint(p,"==> Start initial Checks of the input.");
    13071395    // basering can be anything having a Weyl algebra as subalgebra
    13081396  def @r = basering;
     
    13301418  // else: do nothing
    13311419  // DONE with assumptions, Input successfully checked
     1420  dbprint(p,"==> Successful");
    13321421  intvec lexpofX = leadexp(X);
    13331422  intvec lexpofD = leadexp(D);
     
    13431432  }
    13441433  /* VL : to add printlevel stuff */
    1345 
     1434  dbprint(p,"==> Change positions of the two variables in the list, if needed");
    13461435  if (isReverted)
    13471436  {
     
    13621451    poly h= imap(@r,h);
    13631452  }
     1453  dbprint(p,"==> Done!");
    13641454  list result = facFirstWeyl(h);
    13651455  setring @r;
     
    14071497static proc homogfacFirstShift(poly h)
    14081498{//proc homogfacFirstShift
     1499  int p=printlevel-voice+2; //for dbprint
    14091500  def r = basering;
    14101501  poly hath;
     1502  intvec iv01 = intvec(0,1);
    14111503  int i; int j;
    1412   if (!homogwithorder(h,intvec(0,1)))
     1504  if (!homogwithorder(h,iv01))
    14131505  {//The given polynomial is not homogeneous
     1506    ERROR("The given polynomial is not homogeneous.");
    14141507    return(list());
    14151508  }//The given polynomial is not homogeneous
     
    14191512  }
    14201513  list result;
    1421   int m = deg(h,intvec(0,1));
     1514  int m = deg(h,iv01);
     1515  dbprint(p,"==> exclude the homogeneous part of deg. 0");
    14221516  if (m>0)
    14231517  {//The degree is not zero
     
    14361530  map thetamap = r,x,1;
    14371531  poly hath = thetamap(hath);
     1532  dbprint(p,"==> Factorize it using commutative factorization.");
    14381533  list azeroresult = factorize(hath);
    14391534  list azeroresult_return_form;
     
    14561551static proc homogfacFirstShift_all(poly h)
    14571552{//proc HomogfacFirstShiftAll
    1458   if (deg(h,intvec(1,1)) <= 0 )
     1553  int p=printlevel-voice+2; //for dbprint
     1554  intvec iv11 = intvec(1,1);
     1555  if (deg(h,iv11) <= 0 )
    14591556  {//h is a constant
    14601557    return(list(list(h)));
     
    14651562  int shiftcounter;
    14661563  //Compute again a homogeneous factorization
     1564  dbprint(p,"==> Computing one homog. factorization of the polynomial");
    14671565  one_hom_fac = homogfacFirstShift(h);
    14681566  one_hom_fac = delete(one_hom_fac,1);
     
    14711569    return(list());
    14721570  }//there is no homogeneous factorization or the polynomial was not homogeneous
     1571  dbprint(p,"==> Permuting the 0-homogeneous part with the s");
    14731572  list result = permpp(one_hom_fac);
    14741573  for (i = 1; i<=size(result);i++)
     
    14881587    result[i] = insert(result[i],1);
    14891588  }
     1589  dbprint(p,"==> Deleting double entries in the resulting list");
    14901590  result = delete_dublicates_noteval(result);
    14911591  return(result);
     
    15041604SEE ALSO: testNCfac, facFirstWeyl, facSubWeyl
    15051605"{//facFirstShift
     1606  int p = printlevel - voice + 2;
     1607  dbprint(p,"==> Checking the input.");
    15061608  if(nvars(basering)!=2)
    15071609  {//Our basering is the Shift algebra, but not the first
     
    15191621    return(list());
    15201622  }
     1623  dbprint(p,"==> Done");
    15211624  list result = list();
    15221625  int i;int j; int k; int l; //counter
     
    15301633  if (@p == -var(1)) // reverted shift algebra
    15311634  {
     1635    dbprint(p,"==> Reverted shift algebra. Swaping variables in Ringlist");
    15321636    setring(tempRingnc);
    15331637    map transf = r, var(2), var(1);
     
    15541658  // main calls
    15551659  setring(tempRingnc);
     1660  dbprint(p,"==> Factorize the given polynomial with the subroutine facshift");
    15561661  list resulttemp = facshift(transf(h));
     1662  dbprint(p,"==> Successful");
    15571663  setring(r);
    15581664  result = transfback(resulttemp);
    1559 
     1665  dbprint(p,"==> Recursively check the found factors for reducibility.");
    15601666  list recursivetemp;
    15611667  for(i = 1; i<=size(result);i++)
     
    15851691  }//recursively factorize factors
    15861692  //now, refine the possible redundant list
     1693  dbprint(p,"==> Done");
    15871694  return( delete_dublicates_noteval(result) );
    15881695}//facFirstShift
     
    16091716SEE ALSO: homogfacFirstShift_all, homogfacFirstShift
    16101717"{//proc facshift
    1611   if(homogwithorder(h,intvec(0,1)))
    1612   {
     1718  int p=printlevel-voice+2; // for dbprint
     1719  intvec iv01 = intvec(0,1);
     1720  intvec iv11 = intvec(1,1);
     1721  intvec iv10 = intvec(1,0);
     1722  intvec iv0m1 = intvec(0,-1);
     1723  if(homogwithorder(h,iv01))
     1724  {
     1725    dbprint(p,"==> Given polynomial was 1,0-homogeneous. Calling subroutine for homog. polys.");
    16131726    return(homogfacFirstShift_all(h));
    16141727  }
     
    16161729  map invo = basering,-var(1),-var(2);
    16171730  int i; int j; int k;
    1618   intvec limits = deg(h,intvec(1,1)) ,deg(h,intvec(1,0)),deg(h,intvec(0,1));
     1731  intvec limits = deg(h,iv11) ,deg(h,iv10),deg(h,iv01);
    16191732  def prod;
    16201733  //end finding the limits
    1621   poly maxh = jet(h,deg(h,intvec(0,1)),intvec(0,1))-jet(h,deg(h,intvec(0,1))-1,intvec(0,1));
    1622   poly minh = jet(h,deg(h,intvec(0,-1)),intvec(0,-1))-jet(h,deg(h,intvec(0,-1))-1,intvec(0,-1));
     1734  poly maxh = jet(h,deg(h,iv01),iv01)-jet(h,deg(h,iv01)-1,iv01);
     1735  poly minh = jet(h,deg(h,iv0m1),iv0m1)-jet(h,deg(h,iv0m1)-1,iv0m1);
    16231736  list result;
    16241737  list temp;
    16251738  list homogtemp;
    16261739  list M; list hatM;
     1740  def invhath;
     1741  def invideal;
     1742  dbprint(p,"==> Factorizing the highest and the lowest homogeneous part");
    16271743  list f1 = homogfacFirstShift_all(maxh);
    16281744  list f2 = homogfacFirstShift_all(minh);
    16291745  int is_equal;
    16301746  poly hath;
     1747  dbprint(p,"==> Merging their factors");
    16311748  for (i = 1; i<=size(f1);i++)
    16321749  {//Merge all combinations
     
    16361753    }
    16371754  }//Merge all combinations
     1755  dbprint(p,"==> Filtering invalid combinations");
    16381756  for (i = 1 ; i<= size(M); i++)
    16391757  {//filter valid combinations
     
    16461764    else
    16471765    {
    1648       if (deg(h,intvec(0,1))<=deg(h-product(M[i]),intvec(0,1)))
     1766      if (deg(h,iv01)<=deg(h-product(M[i]),iv01))
    16491767      {
    16501768        M = delete(M,i);
    16511769        continue;
    16521770      }
    1653       if (deg(h,intvec(0,-1))<=deg(h-product(M[i]),intvec(0,-1)))
     1771      if (deg(h,iv0m1)<=deg(h-product(M[i]),iv0m1))
    16541772      {
    16551773        M = delete(M,i);
     
    16581776    }
    16591777  }//filter valid combinations
     1778  dbprint(p,"==> Iterating over all elements in M");
    16601779  M = delete_dublicates_eval(M);
    16611780  while(size(M)>0)
     
    16671786      temp = list();
    16681787      //First check for common inhomogeneous factors between hath and h
    1669       if (involution(NF(involution(hath,invo), std(involution(ideal(M[i][1]),invo))),invo)==0)
     1788      invhath = involution(hath,invo);
     1789      invideal = std(involution(ideal(M[i][1]),invo));
     1790      if (involution(NF(invhath, invideal ),invo)==0)
    16701791      {//hath and h have a common factor on the left
    16711792        j = 1;
     
    16731794        if (j+1<=size(f1))
    16741795        {//Checking for more than one common factor
    1675           while(involution(NF(involution(hath,invo),std(involution(ideal(product(f1[1..(j+1)])),invo))),invo)==0)
     1796          invideal = std(involution(ideal(product(f1[1..(j+1)])),invo));
     1797          while(involution(NF(invhath,invideal),invo)==0)
    16761798          {
    16771799            if (j+1<size(f1))
     
    16851807          }
    16861808        }//Checking for more than one common factor
    1687         if (deg(product(f1[1..j]),intvec(1,1))!=0)
     1809        if (deg(product(f1[1..j]),iv11)!=0)
    16881810        {
    1689           f2 = list(f1[1..j])+list(involution(lift(involution(product(f1[1..j]),invo),involution(hath,invo))[1,1],invo));
     1811          invideal = lift(involution(product(f1[1..j]),invo),invhath);
     1812          f2 = list(f1[1..j])+list(involution(invideal[1,1],invo));
    16901813        }
    16911814        else
    16921815        {
    1693           f2 = list(f1[1..j])+list(involution(lift(product(f1[1..j]),involution(hath,invo))[1,1],invo));
     1816          invideal = lift(product(f1[1..j]),involution(hath,invo));
     1817          f2 = list(f1[1..j])+list(involution(invideal[1,1],invo));
    16941818        }
    16951819        temp = temp + merge_cf(f2,f1,limits);
     
    17171841      }//hath and h have a common factor on the right
    17181842      //and now the homogeneous
    1719       maxh = jet(hath,deg(hath,intvec(0,1)),intvec(0,1))-jet(hath,deg(hath,intvec(0,1))-1,intvec(0,1));
    1720       minh = jet(hath,deg(hath,intvec(0,-1)),intvec(0,-1))-jet(hath,deg(hath,intvec(0,-1))-1,intvec(0,-1));
     1843      maxh = jet(hath,deg(hath,iv01),iv01)-jet(hath,deg(hath,iv01)-1,iv01);
     1844      minh = jet(hath,deg(hath,iv0m1),iv0m1)-jet(hath,deg(hath,iv0m1)-1,iv0m1);
    17211845      f1 = homogfacFirstShift_all(maxh);
    17221846      f2 = homogfacFirstShift_all(minh);
     
    17401864          continue;
    17411865        }//This is already a result
    1742         if (deg(hath,intvec(0,1))<=deg(hath-product(temp[j]),intvec(0,1)))
     1866        if (deg(hath,iv01)<=deg(hath-product(temp[j]),iv01))
    17431867        {
    17441868          temp = delete(temp,j);
     
    17631887  for (i = 1 ; i<=size(result);i++)
    17641888  {//add a constant factor
    1765     if (deg(result[i][1],intvec(1,1))!=0)
     1889    if (deg(result[i][1],iv11)!=0)
    17661890    {
    17671891      result[i] = insert(result[i],1);
    17681892    }
    17691893  }//add a constant factor
     1894  dbprint(p,"==> Deleting double entries in the resulting list.");
    17701895  result = delete_dublicates_noteval(result);
    17711896  return(result);
Note: See TracChangeset for help on using the changeset viewer.