Changeset 7eb7b5 in git
 Timestamp:
 Jan 17, 2011, 7:20:24 PM (13 years ago)
 Branches:
 (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
 Children:
 1389a4dfb4e7b64fff56b85086d65dd004f4abbd
 Parents:
 dd012ca0a6f4728f90e73a6a9081c7310c1cc509
 gitauthor:
 Hans Schoenemann <hannes@mathematik.unikl.de>20110117 19:20:24+01:00
 gitcommitter:
 Mohamed Barakat <mohamed.barakat@rwthaachen.de>20111109 11:59:25+01:00
 Location:
 libpolys/polys
 Files:

 1 added
 4 edited
Legend:
 Unmodified
 Added
 Removed

libpolys/polys/Makefile.am
rdd012ca r7eb7b5 25 25 templates/p_Procs_Dynamic.h templates/p_Procs_Impl.h templates/p_Procs_Set.h templates/p_Procs_Static.h \ 26 26 monomials/p_polys.h monomials/polysimpl.h polys.h prCopy.h prCopyMacros.h \ 27 sbuckets.h 27 sbuckets.h simpleideals.h 28 28 29 29 lib_LIBRARIES=libpolys.a libpolys_g.a 
libpolys/polys/monomials/p_polys.cc
rdd012ca r7eb7b5 18 18 #include <polys/monomials/ring.h> 19 19 #include <coeffs/longrat.h> 20 #include <misc/options.h> 20 21 // #include <???/ideals.h> 21 22 // #include <???/int64vec.h> … … 1597 1598 poly tail, b, res, h; 1598 1599 number x; 1599 number *bin = pnBin(exp );1600 number *bin = pnBin(exp,r); 1600 1601 1601 1602 tail = pNext(p); … … 2071 2072 number d=pGetCoeff(ph); 2072 2073 int s=naParDeg(d); 2073 if (s /* naParDeg(d)*/ <=1) return n aCopy(d);2074 if (s /* naParDeg(d)*/ <=1) return n_Copy(d,r>cf); 2074 2075 int s2=1; 2075 2076 number d2; … … 2909 2910 } 2910 2911 } 2911 p Test(aq);2912 p_Test(aq,dst); 2912 2913 } 2913 2914 if (rRing_has_Comp(dst)) p_SetComp(qq, p_GetComp(p,oldRing),dst); … … 2950 2951 { 2951 2952 lnumber mmc=(lnumber)naInit(1,dst); 2952 napSetExp(mmc>z,perm[i],e/*p_GetExp( p,i,oldRing)*/);2953 napSetm(mmc>z);2953 p_SetExp(mmc>z,perm[i],e/*p_GetExp( p,i,oldRing)*/,dst>algring); 2954 p_Setm(mmc>z,dst>algring>cf); 2954 2955 pGetCoeff(qq)=naMult((number)c,(number)mmc); 2955 2956 n_Delete((number *)&c,dst>cf); 
libpolys/polys/monomials/ring.cc
rdd012ca r7eb7b5 16 16 #include <polys/monomials/ring.h> 17 17 #include <polys/monomials/p_polys.h> 18 #include <polys/simpleideals.h> 18 19 #include <coeffs/numbers.h> 19 20 // #include <???/febase.h> … … 215 216 } 216 217 217 // set R>order, R>block, R>wvhdl, r>OrdSgn from sleftv218 BOOLEAN rSleftvOrdering2Ordering(sleftv *ord, ring R);219 220 // get array of strings from list of sleftv's221 BOOLEAN rSleftvList2StringArray(sleftv* sl, char** p);222 223 224 218 /*2 225 219 * set a new ring from the data: … … 454 448 #endif 455 449 456 nKillChar(r );450 nKillChar(r>cf); 457 451 rUnComplete(r); 458 452 // delete order stuff … … 825 819 rChangeCurrRing(r1); 826 820 if ((!vartest  (strcmp(r1>parameter[0],r2>parameter[0])==0)) /* 1 par */ 827 && n_Equal(r1>minpoly,r2>minpoly, r1 ))821 && n_Equal(r1>minpoly,r2>minpoly, r1>cf)) 828 822 { 829 823 tmpR.parameter=(char **)omAllocBin(char *); 830 824 tmpR.parameter[0]=omStrDup(r1>parameter[0]); 831 tmpR.minpoly=n_Copy(r1>minpoly, r1 );825 tmpR.minpoly=n_Copy(r1>minpoly, r1>cf); 832 826 tmpR.P=1; 833 827 // HANNES: TODO: delete nSetChar … … 848 842 tmpR.parameter[0]=omStrDup(r1>parameter[0]); 849 843 tmpR.P=1; 850 tmpR.minpoly=n_Copy(r1>minpoly, r1 );844 tmpR.minpoly=n_Copy(r1>minpoly, r1>cf); 851 845 } 852 846 else … … 867 861 tmpR.parameter[0]=omStrDup(r1>parameter[0]); 868 862 tmpR.P=1; 869 tmpR.minpoly=n_Copy(r2>minpoly, r2 );863 tmpR.minpoly=n_Copy(r2>minpoly, r2>cf); 870 864 } 871 865 else … … 961 955 if (r1>minpoly!=NULL) 962 956 { 963 tmpR.minpoly=n_Copy(r1>minpoly, r1 );957 tmpR.minpoly=n_Copy(r1>minpoly, r1>cf); 964 958 } 965 959 } … … 989 983 if (r2>minpoly!=NULL) 990 984 { 991 tmpR.minpoly=n_Copy(r2>minpoly, r2 );985 tmpR.minpoly=n_Copy(r2>minpoly, r2>cf); 992 986 } 993 987 } … … 1022 1016 if (r1>minpoly!=NULL) 1023 1017 { 1024 tmpR.minpoly=n_Copy(r1>minpoly, r1 );1018 tmpR.minpoly=n_Copy(r1>minpoly, r1>cf); 1025 1019 } 1026 1020 } … … 1049 1043 if (r2>minpoly!=NULL) 1050 1044 { 1051 tmpR.minpoly=n_Copy(r2>minpoly, r2 );1045 tmpR.minpoly=n_Copy(r2>minpoly, r2>cf); 1052 1046 } 1053 1047 } … … 4352 4346 // had already this property 4353 4347 // 4354 // Without argument, these functions work on currRing and change it, 4355 // if necessary 4356 4357 // for the time being, this is still here 4358 static ring rAssure_SyzComp(const ring r, BOOLEAN complete = TRUE); 4359 4360 ring rCurrRingAssure_SyzComp() 4361 { 4362 ring r = rAssure_SyzComp(currRing, TRUE); 4363 4364 if( r != currRing ) 4365 { 4366 rChangeCurrRing(r); 4367 assume(currRing == r); 4368 } 4369 4370 return r; 4371 } 4372 4373 static ring rAssure_SyzComp(const ring r, BOOLEAN complete) 4348 ring rAssure_SyzComp(const ring r, BOOLEAN complete) 4374 4349 { 4375 4350 if ( (r>order[0] == ringorder_s) ) return r; … … 4545 4520 } 4546 4521 4547 ring rAssure_HasComp( ring r)4522 ring rAssure_HasComp(const ring r) 4548 4523 { 4549 4524 int last_block; … … 4654 4629 } 4655 4630 4656 ring rCurrRingAssure_CompLastBlock() 4657 { 4658 ring new_r = rAssure_CompLastBlock(currRing); 4659 if (currRing != new_r) 4660 { 4661 ring old_r = currRing; 4631 // Moves _c or _C ordering to the last place AND adds _s on the 1st place 4632 ring rAssure_SyzComp_CompLastBlock(const ring r) 4633 { 4634 ring new_r_1 = rAssure_CompLastBlock(r, FALSE); // due to this FALSE  no completion! 4635 ring new_r = rAssure_SyzComp(new_r_1, FALSE); // new_r_1 is used only here!!! 4636 4637 if (new_r != r) 4638 { 4639 ring old_r = r; 4640 if (new_r_1 != new_r && new_r_1 != old_r) rDelete(new_r_1); 4641 rComplete(new_r, 1); 4642 #ifdef HAVE_PLURAL 4643 if (rIsPluralRing(old_r)) 4644 { 4645 if ( nc_rComplete(old_r, new_r, false) ) // no qideal! 4646 { 4647 #ifndef NDEBUG 4648 WarnS("error in nc_rComplete"); // cleanup? rDelete(res); return r; // just go on...? 4649 #endif 4650 } 4651 } 4652 assume(rIsPluralRing(new_r) == rIsPluralRing(old_r)); 4653 #endif 4662 4654 rChangeCurrRing(new_r); 4663 4655 if (old_r>qideal != NULL) 4664 4656 { 4665 new_r>qideal = idrCopyR(old_r>qideal, old_r); 4666 currQuotient = new_r>qideal; 4657 new_r>qideal = idrCopyR(old_r>qideal, old_r, new_r); 4658 //currQuotient = new_r>qideal; 4659 4667 4660 #ifdef HAVE_PLURAL 4668 if( rIsPluralRing( new_r) )4661 if( rIsPluralRing(old_r) ) 4669 4662 if( nc_SetupQuotient(new_r, old_r, true) ) 4670 4663 { … … 4689 4682 } 4690 4683 4691 // Moves _c or _C ordering to the last place AND adds _s on the 1st place4692 ring rCurrRingAssure_SyzComp_CompLastBlock()4693 {4694 ring new_r_1 = rAssure_CompLastBlock(currRing, FALSE); // due to this FALSE  no completion!4695 ring new_r = rAssure_SyzComp(new_r_1, FALSE); // new_r_1 is used only here!!!4696 4697 if (new_r != currRing)4698 {4699 ring old_r = currRing;4700 if (new_r_1 != new_r && new_r_1 != old_r) rDelete(new_r_1);4701 rComplete(new_r, 1);4702 #ifdef HAVE_PLURAL4703 if (rIsPluralRing(old_r))4704 {4705 if ( nc_rComplete(old_r, new_r, false) ) // no qideal!4706 {4707 #ifndef NDEBUG4708 WarnS("error in nc_rComplete"); // cleanup? rDelete(res); return r; // just go on...?4709 #endif4710 }4711 }4712 assume(rIsPluralRing(new_r) == rIsPluralRing(old_r));4713 #endif4714 rChangeCurrRing(new_r);4715 if (old_r>qideal != NULL)4716 {4717 new_r>qideal = idrCopyR(old_r>qideal, old_r, new_r);4718 currQuotient = new_r>qideal;4719 4720 #ifdef HAVE_PLURAL4721 if( rIsPluralRing(old_r) )4722 if( nc_SetupQuotient(new_r, old_r, true) )4723 {4724 #ifndef NDEBUG4725 WarnS("error in nc_SetupQuotient"); // cleanup? rDelete(res); return r; // just go on...?4726 #endif4727 }4728 #endif4729 }4730 4731 #ifdef HAVE_PLURAL4732 assume((new_r>qideal==NULL) == (old_r>qideal==NULL));4733 assume(rIsPluralRing(new_r) == rIsPluralRing(old_r));4734 assume(rIsSCA(new_r) == rIsSCA(old_r));4735 assume(ncRingType(new_r) == ncRingType(old_r));4736 #endif4737 4738 rTest(new_r);4739 rTest(old_r);4740 }4741 return new_r;4742 }4743 4744 4684 // use this for global orderings consisting of two blocks 4745 static ring r CurrRingAssure_Global(rRingOrder_t b1, rRingOrder_t b2)4746 { 4747 int r_blocks = rBlocks( currRing);4685 static ring rAssure_Global(rRingOrder_t b1, rRingOrder_t b2, const ring r) 4686 { 4687 int r_blocks = rBlocks(r); 4748 4688 4749 4689 assume(b1 == ringorder_c  b1 == ringorder_C  … … 4751 4691 b2 == ringorder_S); 4752 4692 if ((r_blocks == 3) && 4753 ( currRing>order[0] == b1) &&4754 ( currRing>order[1] == b2) &&4755 ( currRing>order[2] == 0))4756 return currRing;4757 ring res = rCopy0( currRing, TRUE, FALSE);4693 (r>order[0] == b1) && 4694 (r>order[1] == b2) && 4695 (r>order[2] == 0)) 4696 return r; 4697 ring res = rCopy0(r, TRUE, FALSE); 4758 4698 res>order = (int*)omAlloc0(3*sizeof(int)); 4759 4699 res>block0 = (int*)omAlloc0(3*sizeof(int)); … … 4765 4705 { 4766 4706 res>block0[1] = 1; 4767 res>block1[1] = currRing>N;4707 res>block1[1] = r>N; 4768 4708 } 4769 4709 else 4770 4710 { 4771 4711 res>block0[0] = 1; 4772 res>block1[0] = currRing>N;4712 res>block1[0] = r>N; 4773 4713 } 4774 4714 // HANNES: This sould be set in rComplete … … 4776 4716 rComplete(res, 1); 4777 4717 #ifdef HAVE_PLURAL 4778 if (rIsPluralRing( currRing))4779 { 4780 if ( nc_rComplete( currRing, res, false) ) // no qideal!4718 if (rIsPluralRing(r)) 4719 { 4720 if ( nc_rComplete(r, res, false) ) // no qideal! 4781 4721 { 4782 4722 #ifndef NDEBUG … … 4901 4841 } 4902 4842 4903 ring r CurrRingAssure_dp_S()4904 { 4905 return r CurrRingAssure_Global(ringorder_dp, ringorder_S);4906 } 4907 4908 ring r CurrRingAssure_dp_C()4909 { 4910 return r CurrRingAssure_Global(ringorder_dp, ringorder_C);4911 } 4912 4913 ring r CurrRingAssure_C_dp()4914 { 4915 return r CurrRingAssure_Global(ringorder_C, ringorder_dp);4843 ring rAssure_dp_S(const ring r) 4844 { 4845 return rAssure_Global(ringorder_dp, ringorder_S,r); 4846 } 4847 4848 ring rAssure_dp_C(const ring r) 4849 { 4850 return rAssure_Global(ringorder_dp, ringorder_C,r); 4851 } 4852 4853 ring rAssure_C_dp(const ring r) 4854 { 4855 return rAssure_Global(ringorder_C, ringorder_dp,r); 4916 4856 } 4917 4857 … … 5612 5552 for (int j = i + 1; j <= N; j++) 5613 5553 { 5614 const number n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), srcBase), srcBase ); // src, mapping for coeffs into currRing = dest!5554 const number n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), srcBase), srcBase>cf); // src, mapping for coeffs into currRing = dest! 5615 5555 const poly p = p_NSet(n, dest); 5616 5556 MATELEM(C,i,j) = p; 
libpolys/polys/monomials/ring.h
rdd012ca r7eb7b5 565 565 566 566 // Ring Manipulations 567 ring rAssure_HasComp( ring r);568 ring r CurrRingAssure_SyzComp();567 ring rAssure_HasComp(const ring r); 568 ring rAssure_SyzComp(const ring r, BOOLEAN complete = TRUE); 569 569 void rSetSyzComp(int k, const ring r); 570 ring rCurrRingAssure_dp_S(); 571 ring rCurrRingAssure_dp_C(); 572 ring rCurrRingAssure_C_dp(); 573 570 ring rAssure_dp_S(const ring r); 571 ring rAssure_dp_C(const ring r); 572 ring rAssure_C_dp(const ring r); 574 573 /// makes sure that c/C ordering is last ordering 575 ring rCurrRingAssure_CompLastBlock();574 ring rAssure_CompLastBlock(const ring r); 576 575 577 576 /// makes sure that c/C ordering is last ordering and SyzIndex is first 578 ring r CurrRingAssure_SyzComp_CompLastBlock();577 ring rAssure_SyzComp_CompLastBlock(const ring r); 579 578 ring rAssure_TDeg(ring r, int start_var, int end_var, int &pos); 580 579
Note: See TracChangeset
for help on using the changeset viewer.