Changeset d367e9 in git
- Timestamp:
- Feb 24, 2006, 11:12:33 AM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- e06fee507e546484e81123c1d74f6b8423fcaef5
- Parents:
- 9c6d49554ae6de78686962450083ecb4df5d9cd6
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/tgb.cc
r9c6d49 rd367e9 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb.cc,v 1.7 1 2006-02-24 07:25:33 bricken Exp $ */7 /* $Id: tgb.cc,v 1.72 2006-02-24 10:12:33 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 )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) 1021 1021 { 1022 1022 … … 1115 1115 1116 1116 #undef ENLARGE 1117 1117 1118 for (j=0;j<i;j++){ 1118 1119 … … 1121 1122 c->states[i][j]=UNCALCULATED; 1122 1123 #endif 1124 if (!new_pairs) continue; 1123 1125 assume(p_LmDivisibleBy(c->S->m[i],c->S->m[j],c->r)== 1124 1126 p_LmShortDivisibleBy(c->S->m[i],c->short_Exps[i],c->S->m[j],~(c->short_Exps[j]),c->r)); … … 1138 1140 c->easy_product_crit++; 1139 1141 c->states[i][j]=HASTREP; 1140 continue;1142 //continue; 1141 1143 } 1142 1144 else if(extended_product_criterion(c->S->m[i],c->gcd_of_terms[i],c->S->m[j],c->gcd_of_terms[j],c)) … … 1148 1150 } 1149 1151 // if (c->states[i][j]==UNCALCULATED){ 1150 1152 1151 1153 if ((TEST_V_FINDMONOM) &&(!c->nc)) { 1152 1154 //PrintS("COMMU"); … … 1160 1162 // } 1161 1163 // } 1162 if ( c->lengths[i]+c->lengths[j]==3){1164 if ((c->lengths[i]+c->lengths[j]==3) &&( (pHasNotCF(c->S->m[i],c->S->m[j])))){ 1163 1165 poly short_s=ksCreateShortSpoly(c->S->m[i],c->S->m[j],c->r); 1164 1166 if (short_s==NULL){ … … 1549 1551 if(curr_deg>=0){ 1550 1552 if (s->deg >curr_deg) break; 1551 } 1552 1553 1554 } 1555 1553 1556 else curr_deg=s->deg; 1557 if ((TEST_OPT_DEGBOUND) && (curr_deg>Kstd1_deg)){ 1558 int j; 1559 for(j=c->pair_top;j>=0;j--){ 1560 s=c->apairs[j]; 1561 if (s->i<0){ 1562 1563 add_to_basis_ideal_quotient(s->lcm_of_lm,-1,-1,c,NULL,FALSE); 1564 s->lcm_of_lm=NULL; 1565 free_sorted_pair_node(s,c->r); 1566 } 1567 else 1568 free_sorted_pair_node(s,c->r); 1569 c->pair_top--; 1570 assume(c->pair_top=j-1); 1571 } 1572 c->pair_top=-1; 1573 break; 1574 } 1554 1575 quick_pop_pair(c); 1555 1576 if(s->i>=0){ … … 1702 1723 if (!c->nc) 1703 1724 p=redTailShort(p, c->strat); 1704 sbuf[j]=add_to_basis_ideal_quotient(p,-1,-1,c,ibuf+j );1725 sbuf[j]=add_to_basis_ideal_quotient(p,-1,-1,c,ibuf+j, TRUE); 1705 1726 //sbuf[j]=add_to_basis(p,-1,-1,c,ibuf+j); 1706 1727 } … … 1745 1766 for(i=0;i<add2->idelems();i++){ 1746 1767 if (add2->m[i]!=NULL) 1747 add_to_basis_ideal_quotient(add2->m[i],-1,-1,c,NULL );1768 add_to_basis_ideal_quotient(add2->m[i],-1,-1,c,NULL, TRUE); 1748 1769 add2->m[i]=NULL; 1749 1770 } … … 2039 2060 sorted_pair_node* si; 2040 2061 assume(n>0); 2041 add_to_basis_ideal_quotient(I->m[0],-1,-1,this,NULL );2062 add_to_basis_ideal_quotient(I->m[0],-1,-1,this,NULL, TRUE); 2042 2063 2043 2064 assume(strat->sl==strat->Shdl->idelems()-1); … … 2065 2086 { 2066 2087 for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis 2067 add_to_basis_ideal_quotient(I->m[i],-1,-1,this,NULL );2088 add_to_basis_ideal_quotient(I->m[i],-1,-1,this,NULL, TRUE); 2068 2089 } 2069 2090 for(i=0;i<I->idelems();i++) … … 2179 2200 // } 2180 2201 // } 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)) 2202 if (!(TEST_OPT_DEGBOUND)){ 2203 2204 //FIXME: not minimal when using find monomials 2205 for(i=0;i<c->n;i++) 2198 2206 { 2199 pDelete(&c->S->m[i]); 2200 break; 2201 } 2202 } 2207 assume(c->S->m[i]!=NULL); 2208 for(j=0;j<c->n;j++) 2209 { 2210 if((c->S->m[j]==NULL)||(i==j)) 2211 continue; 2212 assume(p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j], 2213 c->S->m[i],~c->short_Exps[i], 2214 c->r)==p_LmDivisibleBy(c->S->m[j], 2215 c->S->m[i], 2216 c->r)); 2217 if (p_LmShortDivisibleBy(c->S->m[j],c->short_Exps[j], 2218 c->S->m[i],~c->short_Exps[i], 2219 c->r)) 2220 { 2221 pDelete(&c->S->m[i]); 2222 break; 2223 } 2224 } 2225 } 2203 2226 } 2204 2227 omfree(c->short_Exps); … … 2218 2241 } 2219 2242 ideal t_rep_gb(ring r,ideal arg_I, BOOLEAN F4_mode){ 2220 2243 //Print("degb ound%d\n",Kstd1_deg); 2221 2244 // 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))); 2222 2245 -
kernel/tgb_internal.h
r9c6d49 rd367e9 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb_internal.h,v 1.2 8 2006-02-24 07:25:34bricken Exp $ */7 /* $Id: tgb_internal.h,v 1.29 2006-02-24 10:12:32 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: tgb internal .h file … … 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 );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.