Changeset 8baf483 in git for factory


Ignore:
Timestamp:
Mar 22, 2012, 2:14:26 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
a5450a84cceebf718a03d5c66125aabfc921bd4e
Parents:
6caa2a65af91c075a92633672407af2890482e93
git-author:
Martin Lee <martinlee84@web.de>2012-03-22 14:14:26+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-04-04 14:42:27+02:00
Message:
chg: use squarefree factorization instead of squarefree part
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqFactorize.h

    r6caa2a6 r8baf483  
    152152  Variable a= Variable (1);
    153153  CanonicalForm LcF= Lc (F);
    154   CanonicalForm pthRoot, A;
    155   CanonicalForm sqrfP= sqrfPart (F/Lc(F), pthRoot, a);
    156   CFList buf, bufRoot;
    157   CFFList result, resultRoot;
    158   int p= getCharacteristic();
    159   int l;
    160   if (degree (pthRoot) > 0)
     154  CFFList sqrf= FpSqrf (F, false);
     155  CFFList result;
     156  CFList bufResult;
     157  sqrf.removeFirst();
     158  CFListIterator i;
     159  for (CFFListIterator iter= sqrf; iter.hasItem(); iter++)
    161160  {
    162     pthRoot= maxpthRoot (pthRoot, p, l);
    163     result= FpFactorize (pthRoot, false);
    164     result.removeFirst();
    165     for (CFFListIterator i= result; i.hasItem(); i++)
    166       i.getItem()= CFFactor(i.getItem().factor(),i.getItem().exp()*ipower(p,l));
    167     result.insert (CFFactor (LcF, 1));
    168     return result;
    169   }
    170   else
    171   {
    172     buf= multiFactorize (sqrfP, info);
    173     A= F/LcF;
    174     result= multiplicity (A, buf);
    175   }
    176   if (degree (A) > 0)
    177   {
    178     resultRoot= FpFactorize (A, false);
    179     resultRoot.removeFirst();
    180     result= Union (result, resultRoot);
     161    bufResult= multiFactorize (iter.getItem().factor(), info);
     162    for (i= bufResult; i.hasItem(); i++)
     163      result.append (CFFactor (i.getItem(), iter.getItem().exp()));
    181164  }
    182165  result.insert (CFFactor (LcF, 1));
     
    246229  ExtensionInfo info= ExtensionInfo (alpha, false);
    247230  CanonicalForm LcF= Lc (F);
    248   CanonicalForm pthRoot, A;
    249   CanonicalForm sqrfP= sqrfPart (F/Lc(F), pthRoot, alpha);
    250   CFList buf, bufRoot;
    251   CFFList result, resultRoot;
    252   int p= getCharacteristic();
    253   int q= ipower (p, degree (getMipo (alpha)));
    254   int l;
    255   if (degree (pthRoot) > 0)
     231  CFFList sqrf= FqSqrf (F, alpha, false);
     232  CFFList result;
     233  CFList bufResult;
     234  sqrf.removeFirst();
     235  CFListIterator i;
     236  for (CFFListIterator iter= sqrf; iter.hasItem(); iter++)
    256237  {
    257     pthRoot= maxpthRoot (pthRoot, q, l);
    258     result= FqFactorize (pthRoot, alpha, false);
    259     result.removeFirst();
    260     for (CFFListIterator i= result; i.hasItem(); i++)
    261       i.getItem()= CFFactor(i.getItem().factor(),i.getItem().exp()*ipower(p,l));
    262     result.insert (CFFactor (LcF, 1));
    263     return result;
    264   }
    265   else
    266   {
    267     buf= multiFactorize (sqrfP, info);
    268     A= F/LcF;
    269     result= multiplicity (A, buf);
    270   }
    271   if (degree (A) > 0)
    272   {
    273     resultRoot= FqFactorize (A, alpha, false);
    274     resultRoot.removeFirst();
    275     result= Union (result, resultRoot);
     238    bufResult= multiFactorize (iter.getItem().factor(), info);
     239    for (i= bufResult; i.hasItem(); i++)
     240      result.append (CFFactor (i.getItem(), iter.getItem().exp()));
    276241  }
    277242  result.insert (CFFactor (LcF, 1));
     
    343308  ExtensionInfo info= ExtensionInfo (getGFDegree(), gf_name, false);
    344309  CanonicalForm LcF= Lc (F);
    345   CanonicalForm pthRoot, A;
    346   CanonicalForm sqrfP= sqrfPart (F/LcF, pthRoot, a);
    347   CFList buf;
    348   CFFList result, resultRoot;
    349   int p= getCharacteristic();
    350   int q= ipower (p, getGFDegree());
    351   int l;
    352   if (degree (pthRoot) > 0)
     310  CFFList sqrf= GFSqrf (F, false);
     311  CFFList result;
     312  CFList bufResult;
     313  sqrf.removeFirst();
     314  CFListIterator i;
     315  for (CFFListIterator iter= sqrf; iter.hasItem(); iter++)
    353316  {
    354     pthRoot= maxpthRoot (pthRoot, q, l);
    355     result= GFFactorize (pthRoot, false);
    356     result.removeFirst();
    357     for (CFFListIterator i= result; i.hasItem(); i++)
    358       i.getItem()= CFFactor(i.getItem().factor(),i.getItem().exp()*ipower(p,l));
    359     result.insert (CFFactor (LcF, 1));
    360     return result;
    361   }
    362   else
    363   {
    364     buf= multiFactorize (sqrfP, info);
    365     A= F/LcF;
    366     result= multiplicity (A, buf);
    367   }
    368   if (degree (A) > 0)
    369   {
    370     resultRoot= GFFactorize (A, false);
    371     resultRoot.removeFirst();
    372     result= Union (result, resultRoot);
     317    bufResult= multiFactorize (iter.getItem().factor(), info);
     318    for (i= bufResult; i.hasItem(); i++)
     319      result.append (CFFactor (i.getItem(), iter.getItem().exp()));
    373320  }
    374321  result.insert (CFFactor (LcF, 1));
Note: See TracChangeset for help on using the changeset viewer.