Changeset 750069 in git for kernel/combinatorics/hilb.cc
- Timestamp:
- Sep 22, 2016, 3:41:32 PM (8 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- 4ef909357cd2764e39044e78dc5f8f271de19c21
- Parents:
- c4ea0bb97e0fcd6d7e4ea58106ce9935683b32de6c086a438d710cf8f1f5eac494377370eacf969c
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2016-09-22 15:41:32+02:00
- git-committer:
- GitHub <noreply@github.com>2016-09-22 15:41:32+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/combinatorics/hilb.cc
r6c086a4 r750069 229 229 //!!!!!!!!!!!!!!!!!!!!! Just for Monomial Ideals !!!!!!!!!!!!!!!!!!!!!!!!!!!! 230 230 231 //returns the degree of the monomial232 static int DegMon(poly p)233 {234 #if 1235 int i,deg;236 deg = 0;237 for(i=1;i<=currRing->N;i++)238 {239 deg = deg + p_GetExp(p, i, currRing);240 }241 return(deg);242 #else243 return(p_Deg(p, currRing));244 #endif245 }246 247 231 //Tests if the ideal is sorted by degree 248 232 static bool idDegSortTest(ideal I) … … 254 238 for(int i = 0; i<IDELEMS(I)-1; i++) 255 239 { 256 if( DegMon(I->m[i])>DegMon(I->m[i+1]))240 if(p_Totaldegree(I->m[i],currRing)>p_Totaldegree(I->m[i+1],currRing)) 257 241 { 258 242 idPrint(I); … … 277 261 idSkipZeroes(I); 278 262 #if 1 279 for(i = 0; (i<IDELEMS(I)) && ( DegMon(I->m[i])<=DegMon(p)); i++)263 for(i = 0; (i<IDELEMS(I)) && (p_Totaldegree(I->m[i],currRing)<=p_Totaldegree(p,currRing)); i++) 280 264 { 281 265 if(p_DivisibleBy( I->m[i],p, currRing)) … … 284 268 } 285 269 } 286 for(i = IDELEMS(I)-1; (i>=0) && ( DegMon(I->m[i])>=DegMon(p)); i--)270 for(i = IDELEMS(I)-1; (i>=0) && (p_Totaldegree(I->m[i],currRing)>=p_Totaldegree(p,currRing)); i--) 287 271 { 288 272 if(p_DivisibleBy(p,I->m[i], currRing)) … … 300 284 idSkipZeroes(I); 301 285 //First I take the case when all generators have the same degree 302 if( DegMon(I->m[0]) == DegMon(I->m[IDELEMS(I)-1]))303 { 304 if( DegMon(p)<DegMon(I->m[0]))286 if(p_Totaldegree(I->m[0],currRing) == p_Totaldegree(I->m[IDELEMS(I)-1],currRing)) 287 { 288 if(p_Totaldegree(p,currRing)<p_Totaldegree(I->m[0],currRing)) 305 289 { 306 290 idInsertPoly(I,p); … … 313 297 return(I); 314 298 } 315 if( DegMon(p)>=DegMon(I->m[IDELEMS(I)-1]))299 if(p_Totaldegree(p,currRing)>=p_Totaldegree(I->m[IDELEMS(I)-1],currRing)) 316 300 { 317 301 idInsertPoly(I,p); … … 320 304 } 321 305 } 322 if( DegMon(p)<=DegMon(I->m[0]))306 if(p_Totaldegree(p,currRing)<=p_Totaldegree(I->m[0],currRing)) 323 307 { 324 308 idInsertPoly(I,p); … … 331 315 return(I); 332 316 } 333 if( DegMon(p)>=DegMon(I->m[IDELEMS(I)-1]))317 if(p_Totaldegree(p,currRing)>=p_Totaldegree(I->m[IDELEMS(I)-1],currRing)) 334 318 { 335 319 idInsertPoly(I,p); … … 339 323 for(i = IDELEMS(I)-2; ;) 340 324 { 341 if( DegMon(p)==DegMon(I->m[i]))325 if(p_Totaldegree(p,currRing)==p_Totaldegree(I->m[i],currRing)) 342 326 { 343 327 idInsertPoly(I,p); … … 350 334 return(I); 351 335 } 352 if( DegMon(p)>DegMon(I->m[i]))336 if(p_Totaldegree(p,currRing)>p_Totaldegree(I->m[i],currRing)) 353 337 { 354 338 idInsertPoly(I,p); … … 424 408 } 425 409 p_Setm(res->m[i], currRing); 426 if( DegMon(res->m[i]) == DegMon(I->m[i]))410 if(p_Totaldegree(res->m[i],currRing) == p_Totaldegree(I->m[i],currRing)) 427 411 { 428 412 res->m[i] = NULL; // pDelete … … 749 733 int i,j,exp; 750 734 poly res; 751 if( DegMon(I->m[IDELEMS(I)-1])<=1)735 if(p_Totaldegree(I->m[IDELEMS(I)-1],currRing)<=1) 752 736 { 753 737 res = ChoosePVar(I); … … 793 777 return(TRUE); 794 778 #else 795 if( DegMon(I->m[IDELEMS(I)-1])>1)779 if(p_Totaldegree(I->m[IDELEMS(I)-1],currRing)>1) 796 780 { 797 781 return(FALSE); … … 849 833 bool flag=TRUE; 850 834 poly notsqrfree = NULL; 851 if( DegMon(I->m[IDELEMS(I)-1])<=1)835 if(p_Totaldegree(I->m[IDELEMS(I)-1],currRing)<=1) 852 836 { 853 837 return(notsqrfree); … … 1043 1027 mpz_set( &hilbertcoef[NNN], ec); 1044 1028 mpz_clear(ec); 1045 hilbpower[NNN] = DegMon(q);1029 hilbpower[NNN] = p_Totaldegree(q,currRing); 1046 1030 NNN++; 1047 1031 } … … 1049 1033 { 1050 1034 //I look if the power appears already 1051 for(i = 0;(i<NNN)&&(flag == FALSE)&&( DegMon(q)>=hilbpower[i]);i++)1052 { 1053 if((hilbpower[i]) == ( DegMon(q)))1035 for(i = 0;(i<NNN)&&(flag == FALSE)&&(p_Totaldegree(q,currRing)>=hilbpower[i]);i++) 1036 { 1037 if((hilbpower[i]) == (p_Totaldegree(q,currRing))) 1054 1038 { 1055 1039 flag = TRUE; … … 1069 1053 mpz_set( &hilbertcoef[i], ec); 1070 1054 mpz_clear(ec); 1071 hilbpower[i] = DegMon(q);1055 hilbpower[i] = p_Totaldegree(q,currRing); 1072 1056 NNN++; 1073 1057 }
Note: See TracChangeset
for help on using the changeset viewer.