Changeset 35eb6c in git for factory/facAlgExt.cc


Ignore:
Timestamp:
Jun 20, 2011, 11:06:11 AM (13 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
fe2d4cb34f289f4b0611d2b5ac416c7bc1b2c60a
Parents:
37cf8fb52819b7a47cb628349e0830bf986d039a
Message:
compute norm now modular
changed handling of On (SW_RATIONAL)
changed NTL zz_p initalizations in cfModResultant.cc


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

Legend:

Unmodified
Added
Removed
  • factory/facAlgExt.cc

    r37cf8f r35eb6c  
    2929#include "facFqBivarUtil.h"
    3030#include "facAlgExt.h"
     31#include "cfModResultant.h"
    3132
    3233// squarefree part of F
    3334CanonicalForm
    34 sqrfPart (const CanonicalForm& F)
     35uniSqrfPart (const CanonicalForm& F)
    3536{
    3637  ASSERT (F.isUnivariate(), "univariate input expected");
     
    5051  mipo= mipo (x, alpha);
    5152
    52   CanonicalForm norm= resultant (g, mipo, x);
     53  int degg= degree (g);
     54  int degmipo= degree (mipo);
     55  CanonicalForm norm;
     56  if (degg >= 8 || degmipo >= 8)
     57    norm= resultantZ (g, mipo, x);
     58  else
     59    norm= resultant (g, mipo, x);
     60
    5361  i= 0;
    5462  int k;
     
    6472      {
    6573        g= F (y - i*alpha, y);
    66         norm= resultant (g (x, alpha), mipo, x);
     74        if (degg >= 8 || degmipo >= 8)
     75          norm= resultantZ (g (x, alpha), mipo, x);
     76        else
     77          norm= resultant (g (x, alpha), mipo, x);
    6778      }
    6879      else
    6980      {
    7081        g= F (y + i*alpha, y);
    71         norm= resultant (g (x, alpha), mipo, x);
     82        if (degg >= 8 || degmipo >= 8)
     83          norm= resultantZ (g (x, alpha), mipo, x);
     84        else
     85          norm= resultant (g (x, alpha), mipo, x);
    7286      }
    7387      if (degree (gcd (deriv (norm, y), norm)) <= 0)
     
    89103  ASSERT (getCharacteristic() == 0, "characteristic 0 expected");
    90104
    91   On (SW_RATIONAL);
    92   CanonicalForm f= F;
     105  if (!isOn (SW_RATIONAL))
     106    On (SW_RATIONAL);
     107  CanonicalForm f= F*bCommonDen (F);
    93108  int shift;
    94109  CanonicalForm norm= sqrfNorm (f, alpha, shift);
     
    97112  CFList factors;
    98113  if (normFactors.length() <= 2)
    99     return CFList (f);
     114    return CFList (F);
    100115
    101116  normFactors.removeFirst();
     
    116131  }
    117132  ASSERT (degree (buf) <= 0, "incomplete factorization");
    118   Off (SW_RATIONAL);
    119133  return factors;
    120134}
     
    126140  ASSERT (getCharacteristic() == 0, "characteristic 0 expected");
    127141
     142
    128143  if (F.inCoeffDomain())
    129144    return CFFList (CFFactor (F, 1));
    130145
    131   CanonicalForm sqrf= sqrfPart (F);
     146  CanonicalForm sqrf= uniSqrfPart (F);
    132147  CFList sqrfFactors= AlgExtSqrfFactorize (sqrf, alpha);
    133148
    134   On (SW_RATIONAL);
     149  if (!isOn (SW_RATIONAL))
     150    On (SW_RATIONAL);
    135151  CanonicalForm buf= F/Lc (F);
    136152  CFFList factors;
     
    147163    factors.append (CFFactor (i.getItem(), multi));
    148164  }
    149   Off (SW_RATIONAL);
    150165  factors.insert (CFFactor (Lc(F), 1));
    151166  ASSERT (degree (buf) <= 0, "bug in AlgExtFactorize");
Note: See TracChangeset for help on using the changeset viewer.