Changeset 272189 in git


Ignore:
Timestamp:
Mar 6, 2014, 5:48:59 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
4ed86341d5d2626ed91cbd40751801c58a8be5ac
Parents:
69a6e9955a5750b58d81ad7f4de1d9e8966c768682b7491e748b809bc43f85275bfee6b0730617cd
Message:
Merge pull request #531 from mmklee/factory_noPP

Factory no pp
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • Singular/extra.cc

    r69a6e9 r272189  
    26792679//       }
    26802680//       else
    2681   /*==================== isSqrFree =============================*/
    2682       if(strcmp(sys_cmd,"isSqrFree")==0)
    2683       {
    2684         if ((h!=NULL) &&(h->Typ()==POLY_CMD))
    2685         {
    2686           res->rtyp=INT_CMD;
    2687           res->data=(void *)(long) singclap_isSqrFree((poly)h->Data(), currRing);
    2688           return FALSE;
    2689         }
    2690         else
    2691           WerrorS("poly expected");
    2692       }
    2693       else
    26942681  /*==================== pDivStat =============================*/
    26952682  #if defined(PDEBUG) || defined(PDIV_DEBUG)
  • Singular/misc_ip.cc

    r82b749 r272189  
    803803              StringAppend("FLINT(%s),",version);
    804804#endif
    805 
     805              StringAppend("factory(%s),\n\t", factoryVersion);
    806806#if defined(HAVE_DYN_RL)
    807807              if (fe_fgets_stdin==fe_fgets_dummy)
  • Tst/Short/factorizeQ_s.res.gz.uu

    r69a6e9 r272189  
    11begin 644 factorizeQ_s.res.gz
    2 M'XL("#%M5E(``V9A8W1O<FEZ95%?<RYR97,`[5A+C]LV$+[[5Q"+'F11<CC#
    3 M(25U*Q^*7@(4!8+TMK`7DKRRC3J[AJU-D1;][QWJ;2O;0Q`T"+`P;)'S^.;%
    4 MA\;O?__E[6]""%B*7]_^+&ZJ<[4X[/.;V]G[EH-+P<3[_>.^\N:W,_<4RZ4H
    5 MLZ)Z.NW_>GAW?UX\/ORY.%=9U2OII>C'M!#'TU,AJH=SU6B=A7?8GRMQ",3Q
    6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'!L&L!]T`&\PC-R@QX#:,#8!L:'5`:U!
     44M-P&IH3D%E'H=(.J'@,_8!G#Z,2!#<H!E"*`T`9*`R/+-<84M#=6DWC94CV`1
     45MZ5&ZAPDMU:`>QE,#WHRP$C:;AFH.EFDJ-QC6'14:DD?##&U'Y84T:2XL`[E/
     46M)64P8TL%@P;0,#UIIH&^,R<J'OUPHL*!=50TAM%0P:!54(-]6JH3@(QJ!*R@
     47M^@`S6RH-4-G2Z6A,2T>PA4)4`VQ+E:#7+54!AM"ZAB2-`<+$_"-)^*%ESF?H
     48M<IJNB.WG"Q,8OK<CLWMO<,,C8H=_T`3DR3YF<P2U92+O!TLDSA),WS3#S,WH
     49M,F<'^$#7H^V8J@GGCDFZ[YBA*3),SHUC9D8VD>7@9$1<=\3&<)H:X&$&GQEX
     50M;$W'Y-N;3C/O$LPG9MRA)9Q!MBT#7A!"[8DI=N@(*[#K,)Z860$/LVIOF5*1
     51M'\2GA#=3:<\I"A8%N!T3:-]T3)X]FPG>A)EDKZ5=B2[1[Y@I.\LT.6)+9LB6
     52MM@8[#MV)F9&`D\A'ID1XQG3(P($*1TH9T.`P=DR!(_E64'2)^T;-Q$=S57EB
     53DSF/*^]JCSYU=_!PN?O3O,_KO6->LU/KMWZ[^!SRP0WIT&P``
    2954`
    3055end
  • Tst/Short/factorizeQ_s.stat

    r69a6e9 r272189  
    1 1 >> tst_memory_0 :: 1381395760:3170:3-1-7:ix86-Linux:mamawutz:3537912
    2 1 >> tst_memory_1 :: 1381395760:3170:3-1-7:ix86-Linux:mamawutz:10604976
    3 1 >> tst_memory_2 :: 1381395760:3170:3-1-7:ix86-Linux:mamawutz:16937404
    4 1 >> tst_timer_1 :: 1381395760:3170:3-1-7:ix86-Linux:mamawutz:344
     11 >> tst_memory_0 :: 1394028756:4.0.0, 32 bit:4.0.0:i686-Linux:mamawutz:1684908
     21 >> tst_memory_1 :: 1394028756:4.0.0, 32 bit:4.0.0:i686-Linux:mamawutz:16921424
     31 >> tst_memory_2 :: 1394028756:4.0.0, 32 bit:4.0.0:i686-Linux:mamawutz:25430308
     41 >> tst_timer_1 :: 1394028756:4.0.0, 32 bit:4.0.0:i686-Linux:mamawutz:1094
  • Tst/Short/factorizeQ_s.tst

    r69a6e9 r272189  
    3939testfactors (l, g);
    4040
     41kill r;
     42
     43ring r=0,(x,y,z,s,t,u,v),dp;
     44poly f= 39*y^2*z^3*t+87*x^4*s*t+48*x*y^2*z*t^2+12*x*y*z*s*t^2+85*x*z^2*s*t^2+86*x^2*z^3*u+9*x*y^3*s*u+14*z^3*t^2*u+62*x^2*z^2*u^2+46*z*s*t^2*u^2+3*y*t*u^4+86*x*y^2*z^2*v+100*y*z^2*s^2*v+50*y^3*z*t*v+97*y*z^2*s*t*v+3*x^2*s*t^2*v+97*x*u^3*v^2+98*x*y*v^4+38*z^2*v^4+78*y*z^3*s+82*y^3*z*t+10*x^2*z*t*u+43*y^2*u^3+31*y^3*s*v+73*x*y*z*t*v+29*y*z^2*t*v+53*s^3*t*v+84*t*u^3*v+89*s^2*v^3+68*x^2*t^2+51*y^2*s*v+45*s^2*t*v+33*z*s*u*v+63*z*v^3+66*y*t^2+100*x*z*u+80*t*v+39*v+34;
     45poly g= 340*x^4*z*t+260*x^3*y*s*t+645*x*y^2*s^2*t+49*y^3*z*t^2+847*z*s^3*t^2+293*x*y^4*u+69*x*y^2*s^2*u+936*z*s^3*t*u+488*y^2*z*t^2*u+917*z^3*t^2*u+590*z^4*u^2+349*x*z^2*s*u^2+633*x*u^5+815*y^2*z^3*v+622*s^5*v+605*x^2*y^2*t*v+957*x*y*s^2*u*v+47*z^2*t^2*u*v+934*z*s*t^2*u*v+991*z*t^3*u*v+133*x^3*u^2*v+380*x^2*s*t*v^2+410*y*t^3*v^2+724*t*u^3*v^2+789*s^2*t*v^3+495*y*u^2*v^3+720*y*z*v^4+177*s*u*v^4+630*x^4*y+394*x^4*s+524*x*y*z*t^2+212*x*y*z*s*u+254*x^2*t*u^2+863*x*s*u^3+543*x*y^2*t*v+850*x*y*s*t*v+94*y*t^3*v+812*x*y*s*u*v+698*u^4*v+844*z*u^2*v^2+581*t^2*v^3+973*y*u*v^3+508*x*y^2*s+4*s*t^3+616*z*s*t*u+834*z*t^2*u+301*z*t^2*v+531*y*z*u*v+288*z*t*v^2+751*y^2*z+34*z^2*s+435*z*u*v+98*v^2+522*v+135;
     46poly h= 4656*x^2*y*s+5376*z^2*s^2+7137*y*s^3+6546*z*s^3+809*x*y^2*u+3467*y^3*u+616*y^2*z*u+7495*y*z*s*u+9144*y*t^2*u+7642*y^2*s*v+3859*y*s*v^2+6999*x^2*s+9515*x*y*s+4938*z*t^2+3163*x*z*u+8433*s*v^2+300*y*u+3704*s*v+9262*x+7171;
     47poly k=f*g*h;
     48list l= factorize (k);
     49testfactors (l, k);
     50
    4151tst_status(1);$
  • factory/FLINTconvert.cc

    r69a6e9 r272189  
    149149void convertCF2Fmpq (fmpq_t result, const CanonicalForm& f)
    150150{
    151   ASSERT (isOn (SW_RATIONAL), "expected rational");
     151  //ASSERT (isOn (SW_RATIONAL), "expected rational");
    152152  fmpz_t tmp1, tmp2;
    153153  fmpz_init (tmp1);
     
    177177CanonicalForm convertFmpq_t2CF (const fmpq_t q)
    178178{
    179   ASSERT (isOn (SW_RATIONAL), "expected rational");
     179  //ASSERT (isOn (SW_RATIONAL), "expected rational");
    180180
    181181  CanonicalForm num, den;
     
    227227void convertFacCF2Fmpq_poly_t (fmpq_poly_t result, const CanonicalForm& f)
    228228{
    229   ASSERT (isOn (SW_RATIONAL), "expected poly over Q");
     229  //ASSERT (isOn (SW_RATIONAL), "expected poly over Q");
    230230
    231231  fmpq_poly_init2 (result, degree (f)+1);
  • factory/Makefile.am

    r69a6e9 r272189  
    33SUBDIRS=include/factory libfac
    44
    5 AM_CPPFLAGS = -I${builddir}/include -I${srcdir}/include $(FLINT_CFLAGS) ${GMP_CFLAGS} ${NTL_CFLAGS} ${OMALLOC_CFLAGS}
     5AM_CPPFLAGS = -I${builddir}/include -I${srcdir}/include $(FLINT_CFLAGS) $(GMP_CFLAGS) $(NTL_CFLAGS) $(OMALLOC_CFLAGS)
    66
    77lib_LTLIBRARIES = libfactory.la
    88
    99libfactory_la_LIBADD     = ${builddir}/libfac/libfac.la \
    10 ${builddir}/../omalloc/libomalloc.la ${builddir}/../resources/libresources.la \
    11 $(FLINT_LIBS) ${GMP_LIBS} ${NTL_LIBS}
     10$(OMALLOC_LDFLAGS) $(OMALLOC_R_LDADD) $(FLINT_LIBS) $(GMP_LIBS) $(NTL_LIBS)
    1211
    1312libfactory_la_LDFLAGS    = -release ${PACKAGE_VERSION}
     
    7574                int_intdiv.cc \
    7675                int_poly.cc \
    77                 int_pp.cc \
    7876                int_rat.cc \
    7977                variable.cc \
     
    145143                int_int.h \
    146144                int_poly.h \
    147                 int_pp.h \
    148145                int_rat.h \
    149146                timing.h \
  • factory/canonicalform.cc

    r69a6e9 r272189  
    1616#include "imm.h"
    1717#include "gfops.h"
     18#include "facMul.h"
    1819
    1920#include <factory/cf_gmp.h>
     
    9798{
    9899    return is_imm( value ) == GFMARK;
    99 }
    100 
    101 bool
    102 CanonicalForm::inPP() const
    103 {
    104     return ! is_imm( value ) && ( value->levelcoeff() == PrimePowerDomain );
    105100}
    106101
     
    222217            else
    223218                return *this;
    224         else  if ( CFFactory::gettype() == PrimePowerDomain )
    225             return CanonicalForm( CFFactory::basic( imm2int( value ) ) );
    226219        else  if ( getGFDegree() == 1 )
    227220            return CanonicalForm( int2imm_p( ff_norm( imm2int( value ) ) ) );
     
    230223    else  if ( value->inBaseDomain() )
    231224        if ( getCharacteristic() == 0 )
    232             if ( value->levelcoeff() == PrimePowerDomain )
    233                 return CFFactory::basic( getmpi( value, true ) );
    234             else
    235                 return *this;
    236         else  if ( CFFactory::gettype() == PrimePowerDomain )
    237         {
    238             ASSERT( value->levelcoeff() == PrimePowerDomain || value->levelcoeff() == IntegerDomain, "no proper map defined" );
    239             if ( value->levelcoeff() == PrimePowerDomain )
    240                 return *this;
    241             else
    242                 return CFFactory::basic( getmpi( value ) );
    243         }
     225             return *this;
    244226        else
    245227        {
     
    694676        value = value->mulcoeff( cf.value );
    695677    else  if ( value->level() == cf.value->level() ) {
     678#if (HAVE_NTL && HAVE_FLINT && __FLINT_VERSION_MINOR >= 4)
     679        if (value->levelcoeff() == cf.value->levelcoeff() && cf.isUnivariate() && (*this).isUnivariate())
     680        {
     681          if (value->level() < 0 || CFFactory::gettype() == GaloisFieldDomain || (size (cf) <= 10 || size (*this) <= 10) )
     682            value = value->mulsame( cf.value );
     683          else
     684            *this= mulNTL (*this, cf);
     685        }
     686        else if (value->levelcoeff() == cf.value->levelcoeff() && (!cf.isUnivariate() || !(*this).isUnivariate()))
     687            value = value->mulsame( cf.value );
     688#else
    696689        if ( value->levelcoeff() == cf.value->levelcoeff() )
    697690            value = value->mulsame( cf.value );
     691#endif
    698692        else  if ( value->levelcoeff() > cf.value->levelcoeff() )
    699693            value = value->mulcoeff( cf.value );
     
    736730        value = value->dividecoeff( cf.value, false );
    737731    else  if ( value->level() == cf.value->level() ) {
    738         if ( value->levelcoeff() == cf.value->levelcoeff() )
     732#if (HAVE_NTL && HAVE_FLINT && __FLINT_VERSION_MINOR >= 4)
     733        if ( value->levelcoeff() == cf.value->levelcoeff() && (*this).isUnivariate() && cf.isUnivariate())
     734        {
     735            if (value->level() < 0 || CFFactory::gettype() == GaloisFieldDomain)
     736              value = value->dividesame( cf.value );
     737            else
     738              *this= divNTL (*this, cf);
     739        }
     740        else if (value->levelcoeff() == cf.value->levelcoeff() && (!cf.isUnivariate() || !(*this).isUnivariate()))
    739741            value = value->dividesame( cf.value );
     742#else
     743        if (value->levelcoeff() == cf.value->levelcoeff() )
     744            value = value->dividesame( cf.value );
     745#endif
    740746        else  if ( value->levelcoeff() > cf.value->levelcoeff() )
    741747            value = value->dividecoeff( cf.value, false );
  • factory/canonicalform.h

    r69a6e9 r272189  
    8989    bool inFF() const;
    9090    bool inGF() const;
    91     bool inPP() const;
    9291    bool inBaseDomain() const;
    9392    bool inExtension() const;
  • factory/cfNewtonPolygon.cc

    r69a6e9 r272189  
    727727  int k= 0;
    728728  Variable alpha;
     729  mpz_t * exps= new mpz_t [2*size (F)];
     730  int count= 0;
    729731  for (CFIterator i= F; i.hasTerms(); i++)
    730732  {
     
    749751          mpz_set (minExpX, expX);
    750752      }
    751       result += i.coeff()*power (x, mpz_get_si (expX))*
    752                 power (y, mpz_get_si (expY));
     753      mpz_init_set (exps[count], expX);
     754      count++;
     755      mpz_init_set (exps[count], expY);
     756      count++;
    753757      continue;
    754758    }
     
    766770      mpz_set (minExpX, expX);
    767771      mpz_set (minExpY, expY);
    768       result += j.coeff()*power (x, mpz_get_si (expX))*
    769                 power (y, mpz_get_si (expY));
     772      mpz_init_set (exps[count], expX);
     773      count++;
     774      mpz_init_set (exps[count], expY);
     775      count++;
    770776      j++;
    771777      k= 1;
     
    782788      mpz_addmul_ui (expY, M[2], j.exp());
    783789
    784       result += j.coeff()*power (x, mpz_get_si (expX))*
    785                 power (y, mpz_get_si (expY));
     790      mpz_init_set (exps[count], expX);
     791      count++;
     792      mpz_init_set (exps[count], expY);
     793      count++;
    786794      if (mpz_cmp (minExpY, expY) > 0)
    787795        mpz_set (minExpY, expY);
     
    791799  }
    792800
    793   if (mpz_sgn (minExpX) < 0)
    794   {
    795     result *= power (x,-mpz_get_si(minExpX));
    796     result /= CanonicalForm (x, 0);
    797   }
    798   else
    799     result /= power (x,mpz_get_si(minExpX));
    800 
    801   if (mpz_sgn (minExpY) < 0)
    802   {
    803     result *= power (y,-mpz_get_si(minExpY));
    804     result /= CanonicalForm (y, 0);
    805   }
    806   else
    807     result /= power (y,mpz_get_si(minExpY));
     801  count= 0;
     802  int mExpX= mpz_get_si (minExpX);
     803  int mExpY= mpz_get_si (minExpY);
     804  for (CFIterator i= F; i.hasTerms(); i++)
     805  {
     806    if (i.coeff().inCoeffDomain() && hasFirstAlgVar (i.coeff(), alpha))
     807    {
     808      result += i.coeff()*power (x, mpz_get_si (exps[count])-mExpX)*
     809                power (y, mpz_get_si (exps[count+1])-mExpY);
     810      count += 2;
     811      continue;
     812    }
     813    CFIterator j= i.coeff();
     814    for (; j.hasTerms(); j++)
     815    {
     816      result += j.coeff()*power (x, mpz_get_si (exps[count])-mExpX)*
     817                power (y, mpz_get_si (exps[count+1])-mExpY);
     818      count += 2;
     819    }
     820  }
    808821
    809822  CanonicalForm tmp= LC (result);
     
    824837  }
    825838
     839  delete [] exps;
    826840  mpz_clear (expX);
    827841  mpz_clear (expY);
     
    845859  mpz_init (minExpY);
    846860
     861  mpz_t * exps= new mpz_t [2*size(F)];
     862  int count= 0;
    847863  if (F.isUnivariate() && F.level() == 1)
    848864  {
     
    861877    mpz_set (minExpX, expX);
    862878    mpz_set (minExpY, expY);
    863     result += i.coeff()*power (x, mpz_get_si (expX))*
    864               power (y, mpz_get_si (expY));
     879
     880    mpz_init_set (exps[count], expX);
     881    mpz_init_set (exps[count+1], expY);
     882    count += 2;
     883
    865884    i++;
    866885    for (; i.hasTerms(); i++)
     
    876895      mpz_submul (expY, inverseM[3], A[1]);
    877896
    878       result += i.coeff()*power (x, mpz_get_si (expX))*
    879                 power (y, mpz_get_si (expY));
     897      mpz_init_set (exps[count], expX);
     898      mpz_init_set (exps[count+1], expY);
     899      count += 2;
     900
    880901      if (mpz_cmp (minExpY, expY) > 0)
    881902        mpz_set (minExpY, expY);
     
    884905    }
    885906
    886     if (mpz_sgn (minExpX) < 0)
    887     {
    888       result *= power (x,-mpz_get_si(minExpX));
    889       result /= CanonicalForm (x, 0);
    890     }
    891     else
    892       result /= power (x,mpz_get_si(minExpX));
    893 
    894     if (mpz_sgn (minExpY) < 0)
    895     {
    896       result *= power (y,-mpz_get_si(minExpY));
    897       result /= CanonicalForm (y, 0);
    898     }
    899     else
    900       result /= power (y,mpz_get_si(minExpY));
     907    int mExpX= mpz_get_si (minExpX);
     908    int mExpY= mpz_get_si (minExpY);
     909    count= 0;
     910    for (i= F; i.hasTerms(); i++)
     911    {
     912      result += i.coeff()*power (x, mpz_get_si (exps[count])-mExpX)*
     913                power (y, mpz_get_si (exps[count+1])-mExpY);
     914      count += 2;
     915    }
    901916
    902917    mpz_clear (expX);
     
    905920    mpz_clear (minExpY);
    906921
     922    delete [] exps;
    907923    return result/ Lc (result); //normalize
    908924  }
     
    939955          mpz_set (minExpX, expX);
    940956      }
    941       result += i.coeff()*power (x, mpz_get_si (expX))*
    942                 power (y, mpz_get_si (expY));
     957      mpz_init_set (exps[count], expX);
     958      mpz_init_set (exps[count+1], expY);
     959      count += 2;
    943960      continue;
    944961    }
     
    962979      mpz_set (minExpX, expX);
    963980      mpz_set (minExpY, expY);
    964       result += j.coeff()*power (x, mpz_get_si (expX))*
    965                 power (y, mpz_get_si (expY));
     981
     982      mpz_init_set (exps[count], expX);
     983      mpz_init_set (exps[count+1], expY);
     984      count += 2;
     985
    966986      j++;
    967987      k= 1;
     
    9841004      mpz_addmul (expY, tmp, inverseM[3]);
    9851005
    986       result += j.coeff()*power (x, mpz_get_si (expX))*
    987                 power (y, mpz_get_si (expY));
     1006      mpz_init_set (exps[count], expX);
     1007      mpz_init_set (exps[count+1], expY);
     1008      count += 2;
     1009
    9881010      if (mpz_cmp (minExpY, expY) > 0)
    9891011        mpz_set (minExpY, expY);
     
    9931015  }
    9941016
    995   if (mpz_sgn (minExpX) < 0)
    996   {
    997     result *= power (x,-mpz_get_si(minExpX));
    998     result /= CanonicalForm (x, 0);
    999   }
    1000   else
    1001     result /= power (x,mpz_get_si(minExpX));
    1002 
    1003   if (mpz_sgn (minExpY) < 0)
    1004   {
    1005     result *= power (y,-mpz_get_si(minExpY));
    1006     result /= CanonicalForm (y, 0);
    1007   }
    1008   else
    1009     result /= power (y,mpz_get_si(minExpY));
     1017  int mExpX= mpz_get_si (minExpX);
     1018  int mExpY= mpz_get_si (minExpY);
     1019  count= 0;
     1020  for (CFIterator i= F; i.hasTerms(); i++)
     1021  {
     1022    if (i.coeff().inCoeffDomain() && hasFirstAlgVar (i.coeff(), alpha))
     1023    {
     1024      result += i.coeff()*power (x, mpz_get_si (exps[count])-mExpX)*
     1025                power (y, mpz_get_si (exps[count+1])-mExpY);
     1026      count += 2;
     1027      continue;
     1028    }
     1029    for (CFIterator j= i.coeff(); j.hasTerms(); j++)
     1030    {
     1031      result += j.coeff()*power (x, mpz_get_si (exps[count])-mExpX)*
     1032                power (y, mpz_get_si (exps[count+1])-mExpY);
     1033      count += 2;
     1034    }
     1035  }
    10101036
    10111037  mpz_clear (expX);
     
    10141040  mpz_clear (minExpY);
    10151041  mpz_clear (tmp);
     1042
     1043  delete [] exps;
    10161044
    10171045  return result/Lc (result); //normalize
  • factory/cf_algorithm.cc

    r69a6e9 r272189  
    348348    if ( (f.inCoeffDomain() || g.inCoeffDomain())
    349349         && ((getCharacteristic() == 0 && isOn( SW_RATIONAL ))
    350              || (getCharacteristic() > 0 && CFFactory::gettype() != PrimePowerDomain)) )
     350             || (getCharacteristic() > 0) ))
    351351    {
    352352        // if we are in a field all elements not equal to zero are units
     
    400400    if ( (f.inCoeffDomain() || g.inCoeffDomain())
    401401         && ((getCharacteristic() == 0 && isOn( SW_RATIONAL ))
    402              || (getCharacteristic() > 0 && CFFactory::gettype() != PrimePowerDomain)) )
     402             || (getCharacteristic() > 0) ))
    403403    {
    404404        // if we are in a field all elements not equal to zero are units
  • factory/cf_algorithm.h

    r69a6e9 r272189  
    7171CFFList sqrFree ( const CanonicalForm & f, bool sort= false );
    7272
    73 bool isSqrFree ( const CanonicalForm & f );
    74 
    7573CanonicalForm homogenize( const CanonicalForm & f, const Variable & x);
    7674CanonicalForm homogenize( const CanonicalForm & f, const Variable & x,
  • factory/cf_char.cc

    r69a6e9 r272189  
    1010#include "canonicalform.h"
    1111#include "imm.h"
    12 #include "int_pp.h"
    1312#include "cf_primes.h"
    1413#include "cf_util.h"
     
    3433        ff_setprime( c );
    3534    }
    36 }
    37 
    38 void setCharacteristic( int c, int n )
    39 {
    40     ASSERT( c > 1 && n > 0, "illegal characteristic" );
    41     setCharacteristic( c );
    42     InternalPrimePower::setPrimePower( c, n );
    43     CFFactory::settype( PrimePowerDomain );
    4435}
    4536
  • factory/cf_defs.h

    r69a6e9 r272189  
    1414
    1515#define UndefinedDomain 32000
    16 #define PrimePowerDomain 5
    1716#define GaloisFieldDomain 4
    1817#define FiniteFieldDomain 3
  • factory/cf_factor.cc

    r69a6e9 r272189  
    780780}
    781781
    782 bool isSqrFree ( const CanonicalForm & f )
    783 {
    784 //    ASSERT( f.isUnivariate(), "multivariate factorization not implemented" );
    785     if ( getCharacteristic() == 0 )
    786         return isSqrFreeZ( f );
    787     else
    788         return isSqrFreeFp( f );
    789 }
    790 
  • factory/cf_factory.cc

    r69a6e9 r272189  
    1414#include "int_rat.h"
    1515#include "int_poly.h"
    16 #include "int_pp.h"
    1716#include "imm.h"
    1817
     
    2221CFFactory::settype ( int type )
    2322{
    24     ASSERT( type==FiniteFieldDomain || type==GaloisFieldDomain || type==IntegerDomain || type==RationalDomain || type==PrimePowerDomain, "illegal basic domain!" );
     23    ASSERT( type==FiniteFieldDomain || type==GaloisFieldDomain || type==IntegerDomain || type==RationalDomain, "illegal basic domain!" );
    2524    currenttype = type;
    2625}
     
    4342    else  if ( currenttype == GaloisFieldDomain )
    4443        return int2imm_gf( gf_int2gf( value ) );
    45     else  if ( currenttype == PrimePowerDomain )
    46         return new InternalPrimePower( value );
    4744    else {
    4845        ASSERT( 0, "illegal basic domain!" );
     
    6865    else  if ( type == GaloisFieldDomain )
    6966        return int2imm_gf( gf_int2gf( value ) );
    70     else  if ( type == PrimePowerDomain )
    71         return new InternalPrimePower( value );
    7267    else {
    7368        ASSERT1( 0, "illegal basic domain (type = %d)!", type );
     
    111106        return res;
    112107    }
    113     else  if ( currenttype == PrimePowerDomain )
    114         return new InternalPrimePower( str );
    115108    else {
    116109        ASSERT( 0, "illegal basic domain!" );
     
    154147        return res;
    155148    }
    156     else  if ( currenttype == PrimePowerDomain )
    157         return new InternalPrimePower( str, base );
    158149    else {
    159150        ASSERT( 0, "illegal basic domain!" );
     
    197188        return res;
    198189    }
    199     else  if ( type == PrimePowerDomain )
    200         return new InternalPrimePower( str );
    201190    else {
    202191        ASSERT( 0, "illegal basic domain!" );
     
    224213CFFactory::basic ( const mpz_ptr num )
    225214{
    226     if ( currenttype != IntegerDomain ) {
    227         InternalPrimePower * dummy = new InternalPrimePower( num );
    228         return (InternalCF*)(dummy->normalize_myself());
    229     }
    230     else
    231         return new InternalInteger( num );
     215  ASSERT (currenttype == IntegerDomain, "Integer domain expected");
     216  return new InternalInteger( num );
    232217}
    233218
     
    268253}
    269254
    270 mpz_ptr getmpi ( InternalCF * value, bool symmetric )
    271 {
    272     ASSERT( ! is_imm( value ) && ( value->levelcoeff() == PrimePowerDomain || value->levelcoeff() == IntegerDomain ), "illegal operation" );
    273     mpz_ptr dummy= new mpz_t;
    274     if ( value->levelcoeff() == IntegerDomain )
    275         mpz_init_set( dummy, InternalInteger::MPI( value ) );
    276     else  if ( symmetric ) {
    277         mpz_init( dummy );
    278         InternalPrimePower::initialize();
    279         if ( mpz_cmp( InternalPrimePower::primepowhalf, InternalPrimePower::MPI( value ) ) < 0 )
    280             mpz_sub( dummy, InternalPrimePower::MPI( value ), InternalPrimePower::primepow );
    281         else
    282             mpz_set( dummy, InternalPrimePower::MPI( value ) );
    283     }
    284     else
    285         mpz_init_set( dummy, InternalPrimePower::MPI( value ) );
    286     return dummy;
    287 }
    288 
    289255void getmpi ( InternalCF * value, mpz_t mpi)
    290256{
  • factory/cf_factory.h

    r69a6e9 r272189  
    3434};
    3535
    36 mpz_ptr getmpi ( InternalCF * value, bool symmetric = true );
    3736void getmpi ( InternalCF * value, mpz_t mpi);
    3837
  • factory/configure.ac

    r69a6e9 r272189  
    340340AH_TEMPLATE([HAVE_OMALLOC], [define if build with OMALLOC])
    341341
    342 if test "x$with_Singular" = xyes; then
    343 
    344342AC_MSG_CHECKING([whether to use omalloc/omalloc.h])
    345343if test "x$ENABLE_OMALLOC" = xyes; then
     
    351349  if test "x$with_omalloc_extra_dir" != "x"; then
    352350    OMALLOC_CFLAGS="$OMALLOC_CFLAGS -I${with_omalloc_extra_dir}"
    353     OMALLOC_LDFLAGS="$OMALLOC_LDFLAGS -L${with_omalloc_extra_dir}/omalloc -L${with_omalloc_extra_dir}/resources"
     351    OMALLOC_LDFLAGS="$OMALLOC_LDFLAGS -L${with_omalloc_extra_dir}/omalloc"
     352    if test "x$with_Singular" = xyes; then
     353      OMALLOC_LDFLAGS="$OMALLOC_LDFLAGS -L${with_omalloc_extra_dir}/resources"
     354    fi
    354355  fi
    355356 
     
    365366
    366367#  OMALLOC_G_LDADD="-lresources_g -lomalloc_g"
    367   OMALLOC_R_LDADD="-lresources -lomalloc"
    368  
     368  OMALLOC_R_LDADD="-lomalloc"
     369  if test "x$with_Singular" = xyes; then
     370    OMALLOC_R_LDADD="$OMALLOC_R_LDADD -lresources"
     371  fi
     372
    369373  AC_DEFINE(HAVE_OMALLOC, 1, [omalloc support])
    370374 
     
    376380else
    377381  AC_MSG_RESULT(no)
    378 fi
    379 
    380382fi
    381383
  • factory/facMul.cc

    r69a6e9 r272189  
    602602  if (hasFirstAlgVar (F, alpha) || hasFirstAlgVar (G, alpha))
    603603  {
     604    if (!getReduce (alpha))
     605    {
     606      result= 0;
     607      for (CFIterator i= F; i.hasTerms(); i++)
     608        result += i.coeff()*G*power (F.mvar(),i.exp());
     609      return result;
     610    }
    604611#if (HAVE_FLINT && __FLINT_VERSION_MINOR >= 4)
    605612    nmod_poly_t FLINTmipo;
  • factory/fac_ezgcd.cc

    r69a6e9 r272189  
    493493  TIMING_START (ez_content)
    494494  f = content( F, x ); g = content( G, x ); d = gcd( f, g );
    495   d /= icontent (d);
    496495  DEBOUTLN( cerr, "f = " << f );
    497496  DEBOUTLN( cerr, "g = " << g );
  • factory/fac_sqrfree.cc

    r69a6e9 r272189  
    1111#include "cf_map.h"
    1212#include "cf_algorithm.h"
    13 
    14 static int divexp = 1;
    15 
    16 static void divexpfunc ( CanonicalForm &, int & e )
    17 {
    18     e /= divexp;
    19 }
    2013
    2114static int
     
    4942    return result;
    5043}
    51 
    52 CFFList sqrFreeFp ( const CanonicalForm & f )
    53 {
    54     CanonicalForm t0 = f, t, v, w, h;
    55     CanonicalForm leadcf = t0.lc();
    56     Variable x = f.mvar();
    57     CFFList F;
    58     int p = getCharacteristic();
    59     int k, e = 1;
    60 
    61     if ( ! leadcf.isOne() )
    62         t0 /= leadcf;
    63 
    64     divexp = p;
    65     while ( t0.degree(x) > 0 )
    66     {
    67         t = gcd( t0, t0.deriv() );
    68         v = t0 / t;
    69         k = 0;
    70         while ( v.degree(x) > 0 )
    71         {
    72             k = k+1;
    73             if ( k % p == 0 )
    74             {
    75                 t /= v;
    76                 k = k+1;
    77             }
    78             w = gcd( t, v );
    79             h = v / w;
    80             v = w;
    81             t /= v;
    82             if ( h.degree(x) > 0 )
    83                 F.append( CFFactor( h/h.lc(), e*k ) );
    84         }
    85         t0 = apply( t, divexpfunc );
    86         e = p * e;
    87     }
    88     if ( ! leadcf.isOne() )
    89     {
    90         if ( !F.isEmpty() && (F.getFirst().exp() == 1) )
    91         {
    92             leadcf = F.getFirst().factor() * leadcf;
    93             F.removeFirst();
    94         }
    95         F.insert( CFFactor( leadcf, 1 ) );
    96     }
    97     return F;
    98 }
    99 
    100 bool isSqrFreeFp( const CanonicalForm & f )
    101 {
    102   CFFList F = sqrFreeFp( f );
    103   return ( F.length() == 1 && F.getFirst().exp() == 1 );
    104 }
    105 
    106 bool isSqrFreeZ ( const CanonicalForm & f )
    107 {
    108     return gcd( f, f.deriv() ).degree() == 0;
    109 }
    110 
    111 /*
    112 
    113 CFFList sqrFreeZ ( const CanonicalForm & a )
    114 {
    115     CanonicalForm b = a.deriv(), c = gcd( a, b );
    116     CanonicalForm y, z, w = a / c;
    117     int i = 1;
    118     CFFList F;
    119 
    120     while ( ! c.degree() == 0 )
    121     {
    122         y = gcd( w, c ); z = w / y;
    123         if ( degree( z ) > 0 )
    124             if ( lc( z ).sign() < 0 )
    125                 F.append( CFFactor( -z, i ) );
    126             else
    127                 F.append( CFFactor( z, i ) );
    128         i++;
    129         w = y; c = c / y;
    130     }
    131     if ( degree( w ) > 0 )
    132         if ( lc( w ).sign() < 0 )
    133             F.append( CFFactor( -w, i ) );
    134         else
    135             F.append( CFFactor( w, i ) );
    136     return F;
    137 }
    138 */
    13944
    14045CFFList sqrFreeZ ( const CanonicalForm & a )
  • factory/fac_sqrfree.h

    r69a6e9 r272189  
    1010CFFList sortCFFList ( CFFList & F );
    1111
    12 CFFList sqrFreeFp ( const CanonicalForm & f );
    13 
    14 bool isSqrFreeFp ( const CanonicalForm & f );
    15 
    1612CFFList sqrFreeZ ( const CanonicalForm & f );
    17 
    18 bool isSqrFreeZ ( const CanonicalForm & f );
    1913
    2014/// squarefree part of a poly
  • factory/int_int.h

    r69a6e9 r272189  
    125125    friend void gmp_numerator ( const CanonicalForm & f, mpz_ptr result);
    126126    friend void gmp_denominator ( const CanonicalForm & f, mpz_ptr result );
    127     friend mpz_ptr getmpi ( InternalCF * value, bool symmetric );
    128127    friend void getmpi ( InternalCF * value, mpz_t mpi);
    129128};
  • factory/int_poly.cc

    r69a6e9 r272189  
    778778        exp = aPoly->firstTerm->exp;
    779779        while (first && ( first->exp >= exp ) )
    780                {
     780        {
    781781            newcoeff = first->coeff / coeff;
    782782            newexp = first->exp - exp;
  • factory/test.cc

    r69a6e9 r272189  
    11#include <factory/factory.h>
    2 #include <resources/feFopen.h>
    32#include "cf_assert.h"
    43
     
    7776}*/
    7877
    79 extern void feInitResources(const char* argv0 = NULL);
    80 
    8178int main( int, char *argv[] )
    8279{
     
    9188    return(1);
    9289  }
    93    
    94   feInitResources(argv[0]);
    9590
    9691//  On (SW_USE_EZGCD); On (SW_USE_EZGCD_P); // TODO&NOTE: these switches lead to failed tests (with nonzero p)!
  • libpolys/polys/clapsing.cc

    r69a6e9 r272189  
    15501550}
    15511551
    1552 BOOLEAN singclap_isSqrFree(poly f, const ring r)
    1553 {
    1554   BOOLEAN b=FALSE;
    1555   CanonicalForm F( convSingPFactoryP( f,r ) );
    1556   if((r->cf->type==n_Zp)&&(!F.isUnivariate()))
    1557       goto err;
    1558   b=(BOOLEAN)isSqrFree(F);
    1559   Off(SW_RATIONAL);
    1560   return b;
    1561 err:
    1562   WerrorS( feNotImplemented );
    1563   return 0;
    1564 }
    1565 
    15661552poly singclap_det( const matrix m, const ring s )
    15671553{
  • libpolys/polys/clapsing.h

    r69a6e9 r272189  
    6060# endif
    6161
    62 BOOLEAN singclap_isSqrFree(poly f, const ring r);
    63 
    6462 matrix singclap_irrCharSeries ( ideal I, const ring r);
    6563 char* singclap_neworder ( ideal I, const ring r);
Note: See TracChangeset for help on using the changeset viewer.