Changeset 5f9b47 in git


Ignore:
Timestamp:
Oct 13, 2011, 4:28:33 PM (13 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '648d28f488f6ff08f5607ff229b9ad9e4a5b93c2')
Children:
a6423611ab89e02788fee9f049f4e6b2e2dac782
Parents:
c79a9d3a83d34151b67ba9ac3b63b827a07b792f
Message:
use sqrfree factorization instead of sqrfree part extraction for factorization ove Q(a)


git-svn-id: file:///usr/local/Singular/svn/trunk@14412 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
factory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • factory/facAlgExt.cc

    rc79a9d r5f9b47  
    151151    return CFFList (CFFactor (F, 1));
    152152
    153   CanonicalForm sqrf= uniSqrfPart (F);
    154   CFList sqrfFactors= AlgExtSqrfFactorize (sqrf, alpha);
    155 
    156153  bool save_rat=!isOn (SW_RATIONAL);
    157154  On (SW_RATIONAL);
    158   CanonicalForm quot, buf= F/Lc (F);
     155  CFFList sqrf= sqrFreeZ (F);
     156  CFList factorsSqrf;
    159157  CFFList factors;
    160   int multi;
    161   for (CFListIterator i= sqrfFactors; i.hasItem(); i++)
     158  CFListIterator j;
     159
     160  for (CFFListIterator i= sqrf; i.hasItem(); i++)
    162161  {
    163     multi= 0;
    164     i.getItem() /= Lc (i.getItem()); //make factors monic
    165     while (fdivides (i.getItem(), buf, quot))
    166     {
    167       buf= quot;
    168       multi++;
    169     }
    170     factors.append (CFFactor (i.getItem(), multi));
     162    if (i.getItem().factor().inCoeffDomain()) continue;
     163    factorsSqrf= AlgExtSqrfFactorize (i.getItem().factor(), alpha);
     164    for (j= factorsSqrf; j.hasItem(); j++)
     165      factors.append (CFFactor (j.getItem()/Lc (j.getItem()), i.getItem().exp()));
    171166  }
     167
    172168  factors.insert (CFFactor (Lc(F), 1));
    173169  ASSERT (degree (buf) <= 0, "bug in AlgExtFactorize");
  • factory/facBivar.h

    rc79a9d r5f9b47  
    126126  vec_ZZ S;
    127127  F= compress (F, M, S);
    128   CanonicalForm sqrfP= sqrfPart (F);
    129   CFList buf;
    130   buf= biFactorize (sqrfP, v);
    131   result= multiplicity (F, buf);
    132   for (CFFListIterator i= result; i.hasItem(); i++)
    133     i.getItem()= CFFactor (N (decompress (i.getItem().factor(), M, S)),
    134                              i.getItem().exp());
     128  CFFList sqrfFactors= sqrFree (F);
     129  for (CFFListIterator i= sqrfFactors; i.hasItem(); i++)
     130  {
     131    CFList tmp= ratBiSqrfFactorize (i.getItem().factor(), v);
     132    for (CFListIterator j= tmp; j.hasItem(); j++)
     133    {
     134      if (j.getItem().inCoeffDomain()) continue;
     135      result.append (CFFactor (N (decompress (j.getItem(), M, S)), i.getItem().exp()));
     136    }
     137  }
    135138  result= Union (result, contentXFactors);
    136139  result= Union (result, contentYFactors);
  • factory/facFactorize.h

    rc79a9d r5f9b47  
    3434///         element is the leading coefficient.
    3535inline
    36 CFList ratSqrfFactorize (const CanonicalForm & F, ///< [in] a multivariate poly
     36CFList ratSqrfFactorize (const CanonicalForm & G, ///< [in] a multivariate poly
    3737                         const Variable& v
    3838                       )
    3939{
    40   if (getNumVars (F) == 2)
    41     return ratBiSqrfFactorize (F, v);
     40  if (getNumVars (G) == 2)
     41    return ratBiSqrfFactorize (G, v);
     42  CanonicalForm F= G;
     43  if (isOn (SW_RATIONAL))
     44    F *= bCommonDen (F);
    4245  CFList result= multiFactorize (F, v);
    4346  if (isOn (SW_RATIONAL))
     
    5457///         multiplicity, the first element is the leading coefficient.
    5558inline
    56 CFFList ratFactorize (const CanonicalForm& F, ///< [in] a multivariate poly
     59CFFList ratFactorize (const CanonicalForm& G, ///< [in] a multivariate poly
    5760                      const Variable& v
    5861                    )
    5962{
    60   if (getNumVars (F) == 2)
     63  if (getNumVars (G) == 2)
    6164  {
    62     CFFList result= ratBiFactorize (F,v);
     65    CFFList result= ratBiFactorize (G,v);
    6366    return result;
    6467  }
    65   Variable a= Variable (1);
     68  CanonicalForm F= G;
    6669  CanonicalForm LcF= Lc (F);
     70  if (isOn (SW_RATIONAL))
     71    F *= bCommonDen (F);
    6772
    68   CanonicalForm sqrfP= sqrfPart (F);
    69   CFList buf;
    7073  CFFList result;
    71   buf= multiFactorize (sqrfP, v);
    72   CanonicalForm G= F;
    73   result= multiplicity (G, buf);
     74  CFFList sqrfFactors= sqrFree (F);
     75  for (CFFListIterator i= sqrfFactors; i.hasItem(); i++)
     76  {
     77    CFList tmp= ratSqrfFactorize (i.getItem().factor(), v);
     78    for (CFListIterator j= tmp; j.hasItem(); j++)
     79    {
     80      if (j.getItem().inCoeffDomain()) continue;
     81      result.append (CFFactor (j.getItem(), i.getItem().exp()));
     82    }
     83  }
    7484  if (isOn (SW_RATIONAL))
    7585  {
Note: See TracChangeset for help on using the changeset viewer.