Changeset f51a5b in git


Ignore:
Timestamp:
Dec 13, 2012, 5:17:07 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
1d6ec35f323c22dad6c849d92fd276b63460f494801d2b82d26cf116224a17169c6379c454c018e7ea25bc7eab91185a4ce3010da5a5cdc016da2dbf
Parents:
3bfbc700f63b02c4fb904a3529c77a545645d94756f59bd95ce7b9e7cdb716d136dfc40ed593d87f
Message:
Merge pull request #234 from mmklee/sw_fix

Sw fix
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipshell.cc

    r3bfbc7 rf51a5b  
    51445144    assume( float_len <= float_len2 );
    51455145
    5146     if( !complex_flag && (float_len2 <= (short)SHORT_REAL_LENGTH) )
     5146    if (!complex_flag)
     5147      complex_flag= pn->next != NULL;
     5148    if( !complex_flag && (float_len2 <= (short)SHORT_REAL_LENGTH))
    51475149       cf=nInitChar(n_R, NULL);
    51485150    else // longR or longC?
  • Tst/Long/factorizeQa_l.res.gz.uu

    r56f59b rf51a5b  
    11begin 644 factorizeQa_l.res.gz
    2 M'XL("+*]>4\``V9A8W1O<FEZ95%A7VPN<F5S`.U82VLC1Q"^^U<,2PZ21F-U
    3 MO?J1C7P(N01"(&QNB[THR]H(%'NQ%:))R'_/5SW2C+V[@4"R)`=;6--=7=5=
    4 MCZ^^:?3JQV^^_;YI&KIHOOOVZ^;%_F%_OMO^].+EV:OC"E\T$+[9WF[WL_G+
    5 M,W\V%Q?-]>;M_NY^^]N['S9O=N>W[WX]?]AO]J.57#3C6,^;]_=W;YO]NX?]
    6 M8/;0S';;AWVS6S;O[W9]<ST?E>V\^7V<Q'-\58V;=4.33]GEUW?WS6Q[NV^V
    7 MOM9LFZ_6S0,<PMZOZ7(.2=N.^U)PDW%G8I\VONW-HNJ_WEY>[5ZS/^?C0:2N
    8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'G)&&*.]'VQ5&7%)8@K7PH;T0/1+:*".<^]7?^S]2J?':QPA[=O2
     57MJW?7KV_WZ]V1`>-*^_)T3F>[3\^#/[/O3$=&??(!2X-]&WK"G.K]5;>P#U6+
     58M^8"ZL&EC3<OEI[SL?NQ.KK:[F\OO3\Z:]+X_FS\H:;&O2^38B5,77'3)95<<
     59M>4?DB!V)(W44'$5'R5%V5!Q[Q^!AQ^)8'0?'T7%RG!T7)]X).<&6XD2=!"?1
     60M27*2G12GWBDY9:>0J$Z#T^@T.<U.BPOSB\T`3YIE3>=JQF?OKKN'W?Z?QY/X
     61M)]W)>G3IR5^ZA[LWM]<G9S]UES?WE\;PU9<G9S#OJR_G39^$)"`DO^?Y(/#\
     62M\4Z?NS[$WW#]_;M7]_L6@,<U>L_Z@/\/R\VKW34`L)`E!KX_%)J0/]C0E/<0
     63MFNB/H8GT^Z&)_#0T49Z')H8_$AKK<Q8<^STL5_]Q>&+Z4,,3\_L(3SF&)R%4
     647]@W?OM"_NU_0\JS[L_LWO<C_G/H?````
    3465`
    3566end
  • Tst/Long/factorizeQa_l.stat

    r56f59b rf51a5b  
    1 1 >> tst_memory_0 :: 1333378481:3143- exported :3-1-4:ix86-Linux:mamawutz:5349524
    2 1 >> tst_memory_1 :: 1333378481:3143- exported :3-1-4:ix86-Linux:mamawutz:10117120
    3 1 >> tst_memory_2 :: 1333378481:3143- exported :3-1-4:ix86-Linux:mamawutz:10117120
    4 1 >> tst_timer_1 :: 1333378481:3143- exported :3-1-4:ix86-Linux:mamawutz:4394
     11 >> tst_memory_0 :: 1355320642:3150:3-1-5:ix86-Linux:mamawutz:69009584
     21 >> tst_memory_1 :: 1355320642:3150:3-1-5:ix86-Linux:mamawutz:73228288
     31 >> tst_memory_2 :: 1355320642:3150:3-1-5:ix86-Linux:mamawutz:73228288
     41 >> tst_timer_1 :: 1355320642:3150:3-1-5:ix86-Linux:mamawutz:13315
  • Tst/Long/factorizeQa_l.tst

    r56f59b rf51a5b  
    2525l= factorize (f); testfactors (l,f);
    2626
     27//tr. #462 by gorzel
     28ring rw13 = (0,w),(T,x,y),dp;
     29minpoly = (w^4-w^3+2*w^2+4*w+3);
     30
     31poly Hneu =
     32x^13-y^13+(-65*w^3+117*w^2-208*w-156)*T*x^11+(65*w^3-91*w^2+143*w+234)*T*y^11+(-39*w^3+117*w^2-234*w+117)*T*x^10+(78*w^3-91*w^2+130*w+390)*T*y^10+(-689*w^3-2171*w^2+5746*w-16107)*T^2*x^9+(-16705/3*w^3+32435/3*w^2-58045/3*w-8788)*T^2*y^9+(-15210*w^3+21606*w^2-34476*w-57798)*T^2*x^8+(-16614*w^3+28002*w^2-47892*w-43992)*T^2*y^8+(-14547*w^3+26052*w^2-45435*w-32058)*T^2*x^7+(-15054*w^3+24882*w^2-42237*w-42120)*T^2*y^7+(308581*w^3-505388*w^2+854893*w+883038)*T^3*x^7+(47242*w^3-237302*w^2+499135*w-553488)*T^3*y^7+(452270*w^3-1191463*w^2+2291003*w-644709)*T^3*x^6+(582439*w^3-1362920*w^2+2555917*w-92508)*T^3*y^6+(-270816*w^3-229515*w^2+799266*w-3670641)*T^3*x^5+(883662*w^3-1973829*w^2+3661710*w+262431)*T^3*y^5+(-4396327/3*w^3+19510634/3*w^2-40530178/3*w+13462280)*T^4*x^5+(5640596*w^3-6386068*w^2+9065030*w+28409901)*T^4*y^5+(-830401*w^3+974207*w^2-1412983*w-4036071)*T^3*x^4+(760643*w^3-1689688*w^2+3130322*w+266370)*T^3*y^4+(20294378*w^3-26643448*w^2+41060318*w+86440380)*T^4*x^4+(5279066*w^3+3610412*w^2-13593424*w+67843698)*T^4*y^4+(34683727*w^3-58690697*w^2+100467835*w+91123968)*T^4*x^3+(6227858*w^3+7596407*w^2-23720320*w+94392402)*T^4*y^3+(-269815676/3*w^3+390512551/3*w^2-629448482/3*w-331043258)*T^5*x^3+(-94859661*w^3+166063209*w^2-287546493*w-225369144)*T^5*y^3+(31413330*w^3-69137640*w^2+127795122*w+13769730)*T^4*x^2+(2733874*w^3+19260358*w^2-47086208*w+109961202)*T^4*y^2+(-421494307/3*w^3+945300395/3*w^2-1755321490/3*w-36293842)*T^5*x^2+(-193843104*w^3+274995669*w^2-439410660*w-737414028)*T^5*y^2+(6677424*w^3-25392744*w^2+51796368*w-43097184)*T^4*x+(4253080*w^3+7591792*w^2-21735272*w+74806680)*T^4*y+(-52820170*w^3+190018127*w^2-384748741*w+294246537)*T^5*x+(-196474785*w^3+296309208*w^2-485858373*w-671785452)*T^5*y+(5248218976/27*w^3-12863190080/27*w^2+24372820576/27*w-1115453924/9)*T^6*x+(136336200*w^3-396591312*w^2+776924772*w-355580316)*T^6*y+(-153999872/3*w^3+341724448/3*w^2-632914880/3*w-18505760)*T^5+(196115972/3*w^3-887376100/3*w^2+1847311544/3*w-624999544)*T^6;
     33
     34
     35int bugcnt,i;
     36for (i=1;i<=50;i++)
     37{
     38  i;
     39  if (size(factorize(Hneu,1))<2) { "failed";bugcnt++;}
     40}
     41if (bugcnt) { "Bug with factorize: ",bugcnt,"% wrong";} else { "OK"; }
     42
     43for (i=1;i<=50;i++)
     44{
     45  i;
     46  if (size(factorize(subst(Hneu,x,3*x,y,3*y)/bigint(3)^13,1))<2) { "failed";bugcnt++;}
     47}
     48if (bugcnt) { "Bug with factorize: ",bugcnt,"% wrong";} else { "OK"; }
     49
     50for (i=1;i<=50;i++)
     51{
     52  i;
     53  if (size(factorize(subst(Hneu,x,1/3*x,y,1/3*y)*bigint(3)^13,1))<2) { "failed";bugcnt++;}
     54}
     55if (bugcnt) { "Bug with factorize: ",bugcnt,"% wrong";} else { "OK"; }
     56
    2757tst_status(1); $
  • Tst/Short/bug_31.tst

    r3bfbc7 rf51a5b  
    88//
    99ring R3=(2,a),(x,y),lp;
     10minpoly=a2+a+1;
    1011poly g=x2+xy+y2;
    11 minpoly=a2+a+1;
    1212factorize(g);
    1313g=g+y3;
  • factory/FLINTconvert.cc

    r56f59b rf51a5b  
    5757  {
    5858    mpz_t gmp_val;
    59     gmp_val[0]= *getmpi(f.getval());
     59    f.mpzval(gmp_val);
    6060    fmpz_set_mpz (result, gmp_val);
    6161    mpz_clear (gmp_val);
  • factory/NTLconvert.cc

    r56f59b rf51a5b  
    670670    char* stringtemp;
    671671
    672     gmp_val[0]=*getmpi(f.getval());
     672    f.mpzval (gmp_val);
    673673    int l=mpz_sizeinbase(gmp_val,10)+2;
    674674    stringtemp=(char*)Alloc(l);
  • factory/canonicalform.cc

    r56f59b rf51a5b  
    6868    else
    6969        return CanonicalForm( value->deepCopyObject() );
     70}
     71
     72void
     73CanonicalForm::mpzval(mpz_t val) const
     74{
     75    ASSERT (!is_imm (value) && value->levelcoeff() == IntegerDomain, "non-immediate integer expected");
     76    getmpi (value, val);
    7077}
    7178//}}}
  • factory/canonicalform.h

    r56f59b rf51a5b  
    2020#include "cf_defs.h"
    2121#include "variable.h"
     22#include <factory/cf_gmp.h>
    2223#include <factory/templates/ftmpl_list.h>
    2324#include <factory/templates/ftmpl_array.h>
     
    8081    CanonicalForm deepCopy() const;
    8182
     83    void mpzval(mpz_t val) const;
    8284    // predicates
    8385    CF_NO_INLINE bool isOne() const;
  • factory/cf_factory.cc

    r56f59b rf51a5b  
    283283    return dummy;
    284284}
     285
     286void getmpi ( InternalCF * value, mpz_t mpi)
     287{
     288    ASSERT( ! is_imm( value ) && (value->levelcoeff() == IntegerDomain ), "illegal operation" );
     289    mpz_init_set (mpi, ((InternalInteger*)value)->thempi);
     290}
     291
  • factory/cf_factory.h

    r56f59b rf51a5b  
    3535
    3636mpz_ptr getmpi ( InternalCF * value, bool symmetric = true );
     37void getmpi ( InternalCF * value, mpz_t mpi);
    3738
    3839#endif /* ! INCL_CF_FACTORY_H */
  • factory/facBivar.cc

    r56f59b rf51a5b  
    499499  modpk b= modpk();
    500500  bool mipoHasDen= false;
     501  CanonicalForm den= 1;
    501502  if (!extension)
    502503  {
     
    519520  {
    520521    A /= Lc (Aeval);
     522    mipoHasDen= !bCommonDen(mipo).isOne();
     523    mipo *= bCommonDen (mipo);
     524    ZZX NTLmipo= convertFacCF2NTLZZX (mipo);
     525    ZZX NTLLcf= convertFacCF2NTLZZX (Lc (A*bCommonDen (A)));
     526    ZZ NTLf= resultant (NTLmipo, NTLLcf);
     527    ZZ NTLD= discriminant (NTLmipo);
     528    den= abs (convertZZ2CF (NTLD*NTLf));
     529
    521530    // make factors elements of Z(a)[x] disable for modularDiophant
    522531    CanonicalForm multiplier= 1;
     
    529538    A *= bCommonDen (A);
    530539
    531     mipoHasDen= !bCommonDen(mipo).isOne();
    532     mipo *= bCommonDen (mipo);
    533540    Off (SW_RATIONAL);
    534541    int i= 0;
    535     ZZX NTLmipo= convertFacCF2NTLZZX (mipo);
    536     CanonicalForm discMipo= convertZZ2CF (discriminant (NTLmipo));
     542    CanonicalForm discMipo= convertZZ2CF (NTLD);
    537543    findGoodPrime (F*discMipo,i);
    538544    findGoodPrime (Aeval*discMipo,i);
     
    555561  uniFactors= henselLiftAndEarly
    556562              (A, earlySuccess, earlyFactors, degs, liftBound,
    557                uniFactors, dummy, evaluation, b);
     563               uniFactors, dummy, evaluation, b, den);
    558564  TIMING_END_AND_PRINT (fac_bi_hensel_lift,
    559565                        "time for bivariate hensel lifting over Q: ");
     
    578584  TIMING_START (fac_bi_factor_recombination);
    579585  factors= factorRecombination (uniFactors, A, MODl, degs, 1,
    580                                 uniFactors.length()/2, b);
     586                                uniFactors.length()/2, b, den);
    581587  TIMING_END_AND_PRINT (fac_bi_factor_recombination,
    582588                        "time for bivariate factor recombination over Q: ");
  • factory/facFqBivar.cc

    r56f59b rf51a5b  
    482482factorRecombination (CFList& factors, CanonicalForm& F,
    483483                     const CanonicalForm& N, DegreePattern& degs, int s,
    484                      int thres, const modpk& b
     484                     int thres, const modpk& b, const CanonicalForm& den
    485485                    )
    486486{
     
    515515  Variable y= Variable (2);
    516516  Variable x= Variable (1);
    517   CanonicalForm LCBuf= LC (F, x);
     517  CanonicalForm denom= den, denQuot;
     518  CanonicalForm LCBuf= LC (F, x)*denom;
    518519  CanonicalForm g, quot, buf= F;
    519520  int * v= new int [T.length()];
     
    598599          {
    599600            On (SW_RATIONAL);
     601            if (!Lc (g).inBaseDomain())
     602              g /= Lc (g);
    600603            g *= bCommonDen (g);
    601604            Off (SW_RATIONAL);
     
    605608          if (fdivides (g, buf, quot))
    606609          {
     610            denom *= abs (lc (g));
    607611            recombination= true;
    608612            result.append (g);
    609613            if (b.getp() != 0)
    610               buf= quot*bCommonDen (quot);
     614            {
     615              denQuot= bCommonDen (quot);
     616              buf= quot*denQuot;
     617              Off (SW_RATIONAL);
     618              denom /= gcd (denom, denQuot);
     619              On (SW_RATIONAL);
     620            }
    611621            else
    612622              buf= quot;
    613             LCBuf= LC (buf, x);
     623            LCBuf= LC (buf, x)*denom;
    614624            T= Difference (T, S);
    615625            l -= degree (g);
     
    726736                      factors, int& adaptedLiftBound, int*& factorsFoundIndex,
    727737                      DegreePattern& degs, bool& success, int deg,
    728                       const modpk& b)
     738                      const modpk& b, CanonicalForm& den)
    729739{
    730740  DegreePattern bufDegs1= degs;
     
    742752  if (b.getp() != 0)
    743753    buf *= bCommonDen (buf);
    744   CanonicalForm LCBuf= LC (buf, x);
     754  CanonicalForm LCBuf= LC (buf, x)*den;
    745755  CanonicalForm buf0= mulNTL (buf (0,x), LCBuf);
    746756  CanonicalForm buf1= mulNTL (buf (1,x), LCBuf);
     
    748758    Off (SW_RATIONAL);
    749759  CanonicalForm test0, test1;
     760  CanonicalForm denQuot;
    750761
    751762  for (CFListIterator i= factors; i.hasItem(); i++, l++)
     
    777788          {
    778789            On (SW_RATIONAL);
     790            if (!Lc (g).inBaseDomain())
     791              g /= Lc (g);
    779792            g *= bCommonDen (g);
    780793            Off (SW_RATIONAL);
     
    784797          if (fdivides (g, buf, quot))
    785798          {
     799            den *= abs (lc (g));
    786800            reconstructedFactors.append (g);
    787801            factorsFoundIndex[l]= 1;
    788802            if (b.getp() != 0)
    789               buf= quot*bCommonDen(quot);
     803            {
     804              denQuot= bCommonDen (quot);
     805              buf= quot*denQuot;
     806              Off (SW_RATIONAL);
     807              den /= gcd (den, denQuot);
     808              On (SW_RATIONAL);
     809            }
    790810            else
    791811              buf= quot;
    792812            d -= degree (g);
    793             LCBuf= LC (buf, x);
     813            LCBuf= LC (buf, x)*den;
    794814            buf0= mulNTL (buf (0,x), LCBuf);
    795815            buf1= mulNTL (buf (1,x), LCBuf);
     
    827847  if (bufDegs1.getLength() <= 1)
    828848    degs= bufDegs1;
     849}
     850
     851void
     852earlyFactorDetection (CFList& reconstructedFactors, CanonicalForm& F, CFList&
     853                      factors, int& adaptedLiftBound, int*& factorsFoundIndex,
     854                      DegreePattern& degs, bool& success, int deg,
     855                      const modpk& b)
     856{
     857  CanonicalForm den= 1;
     858  earlyFactorDetection (reconstructedFactors, F, factors, adaptedLiftBound, factorsFoundIndex, degs, success, deg,b, den);
    829859}
    830860
     
    10021032                    earlyFactors, DegreePattern& degs, int& liftBound,
    10031033                    const CFList& uniFactors, const ExtensionInfo& info,
    1004                     const CanonicalForm& eval, modpk& b)
     1034                    const CanonicalForm& eval,modpk& b, CanonicalForm& den)
    10051035{
    10061036  Variable alpha= info.getAlpha();
     
    10181048  CFList diophant;
    10191049  CFList bufUniFactors= uniFactors;
     1050  On (SW_RATIONAL);
    10201051  CanonicalForm bufA= A;
     1052  if (!Lc (A).inBaseDomain())
     1053  {
     1054    bufA /= Lc (A);
     1055    CanonicalForm denBufA= bCommonDen (bufA);
     1056    bufA *= denBufA;
     1057    Off (SW_RATIONAL);
     1058    den /= gcd (den, denBufA);
     1059  }
     1060  else
     1061  {
     1062    bufA= A;
     1063    Off (SW_RATIONAL);
     1064    den /= gcd (den, Lc (A));
     1065  }
    10211066  CanonicalForm lcA0= 0;
    10221067  bool mipoHasDen= false;
     
    10821127        earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    10831128                              factorsFoundIndex, degs, earlySuccess,
    1084                               smallFactorDeg, b);
     1129                              smallFactorDeg, b, den);
    10851130      else
    10861131        earlyFactorDetection(earlyFactors, bufA, bufBufUniFactors, newLiftBound,
    10871132                             factorsFoundIndex, degs, earlySuccess,
    1088                              smallFactorDeg, b);
     1133                             smallFactorDeg, b, den);
    10891134    }
    10901135    else
     
    11111156          earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    11121157                                factorsFoundIndex, degs, earlySuccess,
    1113                                 liftPre[sizeOfLiftPre-1] + 1, b);
     1158                                liftPre[sizeOfLiftPre-1] + 1, b, den);
    11141159          else
    11151160          earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound,
    11161161                                factorsFoundIndex, degs, earlySuccess,
    1117                                 liftPre[sizeOfLiftPre-1] + 1, b);
     1162                                liftPre[sizeOfLiftPre-1] + 1, b, den);
    11181163        }
    11191164        else
     
    11451190          earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    11461191                                factorsFoundIndex, degs, earlySuccess,
    1147                                 liftPre[i-1] + 1, b);
     1192                                liftPre[i-1] + 1, b, den);
    11481193          else
    11491194          earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound,
    11501195                                factorsFoundIndex, degs, earlySuccess,
    1151                                 liftPre[i-1] + 1, b);
     1196                                liftPre[i-1] + 1, b, den);
    11521197        }
    11531198        else
     
    11881233      earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    11891234                            factorsFoundIndex, degs, earlySuccess,
    1190                             smallFactorDeg, b);
     1235                            smallFactorDeg, b, den);
    11911236      else
    11921237      earlyFactorDetection (earlyFactors, bufA, bufBufUniFactors, newLiftBound,
    11931238                            factorsFoundIndex, degs, earlySuccess,
    1194                             smallFactorDeg, b);
     1239                            smallFactorDeg, b, den);
    11951240    }
    11961241    else
     
    12171262        if (v==alpha)
    12181263        earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    1219                               factorsFoundIndex, degs, earlySuccess, dummy, b);
     1264                              factorsFoundIndex, degs, earlySuccess, dummy, b,
     1265                              den);
    12201266        else
    12211267        earlyFactorDetection (earlyFactors, bufA,bufBufUniFactors, newLiftBound,
    1222                               factorsFoundIndex, degs, earlySuccess, dummy, b);
     1268                              factorsFoundIndex, degs, earlySuccess, dummy, b,
     1269                              den);
    12231270      }
    12241271      else
     
    12451292          if (v==alpha)
    12461293          earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound,
    1247                                 factorsFoundIndex, degs, earlySuccess, dummy,b);
     1294                                factorsFoundIndex, degs, earlySuccess, dummy,b,
     1295                                den);
    12481296          else
    12491297          earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound,
    1250                                 factorsFoundIndex, degs, earlySuccess, dummy,b);
     1298                                factorsFoundIndex, degs, earlySuccess, dummy,b,
     1299                                den);
    12511300        }
    12521301        else
     
    12871336{
    12881337  modpk dummy= modpk();
     1338  CanonicalForm den= 1;
    12891339  return henselLiftAndEarly (A, earlySuccess, earlyFactors, degs, liftBound,
    1290                              uniFactors, info, eval, dummy);
     1340                             uniFactors, info, eval, dummy, den);
    12911341}
    12921342
  • factory/facFqBivar.h

    r56f59b rf51a5b  
    585585CFList
    586586factorRecombination (
    587                 CFList& factors,       ///< [in,out] list of lifted factors
    588                                        ///< that are monic wrt Variable (1)
    589                 CanonicalForm& F,      ///< [in,out] poly to be factored
    590                 const CanonicalForm& M,///< [in] Variable (2)^liftBound
    591                 DegreePattern& degs,   ///< [in] degree pattern
    592                 int s,                 ///< [in] algorithm starts checking
    593                                        ///< subsets of size s
    594                 int thres,             ///< [in] threshold for the size of
    595                                        ///< subsets which are checked, for a
    596                                        ///< full factor recombination choose
    597                                        ///< thres= factors.length()/2
    598                 const modpk& b=modpk() ///< [in] coeff bound
     587            CFList& factors,            ///< [in,out] list of lifted factors
     588                                        ///< that are monic wrt Variable (1)
     589            CanonicalForm& F,           ///< [in,out] poly to be factored
     590            const CanonicalForm& M,     ///< [in] Variable (2)^liftBound
     591            DegreePattern& degs,        ///< [in] degree pattern
     592            int s,                      ///< [in] algorithm starts checking
     593                                        ///< subsets of size s
     594            int thres,                  ///< [in] threshold for the size of
     595                                        ///< subsets which are checked, for a
     596                                        ///< full factor recombination choose
     597                                        ///< thres= factors.length()/2
     598            const modpk& b=modpk(),     ///< [in] coeff bound
     599            const CanonicalForm& den= 1 ///< [in] bound on the den if over Q (a)
    599600                    );
    600601
     
    690691        const ExtensionInfo& info, ///< [in] information about extension
    691692        const CanonicalForm& eval, ///< [in] evaluation point
    692         modpk& b                   ///< [in] coeff bound
     693        modpk& b,                  ///< [in] coeff bound
     694        CanonicalForm& den         ///< [in] bound on the den if over Q(a)
    693695                  );
    694696
  • factory/int_int.h

    r56f59b rf51a5b  
    126126    friend void gmp_denominator ( const CanonicalForm & f, mpz_ptr result );
    127127    friend mpz_ptr getmpi ( InternalCF * value, bool symmetric );
     128    friend void getmpi ( InternalCF * value, mpz_t mpi);
    128129};
    129130
Note: See TracChangeset for help on using the changeset viewer.