Changeset 69c882 in git


Ignore:
Timestamp:
Feb 1, 2012, 5:19:00 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
fdae2dc8d40153cbd857c71de2961e22d3f0a252
Parents:
1a3011e587832b2682cb4978c6d117754eaa2572
git-author:
Martin Lee <martinlee84@web.de>2012-02-01 17:19:00+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-10 14:16:44+01:00
Message:
chg: delete factors already found by early factor detection
chg: use "smaller" polynomial for factor recombination
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqBivar.cc

    r1a3011e r69c882  
    651651        LCBuf= LC (buf, x);
    652652        T= Difference (T, CFList (i.getItem()));
     653        F= buf;
    653654
    654655        // compute new possible degree pattern
     
    667668  if (adaptedLiftBound < deg)
    668669  {
     670    degs= bufDegs1;
    669671    success= true;
    670     factors= T;
    671     degs= bufDegs1;
    672     F= buf;
    673672  }
    674673  if (bufDegs1.getLength() <= 1)
     
    743742        {
    744743          T= Difference (T, CFList (i.getItem()));
     744          F= buf;
    745745
    746746          // compute new possible degree pattern
     
    763763  if (adaptedLiftBound < deg)
    764764  {
     765    degs= bufDegs1;
    765766    success= true;
    766     factors= T;
    767     degs= bufDegs1;
    768     F= buf;
    769767  }
    770768  if (bufDegs1.getLength() <= 1)
     
    828826
    829827void
    830 deleteFactors (const CFList& L, CFList& factors, const CanonicalForm& eval, bool
    831                extension)
     828deleteFactors (CFList& factors, int* factorsFoundIndex)
    832829{
    833   int index;
    834   CanonicalForm tmp1, tmp2;
    835   CFListIterator j;
    836   Variable y= Variable (2);
    837   for (CFListIterator i= L; i.hasItem(); i++)
    838   {
    839     index= 1;
    840     if (extension)
    841       tmp1= mod (i.getItem(), y-eval);
     830  CFList result;
     831  int i= 0;
     832  for (CFListIterator iter= factors; iter.hasItem(); iter++, i++)
     833  {
     834    if (factorsFoundIndex[i] == 1)
     835      continue;
    842836    else
    843       tmp1= mod (i.getItem(), y);
    844     tmp1 /= Lc (tmp1);
    845     for (j= factors; j.hasItem(); j++, index++)
    846     {
    847       tmp2= mod (j.getItem(), y);
    848       tmp2 /= Lc (tmp2);
    849       if (tmp1 == tmp2)
    850       {
    851         index++;
    852         j.remove(index);
    853         break;
    854       }
    855     }
    856   }
     837      result.append (iter.getItem());
     838  }
     839  factors= result;
    857840}
    858841
     
    887870  for (int i= 0; i < uniFactors.length(); i++)
    888871    factorsFoundIndex [i]= 0;
     872  CanonicalForm bufA= A;
    889873
    890874  if (smallFactorDeg >= liftBound || degree (A,y) <= 4)
     
    894878    henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M);
    895879    if (!extension)
    896       earlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     880      earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    897881                            factorsFoundIndex, degs, earlySuccess,
    898882                            smallFactorDeg);
    899883    else
    900       extEarlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     884      extEarlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    901885                               factorsFoundIndex, degs, earlySuccess, info,
    902886                               eval, smallFactorDeg);
     
    910894                            liftPre[sizeOfLiftPre-1] + 1, Pi, diophant, M);
    911895        if (!extension)
    912           earlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     896          earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    913897                                factorsFoundIndex, degs, earlySuccess,
    914898                                liftPre[sizeOfLiftPre-1] + 1);
    915899        else
    916           extEarlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     900          extEarlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    917901                                   factorsFoundIndex, degs, earlySuccess, info,
    918902                                   eval, liftPre[sizeOfLiftPre-1] + 1);
     
    931915                            liftPre[i-1] + 1, Pi, diophant, M);
    932916        if (!extension)
    933           earlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     917          earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    934918                                factorsFoundIndex, degs, earlySuccess,
    935919                                liftPre[i-1] + 1);
    936920        else
    937           extEarlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     921          extEarlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    938922                                   factorsFoundIndex, degs, earlySuccess, info,
    939923                                   eval, liftPre[i-1] + 1);
     
    954938    henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M);
    955939    if (!extension)
    956       earlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     940      earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    957941                            factorsFoundIndex, degs, earlySuccess,
    958942                            smallFactorDeg);
    959943    else
    960       extEarlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     944      extEarlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    961945                               factorsFoundIndex, degs, earlySuccess, info,
    962946                               eval, smallFactorDeg);
     
    971955                          dummy, Pi, diophant, M);
    972956      if (!extension)
    973         earlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     957        earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    974958                              factorsFoundIndex, degs, earlySuccess, dummy);
    975959      else
    976         extEarlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     960        extEarlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    977961                                 factorsFoundIndex, degs, earlySuccess, info,
    978962                                 eval, dummy);
     
    987971                            dummy, Pi, diophant, M);
    988972        if (!extension)
    989           earlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     973          earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    990974                                factorsFoundIndex, degs, earlySuccess, dummy);
    991975        else
    992           extEarlyFactorDetection (earlyFactors, A, bufUniFactors, newLiftBound,
     976          extEarlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    993977                                   factorsFoundIndex, degs, earlySuccess, info,
    994978                                   eval, dummy);
     
    1003987    if (earlySuccess)
    1004988      liftBound= newLiftBound;
     989  }
     990
     991  A= bufA;
     992  if (earlyFactors.length() > 0 && degs.getLength() > 1)
     993  {
     994    liftBound= degree (A,y) + 1;
     995    earlySuccess= true;
     996    deleteFactors (bufUniFactors, factorsFoundIndex);
    1005997  }
    1006998
     
    42534245    return earlyFactors;
    42544246  }
    4255   int sizeOldF= size (F);
    4256   CFList result;
    4257   CanonicalForm bufF= F;
    4258   if (earlyFactors.length() > 0)
    4259   {
    4260     for (CFListIterator i= earlyFactors; i.hasItem(); i++)
    4261       bufF /= i.getItem();
    4262   }
    4263 
    4264   if (size (bufF) < sizeOldF)
    4265   {
    4266     H= bufF;
     4247  int sizeOldF= size (G);
     4248  if (size (F) < sizeOldF)
     4249  {
     4250    H= F;
    42674251    success= true;
    42684252    return earlyFactors;
     
    43094293  }
    43104294  Variable y= F.mvar();
    4311   CanonicalForm shiftedF= F (y - evaluation, y);
     4295  CanonicalForm shiftedF= G (y - evaluation, y);
    43124296  int sizeOldF= size (shiftedF);
    4313   CFList result;
    4314   CanonicalForm bufF= shiftedF;
    4315   if (earlyFactors.length() > 0)
    4316   {
    4317     for (CFListIterator i= earlyFactors; i.hasItem(); i++)
    4318     {
    4319       bufF /= i.getItem();
    4320       result.append (i.getItem());
    4321     }
    4322   }
    4323 
    4324   if (size (bufF) < sizeOldF)
    4325   {
    4326     H= bufF (y + evaluation, y); //shift back to zero
     4297  if (size (F) < sizeOldF)
     4298  {
     4299    H= F (y + evaluation, y); //shift back to zero
    43274300    success= true;
    4328     return result;
     4301    return earlyFactors;
    43294302  }
    43304303  else
Note: See TracChangeset for help on using the changeset viewer.