Changeset c79a9d in git for factory/facFqFactorize.cc


Ignore:
Timestamp:
Oct 13, 2011, 1:21:35 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
5f9b47ed5a8e9e527497f05d9afe96ec3e076cbf
Parents:
3e70950f6eff7e879a05817dd9e4bb45aeb175ca
Message:
bug fix in squarefree factorization and faster way to recover factors in factorization


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

Legend:

Unmodified
Added
Removed
  • factory/facFqFactorize.cc

    r3e7095 rc79a9d  
    19901990}
    19911991
     1992CFList recoverFactors (const CanonicalForm& F, const CFList& factors,
     1993                       const CFList& evaluation)
     1994{
     1995  CFList result;
     1996  CanonicalForm tmp, tmp2;
     1997  CanonicalForm G= F;
     1998  for (CFListIterator i= factors; i.hasItem(); i++)
     1999  {
     2000    tmp= reverseShift (i.getItem(), evaluation);
     2001    tmp /= content (tmp, 1);
     2002    if (fdivides (tmp, G, tmp2))
     2003    {
     2004      G= tmp2;
     2005      result.append (tmp);
     2006    }
     2007  }
     2008  return result;
     2009}
     2010
    19922011CFList
    19932012extNonMonicFactorRecombination (const CFList& factors, const CanonicalForm& F,
    1994                                 const ExtensionInfo& info,
    1995                                 const CFList& evaluation)
     2013                                const ExtensionInfo& info)
    19962014{
    19972015  Variable alpha= info.getAlpha();
     
    20342052          T.removeFirst();
    20352053          result.append (g/myContent (g));
    2036           g= reverseShift (g, evaluation);
    20372054          g /= Lc (g);
    20382055          appendTestMapDown (result, g, info, source, dest);
     
    20402057        }
    20412058        else
    2042         {
    2043           buf= reverseShift (buf, evaluation);
    20442059          return CFList (buf);
    2045         }
    20462060      }
    20472061
     
    20532067      if (fdivides (g, buf, quot))
    20542068      {
    2055         buf2= reverseShift (g, evaluation);
     2069        buf2= g;
    20562070        buf2 /= Lc (buf2);
    20572071        if (!k && beta == Variable (1))
     
    20822096          {
    20832097            delete [] v;
    2084             buf= reverseShift (buf, evaluation);
    20852098            buf /= Lc (buf);
    20862099            appendTestMapDown (result, buf, info, source, dest);
     
    20982111    {
    20992112      delete [] v;
    2100       buf= reverseShift (buf, evaluation);
    21012113      appendTestMapDown (result, buf, info, source, dest);
    21022114      return result;
     
    21072119  }
    21082120  if (T.length() < 2*s)
    2109   {
    2110     buf= reverseShift (F, evaluation);
    2111     appendMapDown (result, buf, info, source, dest);
    2112   }
     2121    appendMapDown (result, F, info, source, dest);
    21132122
    21142123  delete [] v;
     
    23172326    evaluationWRTDifferentSecondVars (bufAeval2, bufEvaluation, A);
    23182327
    2319     for (int j= 0; j < A.level() - 1; j++)
     2328    for (int j= 0; j < A.level() - 2; j++)
    23202329    {
    23212330      if (!bufAeval2[j].isEmpty())
     
    25152524                               Pi, liftBounds, liftBoundsLength, noOneToOne);
    25162525
     2526
    25172527  if (!noOneToOne)
    25182528  {
    25192529    int check= factors.length();
    2520     factors= recoverFactors (A, factors);
     2530    A= reverseShift (oldA, evaluation);
     2531    factors= recoverFactors (A, factors, evaluation);
    25212532    if (check != factors.length())
    25222533      noOneToOne= true;
    25232534
    25242535    if (extension && !noOneToOne)
    2525       factors= extNonMonicFactorRecombination (factors, oldA, info, evaluation);
     2536      factors= extNonMonicFactorRecombination (factors, A, info);
    25262537  }
    25272538  if (noOneToOne)
     
    25802591    if (earlySuccess)
    25812592      factors= Union (factors, earlyFactors);
    2582   }
    2583 
    2584   if (!extension)
    2585   {
    2586     for (CFListIterator i= factors; i.hasItem(); i++)
    2587     {
    2588       int kk= Aeval.getLast().level();
    2589       for (CFListIterator j= evaluation; j.hasItem(); j++, kk--)
    2590       {
    2591         if (i.getItem().level() < kk)
    2592           continue;
    2593         i.getItem()= i.getItem() (Variable (kk) - j.getItem(), kk);
    2594       }
    2595     }
    2596   }
     2593    if (!extension)
     2594    {
     2595      for (CFListIterator i= factors; i.hasItem(); i++)
     2596      {
     2597        int kk= Aeval.getLast().level();
     2598        for (CFListIterator j= evaluation; j.hasItem(); j++, kk--)
     2599        {
     2600          if (i.getItem().level() < kk)
     2601            continue;
     2602          i.getItem()= i.getItem() (Variable (kk) - j.getItem(), kk);
     2603        }
     2604      }
     2605    }
     2606  }
     2607
     2608
    25972609
    25982610  if (v.level() != 1)
Note: See TracChangeset for help on using the changeset viewer.