Changeset 860d71 in git
- Timestamp:
- May 11, 2012, 3:10:11 PM (11 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 0d1984ff9810b1f329e5aea72c3390fe48bc5e63
- Parents:
- b0ca43c93260d239fb0b76a8aa762b1ea55d09a2845c26085348f7b5e0c6e14ec73d58120fe1aa80
- Files:
-
- 9 added
- 52 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
rb0ca43c r860d71 117 117 #ifdef HAVE_SPECTRUM 118 118 #include <kernel/spectrum.h> 119 #endif120 121 #ifdef HAVE_BIFAC122 #include <bifac.h>123 119 #endif 124 120 … … 3482 3478 } 3483 3479 else 3484 /*==================== bifac =================*/3485 #ifdef HAVE_BIFAC3486 if (strcmp(sys_cmd, "bifac")==0)3487 {3488 if (h->Typ()!=POLY_CMD)3489 {3490 WerrorS("`system(\"bifac\",<poly>) expected");3491 return TRUE;3492 }3493 if (!rField_is_Q(currRing))3494 {3495 WerrorS("coeff field must be Q");3496 return TRUE;3497 }3498 BIFAC B;3499 CFFList C;3500 int sw_rat=isOn(SW_RATIONAL);3501 On(SW_RATIONAL);3502 CanonicalForm F( convSingPClapP((poly)(h->Data()), currRing));3503 B.bifac(F, 1);3504 CFFList L=B.getFactors();3505 // construct the ring ==============================================3506 int i;3507 int lev=ExtensionLevel();3508 char **names=(char**)omAlloc0(lev*sizeof(char_ptr));3509 for(i=1;i<=lev; i++)3510 {3511 StringSetS("");3512 names[i-1]=omStrDup(StringAppend("a(%d)",i));3513 }3514 ring alg_ring=rDefault(0,lev,names);3515 ring new_ring=rCopy0(currRing); // all variable names, ordering etc.3516 new_ring->P=lev;3517 new_ring->parameter=names;3518 new_ring->extRing=alg_ring;3519 new_ring->ch=1; // WTF!!??? :(3520 rComplete(new_ring,TRUE);3521 // set the mipo ===============================================3522 ring save_currRing=currRing; idhdl save_currRingHdl=currRingHdl;3523 rChangeCurrRing(alg_ring);3524 ideal mipo_id=idInit(lev,1);3525 for (i=lev; i>0;i--)3526 {3527 CanonicalForm Mipo=getMipo(Variable(-i),Variable(i));3528 mipo_id->m[i-1]=convClapPSingP(Mipo);3529 }3530 idShow(mipo_id);3531 alg_ring->qideal=mipo_id;3532 rChangeCurrRing(new_ring);3533 for (i=lev-1; i>=0;i--)3534 {3535 poly p=pOne();3536 lnumber n=(lnumber)pGetCoeff(p);3537 // no need to delete nac 13538 n->z=(napoly)mipo_id->m[i];3539 mipo_id->m[i]=p;3540 }3541 new_ring->qideal=id_Copy(alg_ring->qideal,new_ring);3542 // convert factors =============================================3543 ideal fac_id=idInit(L.length(),1);3544 CFFListIterator J=L;3545 i=0;3546 intvec *v = new intvec( L.length() );3547 for ( ; J.hasItem(); J++,i++ )3548 {3549 fac_id->m[i]=convClapAPSingAP( J.getItem().factor() );3550 (*v)[i]=J.getItem().exp();3551 }3552 idhdl hh=enterid("factors",0,LIST_CMD,&(currRing->idroot),FALSE);3553 lists LL=(lists)omAllocBin( slists_bin);3554 LL->Init(2);3555 LL->m[0].rtyp=IDEAL_CMD;3556 LL->m[0].data=(char *)fac_id;3557 LL->m[1].rtyp=INTVEC_CMD;3558 LL->m[1].data=(char *)v;3559 IDDATA(hh)=(char *)LL;3560 3561 rChangeCurrRing(save_currRing);3562 currRingHdl=save_currRingHdl;3563 if (!sw_rat) Off(SW_RATIONAL);3564 3565 res->data=new_ring;3566 res->rtyp=RING_CMD;3567 return FALSE;3568 }3569 else3570 #endif3571 3480 /*==================== gcd-varianten =================*/ 3572 3481 #ifdef HAVE_FACTORY … … 3581 3490 Print("EZGCD_P:%d (use EZGCD_P for gcd of polynomials in char p)\n",isOn(SW_USE_EZGCD_P)); 3582 3491 Print("CRGCD:%d (use chinese Remainder for gcd of polynomials in char 0)\n",isOn(SW_USE_CHINREM_GCD)); 3583 Print("SPARSEMOD:%d (use SPARSEMOD for gcd of polynomials in char 0)\n",isOn(SW_USE_SPARSEMOD));3584 3492 Print("QGCD:%d (use QGCD for gcd of polynomials in alg. ext.)\n",isOn(SW_USE_QGCD)); 3585 Print("FGCD:%d (use fieldGCD for gcd of polynomials in Z/p)\n",isOn(SW_USE_fieldGCD));3586 3493 #endif 3587 3494 Print("homog:%d (use homog. test for factorization of polynomials)\n",singular_homog_flag); … … 3600 3507 if (strcmp(s,"EZGCD_P")==0) { if (d) On(SW_USE_EZGCD_P); else Off(SW_USE_EZGCD_P); } else 3601 3508 if (strcmp(s,"CRGCD")==0) { if (d) On(SW_USE_CHINREM_GCD); else Off(SW_USE_CHINREM_GCD); } else 3602 if (strcmp(s,"SPARSEMOD")==0) { if (d) On(SW_USE_SPARSEMOD); else Off(SW_USE_SPARSEMOD); } else3603 3509 if (strcmp(s,"QGCD")==0) { if (d) On(SW_USE_QGCD); else Off(SW_USE_QGCD); } else 3604 if (strcmp(s,"FGCD")==0) { if (d) On(SW_USE_fieldGCD); else Off(SW_USE_fieldGCD); } else3605 3510 #endif 3606 3511 if (strcmp(s,"homog")==0) { if (d) singular_homog_flag=1; else singular_homog_flag=0; } else -
Singular/misc_ip.cc
rb0ca43c r860d71 1090 1090 On(SW_USE_CHINREM_GCD); 1091 1091 //On(SW_USE_FF_MOD_GCD); 1092 //On(SW_USE_fieldGCD);1093 1092 On(SW_USE_EZGCD_P); 1094 1093 On(SW_USE_QGCD); -
Tst/Long/ok_l.lst
rb0ca43c r860d71 22 22 gcd0_l 23 23 gcdp_l 24 gcd_univar_p_create 24 25 groebner_l 25 26 hnoether_l -
Tst/Short/ok_s.lst
rb0ca43c r860d71 156 156 gcd5test 157 157 gcdp_s 158 gcd_univar_p_s 159 gcd_univar_p_alpha_s 158 160 gerhard_1_32003_lp 159 161 Gonnet-83_32003_dp_slim -
factory/Makefile.am
rb0ca43c r860d71 78 78 facMul.cc \ 79 79 facSparseHensel.cc \ 80 fieldGCD.cc \81 80 ffops.cc \ 82 81 FLINTconvert.cc \ … … 90 89 int_pp.cc \ 91 90 int_rat.cc \ 92 sm_sparsemod.cc \93 sm_util.cc \94 91 variable.cc \ 95 92 NTLconvert.cc \ 96 abs_fac.cc \97 bifac.cc \98 lgs.cc \99 93 singext.cc \ 100 94 parseutil.cc \ … … 163 157 facMul.h \ 164 158 facSparseHensel.h \ 165 fieldGCD.h \166 159 ffops.h \ 167 160 FLINTconvert.h \ … … 175 168 int_pp.h \ 176 169 int_rat.h \ 177 sm_sparsemod.h \178 sm_util.h \179 170 timing.h \ 180 171 variable.h \ 181 172 NTLconvert.h \ 182 bifac.h \183 bifacConfig.h \184 lgs.h \185 173 algext.h \ 186 174 singext.h \ … … 261 249 factory.template 262 250 263 # FTE source files264 ftestsrc = ftest/ftest_io.cc \265 ftest/ftest_util.cc \266 ftest/ntl_util.cc267 268 # FTE header files269 ftestincl = ftest/ftest_io.h \270 ftest/ftest_util.h \271 ftest/ntl_util.h272 273 ftestm4src = ftest/commonden.m4 \274 ftest/degree.m4 \275 ftest/deriv.m4 \276 ftest/divides.m4 \277 ftest/divrem.m4 \278 ftest/extgcd.m4 \279 ftest/factorize.m4 \280 ftest/fbinops.m4 \281 ftest/feval.m4 \282 ftest/gcd.m4 \283 ftest/gcd.ntl.m4 \284 ftest/insert.m4 \285 ftest/norm.m4 \286 ftest/resultant.m4 \287 ftest/revert.m4 \288 ftest/sqrfree.m4 \289 ftest/size.m4 \290 ftest/totaldegree.m4291 292 ftestdistfiles = \293 ftest/ftest_util.m4294 295 251 EXTRA_DIST = test_install.cc \ 296 252 $(templatesrc) $(hdrtemplsrc) \ 297 $(ftestsrc) $(ftestincl) $(ftestm4src) $(ftestdistfiles) \298 253 doxygen.cfg factory.cfg \ 299 254 examples/application.cc \ -
factory/algext.cc
rb0ca43c r860d71 23 23 #include "cf_algorithm.h" 24 24 #include "algext.h" 25 #include "fieldGCD.h"26 25 #include "cf_map.h" 27 26 #include "cf_generator.h" -
factory/cf_chinese.cc
rb0ca43c r860d71 6 6 // cf_chinese.cc - algorithms for chinese remaindering. 7 7 // 8 // Used by: cf_gcd.cc, cf_linsys.cc , sm_util.cc8 // Used by: cf_gcd.cc, cf_linsys.cc 9 9 // 10 10 // Header file: cf_algorithm.h -
factory/cf_defs.h
rb0ca43c r860d71 28 28 //}}} 29 29 const int SW_RATIONAL = 0; 30 const int SW_QUOTIENT = 1; 31 const int SW_SYMMETRIC_FF = 2; 32 const int SW_BERLEKAMP = 3; 33 const int SW_FAC_USE_BIG_PRIMES = 4; 34 const int SW_FAC_QUADRATICLIFT = 5; 35 const int SW_USE_EZGCD = 6; 36 const int SW_USE_EZGCD_P = 7; 37 const int SW_USE_SPARSEMOD = 8; 38 const int SW_USE_NTL=9; 39 const int SW_USE_NTL_GCD_0=10; 40 const int SW_USE_NTL_GCD_P=11; 41 const int SW_USE_NTL_SORT=12; 42 const int SW_USE_CHINREM_GCD=13; 43 const int SW_USE_QGCD=14; 44 const int SW_USE_fieldGCD=15; 45 const int SW_USE_FF_MOD_GCD=16; 30 const int SW_SYMMETRIC_FF = 1; 31 const int SW_BERLEKAMP = 2; 32 const int SW_FAC_QUADRATICLIFT = 3; 33 const int SW_USE_EZGCD = 4; 34 const int SW_USE_EZGCD_P = 5; 35 const int SW_USE_NTL=6; 36 const int SW_USE_NTL_GCD_0=7; 37 const int SW_USE_NTL_GCD_P=8; 38 const int SW_USE_NTL_SORT=9; 39 const int SW_USE_CHINREM_GCD=10; 40 const int SW_USE_QGCD=11; 41 const int SW_USE_FF_MOD_GCD=12; 46 42 //}}} 47 43 -
factory/cf_gcd.cc
rb0ca43c r860d71 17 17 #include "templates/ftmpl_functions.h" 18 18 #include "algext.h" 19 #include "fieldGCD.h"20 19 #include "cf_gcd_smallp.h" 21 20 #include "cf_map_ext.h" … … 688 687 // This is the dispatcher for polynomial gcd calculation. We call either 689 688 // ezgcd(), sparsemod() or gcd_poly1() in dependecy on the current 690 // characteristic and settings of SW_USE_EZGCD and SW_USE_SPARSEMOD, resp.689 // characteristic and settings of SW_USE_EZGCD. 691 690 // 692 691 // Used by gcd() and gcd_poly_univar0(). … … 724 723 if ( getCharacteristic() != 0 ) 725 724 { 726 if ((!fc_and_gc_Univariate)727 && isOn(SW_USE_fieldGCD)728 && (getCharacteristic() >100))729 {730 return fieldGCD(f,g);731 }732 725 #ifdef HAVE_NTL 733 elseif ((!fc_and_gc_Univariate) && (isOn( SW_USE_EZGCD_P )))726 if ((!fc_and_gc_Univariate) && (isOn( SW_USE_EZGCD_P ))) 734 727 { 735 728 fc= EZGCD_P (fc, gc); -
factory/cf_gcd_smallp.cc
rb0ca43c r860d71 41 41 42 42 #ifdef HAVE_NTL 43 #include <NTL/ZZ_pEX.h>44 43 #include <NTLconvert.h> 45 44 #endif … … 435 434 { 436 435 int p= getCharacteristic(); 437 ZZ NTLp= to_ZZ (p); 438 ZZ_p::init (NTLp); 439 ZZ_pX NTLirredpoly; 436 zz_p::init (p); 437 zz_pX NTLirredpoly; 440 438 //TODO: replace d by max_{i} (deg_x{i}(f)) 441 439 int i= (int) (log ((double) ipower (d + 1, num_vars))/log ((double) p)); … … 444 442 i= 2; 445 443 BuildIrred (NTLirredpoly, i*m); 446 CanonicalForm mipo= convertNTL ZZpX2CF (NTLirredpoly, Variable(1));444 CanonicalForm mipo= convertNTLzzpX2CF (NTLirredpoly, Variable(1)); 447 445 beta= rootOf (mipo); 448 446 } … … 1335 1333 { 1336 1334 int p= getCharacteristic(); 1337 ZZ NTLp= to_ZZ (p); 1338 ZZ_p::init (NTLp); 1339 ZZ_pX NTLirredpoly; 1335 zz_p::init (p); 1336 zz_pX NTLirredpoly; 1340 1337 CanonicalForm CFirredpoly; 1341 1338 BuildIrred (NTLirredpoly, i + 1); 1342 CFirredpoly= convertNTL ZZpX2CF (NTLirredpoly, x);1339 CFirredpoly= convertNTLzzpX2CF (NTLirredpoly, x); 1343 1340 return CFirredpoly; 1344 1341 } -
factory/cf_map.cc
rb0ca43c r860d71 6 6 // cf_map.cc - definition of class CFMap. 7 7 // 8 // Used by: cf_gcd.cc, fac_multivar.cc , sm_sparsemod.cc8 // Used by: cf_gcd.cc, fac_multivar.cc 9 9 // 10 10 //}}} -
factory/cf_map_ext.cc
rb0ca43c r860d71 28 28 29 29 #ifdef HAVE_NTL 30 #include <NTL/ZZ_pEXFactoring.h>31 30 #include "NTLconvert.h" 32 31 #endif -
factory/cf_switches.cc
rb0ca43c r860d71 38 38 //On(SW_USE_EZGCD_P); // still testing 39 39 On(SW_USE_QGCD); 40 //On(SW_USE_fieldGCD);41 40 } 42 41 //}}} -
factory/cf_switches.h
rb0ca43c r860d71 19 19 // 20 20 //}}} 21 const int CFSwitchesMax = 1 7;21 const int CFSwitchesMax = 13; 22 22 //}}} 23 23 -
factory/facFqBivar.cc
rb0ca43c r860d71 154 154 "univariate polynomial expected or constant expected"); 155 155 CFFList factorsA; 156 ZZ p= to_ZZ (getCharacteristic()); 157 ZZ_p::init (p); 156 zz_p::init (getCharacteristic()); 158 157 if (GF) 159 158 { … … 166 165 if (getCharacteristic() > 2) 167 166 { 168 ZZ_pX NTLMipo= convertFacCF2NTLZZpX (mipo.mapinto());169 ZZ_pE::init (NTLMipo);170 ZZ_pEX NTLA= convertFacCF2NTLZZ_pEX (buf, NTLMipo);167 zz_pX NTLMipo= convertFacCF2NTLzzpX (mipo.mapinto()); 168 zz_pE::init (NTLMipo); 169 zz_pEX NTLA= convertFacCF2NTLzz_pEX (buf, NTLMipo); 171 170 MakeMonic (NTLA); 172 vec_pair_ ZZ_pEX_long NTLFactorsA= CanZass (NTLA);173 ZZ_pE multi= to_ZZ_pE (1);174 factorsA= convertNTLvec_pair_ ZZpEX_long2FacCFFList (NTLFactorsA, multi,171 vec_pair_zz_pEX_long NTLFactorsA= CanZass (NTLA); 172 zz_pE multi= to_zz_pE (1); 173 factorsA= convertNTLvec_pair_zzpEX_long2FacCFFList (NTLFactorsA, multi, 175 174 x, beta); 176 175 } … … 198 197 if (getCharacteristic() > 2) 199 198 { 200 ZZ_pX NTLMipo= convertFacCF2NTLZZpX (getMipo (alpha));201 ZZ_pE::init (NTLMipo);202 ZZ_pEX NTLA= convertFacCF2NTLZZ_pEX (A, NTLMipo);199 zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo (alpha)); 200 zz_pE::init (NTLMipo); 201 zz_pEX NTLA= convertFacCF2NTLzz_pEX (A, NTLMipo); 203 202 MakeMonic (NTLA); 204 vec_pair_ ZZ_pEX_long NTLFactorsA= CanZass (NTLA);205 ZZ_pE multi= to_ZZ_pE (1);206 factorsA= convertNTLvec_pair_ ZZpEX_long2FacCFFList (NTLFactorsA, multi,203 vec_pair_zz_pEX_long NTLFactorsA= CanZass (NTLA); 204 zz_pE multi= to_zz_pE (1); 205 factorsA= convertNTLvec_pair_zzpEX_long2FacCFFList (NTLFactorsA, multi, 207 206 x, alpha); 208 207 } … … 235 234 if (getCharacteristic() > 2) 236 235 { 237 ZZ_pX NTLA= convertFacCF2NTLZZpX (A);236 zz_pX NTLA= convertFacCF2NTLzzpX (A); 238 237 MakeMonic (NTLA); 239 vec_pair_ ZZ_pX_long NTLFactorsA= CanZass (NTLA);240 ZZ_p multi= to_ZZ_p (1);241 factorsA= convertNTLvec_pair_ ZZpX_long2FacCFFList (NTLFactorsA, multi,238 vec_pair_zz_pX_long NTLFactorsA= CanZass (NTLA); 239 zz_p multi= to_zz_p (1); 240 factorsA= convertNTLvec_pair_zzpX_long2FacCFFList (NTLFactorsA, multi, 242 241 x); 243 242 } -
factory/facFqFactorize.cc
rb0ca43c r860d71 35 35 36 36 #ifdef HAVE_NTL 37 #include <NTL/ZZ_pEX.h>38 37 #include "NTLconvert.h" 39 38 -
factory/fac_ezgcd.cc
rb0ca43c r860d71 25 25 #include "cf_random.h" 26 26 #include "cf_primes.h" 27 #include "fac_distrib.h"28 27 #include "templates/ftmpl_functions.h" 29 28 #include "cf_map.h" -
factory/factory.template
rb0ca43c r860d71 106 106 #include "facIrredTest.h" 107 107 108 #ifdef HAVE_BIFAC109 /*MAKEHEADER PUBLIC ONLY*/110 #include "bifac.h"111 #endif /* HAVE_BIFAC */112 113 108 #endif /* ! INCL_FACTORY_H */ -
libpolys/polys/clapsing.cc
rb0ca43c r860d71 78 78 { 79 79 bool b1=isOn(SW_USE_QGCD); 80 bool b2=isOn(SW_USE_fieldGCD);81 80 if ( rField_is_Q_a(r) ) On(SW_USE_QGCD); 82 else On(SW_USE_fieldGCD);83 81 CanonicalForm mipo=convSingPFactoryP(r->cf->extRing->qideal->m[0], 84 82 r->cf->extRing); … … 88 86 res= convFactoryAPSingAP( gcd( F, G ),r ); 89 87 if (!b1) Off(SW_USE_QGCD); 90 if (!b2) Off(SW_USE_fieldGCD);91 88 } 92 89 else
Note: See TracChangeset
for help on using the changeset viewer.