Changeset cae954 in git
- Timestamp:
- Feb 24, 2006, 1:57:38 PM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- cb1f9b76e8a13445d296089700e56745f63ef5bd
- Parents:
- bdabc89c64ddfdf9785490a67e7aef5a1656f7a4
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/tgb.cc
rbdabc8 rcae954 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb.cc,v 1.7 5 2006-02-24 11:53:50bricken Exp $ */7 /* $Id: tgb.cc,v 1.76 2006-02-24 12:57:38 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: slimgb and F4 implementation … … 1018 1018 1019 1019 } 1020 sorted_pair_node** add_to_basis_ideal_quotient(poly h, int i_pos, int j_pos,slimgb_alg* c, int* ip , BOOLEAN new_pairs)1020 sorted_pair_node** add_to_basis_ideal_quotient(poly h, int i_pos, int j_pos,slimgb_alg* c, int* ip) 1021 1021 { 1022 1022 … … 1115 1115 1116 1116 #undef ENLARGE 1117 1118 1117 for (j=0;j<i;j++){ 1119 1118 … … 1122 1121 c->states[i][j]=UNCALCULATED; 1123 1122 #endif 1124 if (!new_pairs) continue;1125 1123 assume(p_LmDivisibleBy(c->S->m[i],c->S->m[j],c->r)== 1126 1124 p_LmShortDivisibleBy(c->S->m[i],c->short_Exps[i],c->S->m[j],~(c->short_Exps[j]),c->r)); … … 1134 1132 if ((!c->nc) && (c->lengths[i]==1) && (c->lengths[j]==1)){ 1135 1133 c->states[i][j]=HASTREP; 1136 //continue;1134 1137 1135 } 1138 1136 else if ((!(c->nc)) && (pHasNotCF(c->S->m[i],c->S->m[j]))) … … 1140 1138 c->easy_product_crit++; 1141 1139 c->states[i][j]=HASTREP; 1142 1143 //continue; 1140 continue; 1144 1141 } 1145 1142 else if(extended_product_criterion(c->S->m[i],c->gcd_of_terms[i],c->S->m[j],c->gcd_of_terms[j],c)) … … 1151 1148 } 1152 1149 // if (c->states[i][j]==UNCALCULATED){ 1153 1150 1154 1151 if ((TEST_V_FINDMONOM) &&(!c->nc)) { 1155 1152 //PrintS("COMMU"); … … 1163 1160 // } 1164 1161 // } 1165 if ( (c->lengths[i]+c->lengths[j]==3) &&( (pHasNotCF(c->S->m[i],c->S->m[j])))){1162 if (c->lengths[i]+c->lengths[j]==3){ 1166 1163 poly short_s=ksCreateShortSpoly(c->S->m[i],c->S->m[j],c->r); 1167 1164 if (short_s==NULL){ … … 1552 1549 if(curr_deg>=0){ 1553 1550 if (s->deg >curr_deg) break; 1554 1555 } 1556 1557 else {curr_deg=s->deg; 1558 if ((TEST_OPT_DEGBOUND) && (curr_deg>Kstd1_deg)){ 1559 int j; 1560 for(j=c->pair_top;j>=0;j--){ 1561 s=c->apairs[j]; 1562 if (s->i<0){ 1563 1564 add_to_basis_ideal_quotient(s->lcm_of_lm,-1,-1,c,NULL,FALSE); 1565 s->lcm_of_lm=NULL; 1566 free_sorted_pair_node(s,c->r); 1567 } 1568 else 1569 free_sorted_pair_node(s,c->r); 1570 c->pair_top--; 1571 assume(c->pair_top=j-1); 1572 } 1573 c->pair_top=-1; 1574 break; 1575 }} 1551 } 1552 1553 else curr_deg=s->deg; 1576 1554 quick_pop_pair(c); 1577 1555 if(s->i>=0){ … … 1724 1702 if (!c->nc) 1725 1703 p=redTailShort(p, c->strat); 1726 sbuf[j]=add_to_basis_ideal_quotient(p,-1,-1,c,ibuf+j , TRUE);1704 sbuf[j]=add_to_basis_ideal_quotient(p,-1,-1,c,ibuf+j); 1727 1705 //sbuf[j]=add_to_basis(p,-1,-1,c,ibuf+j); 1728 1706 } … … 1767 1745 for(i=0;i<add2->idelems();i++){ 1768 1746 if (add2->m[i]!=NULL) 1769 add_to_basis_ideal_quotient(add2->m[i],-1,-1,c,NULL , TRUE);1747 add_to_basis_ideal_quotient(add2->m[i],-1,-1,c,NULL); 1770 1748 add2->m[i]=NULL; 1771 1749 } … … 2061 2039 sorted_pair_node* si; 2062 2040 assume(n>0); 2063 add_to_basis_ideal_quotient(I->m[0],-1,-1,this,NULL , TRUE);2041 add_to_basis_ideal_quotient(I->m[0],-1,-1,this,NULL); 2064 2042 2065 2043 assume(strat->sl==strat->Shdl->idelems()-1); … … 2087 2065 { 2088 2066 for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis 2089 add_to_basis_ideal_quotient(I->m[i],-1,-1,this,NULL , TRUE);2067 add_to_basis_ideal_quotient(I->m[i],-1,-1,this,NULL); 2090 2068 } 2091 2069 for(i=0;i<I->idelems();i++) … … 2201 2179 // } 2202 2180 // } 2203 if (!(TEST_OPT_DEGBOUND)){ 2204 2205 //FIXME: not minimal when using find monomials 2206 for(i=0;i<c->n;i++) 2181 2182 2183 for(i=0;i<c->n;i++) 2184 { 2185 assume(c->S->m[i]!=NULL); 2186 for(j=0;j<c->n;j++) 2187 { 2188 if((c->S->m[j]==NULL)||(i==j)) 2189 continue; 2190 assume(p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j], 2191 c->S->m[i],~c->short_Exps[i], 2192 c->r)==p_LmDivisibleBy(c->S->m[j], 2193 c->S->m[i], 2194 c->r)); 2195 if (p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j], 2196 c->S->m[i],~c->short_Exps[i], 2197 c->r)) 2207 2198 { 2208 assume(c->S->m[i]!=NULL); 2209 for(j=0;j<c->n;j++) 2210 { 2211 if((c->S->m[j]==NULL)||(i==j)) 2212 continue; 2213 assume(p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j], 2214 c->S->m[i],~c->short_Exps[i], 2215 c->r)==p_LmDivisibleBy(c->S->m[j], 2216 c->S->m[i], 2217 c->r)); 2218 if (p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j], 2219 c->S->m[i],~c->short_Exps[i], 2220 c->r)) 2221 { 2222 pDelete(&c->S->m[i]); 2223 break; 2224 } 2225 } 2226 } 2199 pDelete(&c->S->m[i]); 2200 break; 2201 } 2202 } 2227 2203 } 2228 2204 omfree(c->short_Exps); … … 2242 2218 } 2243 2219 ideal t_rep_gb(ring r,ideal arg_I, BOOLEAN F4_mode){ 2244 //Print("degb ound%d\n",Kstd1_deg);2220 2245 2221 // Print("QlogSize(0) %d, QlogSize(1) %d,QlogSize(-2) %d, QlogSize(5) %d\n", QlogSize(nlInit(0)),QlogSize(nlInit(1)),QlogSize(nlInit(-2)),QlogSize(nlInit(5))); 2246 2222 -
kernel/tgb_internal.h
rbdabc8 rcae954 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb_internal.h,v 1. 29 2006-02-24 10:12:32bricken Exp $ */7 /* $Id: tgb_internal.h,v 1.30 2006-02-24 12:57:37 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: tgb internal .h file … … 18 18 #include "polys.h" 19 19 #include "stdlib.h" 20 //#define HAVE_BOOST 120 #define HAVE_BOOST 1 21 21 #ifdef HAVE_BOOST 22 22 #include "boost/dynamic_bitset.hpp" … … 211 211 sorted_pair_node* quick_pop_pair(slimgb_alg* c); 212 212 sorted_pair_node* top_pair(slimgb_alg* c); 213 sorted_pair_node** add_to_basis_ideal_quotient(poly h, int i_pos, int j_pos,slimgb_alg* c, int* ip , BOOLEAN new_pairs=TRUE);213 sorted_pair_node** add_to_basis_ideal_quotient(poly h, int i_pos, int j_pos,slimgb_alg* c, int* ip);//, BOOLEAN new_pairs=TRUE); 214 214 sorted_pair_node** spn_merge(sorted_pair_node** p, int pn,sorted_pair_node **q, int qn,slimgb_alg* c); 215 215 int kFindDivisibleByInS_easy(kStrategy strat,const red_object & obj);
Note: See TracChangeset
for help on using the changeset viewer.