- Timestamp:
- Nov 5, 1999, 8:11:10 PM (25 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
- Children:
- 698457f6f46700a65e8096f211292da37a6d4278
- Parents:
- f0e41bc3bc0601cdd0ab46942bf84fa17c5167df
- Location:
- Singular
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.in
rf0e41bc r9d06971 368 368 CCG = gcc 369 369 CXXG = gcc 370 CXXM = gcc -MM - DGENERATE_DEPEND371 CCM = gcc -MM - DGENERATE_DEPEND370 CXXM = gcc -MM -MG -DGENERATE_DEPEND 371 CCM = gcc -MM -MG -DGENERATE_DEPEND 372 372 373 373 CFLAGSG = -g -Wall -Wno-unused ${PIPE} -
Singular/ideals.cc
rf0e41bc r9d06971 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.7 1 1999-10-27 15:04:44 SingularExp $ */4 /* $Id: ideals.cc,v 1.72 1999-11-05 19:11:06 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 355 355 * copy an ideal from ring r1 to currRing 356 356 */ 357 ideal idRingCopy(ideal h, ring r) 358 { 359 if (h==NULL) return NULL; 360 ideal s_h=idInit(IDELEMS(h),h->rank); 357 ideal idRingCopy(ideal id, ring r) 358 { 359 if (id == NULL) return NULL; 360 ideal res; 361 361 362 int i; 362 for(i=IDELEMS(h)-1;i>=0;i--) 363 { 364 if (h->m[i]!=NULL) 365 { 366 if(r==currRing) 367 { 368 s_h->m[i]=pCopy(h->m[i]); 369 } 370 else 371 { 372 s_h->m[i]=pPermPoly(h->m[i],NULL,r,NULL,0); 373 } 374 } 375 } 376 return s_h; 363 res = idInit(IDELEMS(id), id->rank); 364 for (i=IDELEMS(id)-1; i>=0; i--) 365 { 366 res->m[i] = pFetchCopy(r, id->m[i]); 367 } 368 return res; 377 369 } 378 370 … … 1106 1098 1107 1099 ring orig_ring=currRing; 1108 ring syz_ring=r AddSyzComp(currRing);1100 ring syz_ring=rCurrRingAssureSyzComp(); 1109 1101 pSetSyzComp(length); 1110 1102 … … 1118 1110 temp->m[k] = pCopy(first->m[i]); 1119 1111 else 1120 temp->m[k] = p PermPoly(first->m[i],NULL,orig_ring,NULL,0);1112 temp->m[k] = pFetchCopy(orig_ring,first->m[i]); 1121 1113 q = pOne(); 1122 1114 pSetComp(q,i+1+length); … … 1138 1130 temp->m[k] = pCopy(second->m[i]); 1139 1131 else 1140 temp->m[k] = p PermPoly(second->m[i],NULL,orig_ring,NULL,0);1132 temp->m[k] = pFetchCopy(orig_ring,second->m[i]); 1141 1133 if (slength==0) pShift(&(temp->m[k]),1); 1142 1134 k++; … … 1161 1153 p = pCopy(temp1->m[i]); 1162 1154 else 1163 p = p PermPoly(temp1->m[i],NULL,syz_ring,NULL,0);1155 p = pFetchCopy(syz_ring,temp1->m[i]); 1164 1156 while (p!=NULL) 1165 1157 { … … 1231 1223 1232 1224 ring orig_ring=currRing; 1233 ring syz_ring=r AddSyzComp(currRing);1225 ring syz_ring=rCurrRingAssureSyzComp(); 1234 1226 pSetSyzComp(syzComp); 1235 1227 … … 1260 1252 bigmat->m[i] = pCopy(arg[j]->m[l]); 1261 1253 else 1262 bigmat->m[i] = p PermPoly(arg[j]->m[l],NULL,orig_ring,NULL,0);1254 bigmat->m[i] = pFetchCopy(orig_ring,arg[j]->m[l]); 1263 1255 pShift(&(bigmat->m[i]),k*maxrk+isIdeal); 1264 1256 i++; … … 1292 1284 p = pCopy(tempstd->m[j]); 1293 1285 else 1294 p = p PermPoly(tempstd->m[j],NULL,syz_ring,NULL,0);1286 p = pFetchCopy(syz_ring,tempstd->m[j]); 1295 1287 pShift(&p,-syzComp-isIdeal); 1296 1288 result->m[k] = p; … … 1397 1389 assume(currRing != NULL); 1398 1390 ring orig_ring=currRing; 1399 ring syz_ring=r AddSyzComp(currRing);1391 ring syz_ring=rCurrRingAssureSyzComp(); 1400 1392 1401 1393 pSetSyzComp(k); … … 1430 1422 else 1431 1423 { 1432 p = p PermPoly(s_h3->m[j],NULL,syz_ring,NULL,0);1424 p = pFetchCopy(syz_ring,s_h3->m[j]); 1433 1425 rChangeCurrRing(syz_ring,FALSE); 1434 1426 pDelete(&(s_h3->m[j])); … … 1517 1509 1518 1510 ring orig_ring=currRing; 1519 ring syz_ring=r AddSyzComp(currRing);1511 ring syz_ring=rCurrRingAssureSyzComp(); 1520 1512 pSetSyzComp(k); 1521 1513 … … 1613 1605 1614 1606 ring orig_ring=currRing; 1615 ring syz_ring=r AddSyzComp(currRing);1607 ring syz_ring=rCurrRingAssureSyzComp(); 1616 1608 pSetSyzComp(k); 1617 1609 … … 1696 1688 1697 1689 ring orig_ring=currRing; 1698 ring syz_ring=r AddSyzComp(currRing);1690 ring syz_ring=rCurrRingAssureSyzComp(); 1699 1691 pSetSyzComp(max(k,1)); 1700 1692 … … 1730 1722 p = pCopy(submod->m[j]); 1731 1723 else 1732 p=p PermPoly(submod->m[j],NULL,orig_ring,NULL,0);1724 p=pFetchCopy(orig_ring,submod->m[j]); 1733 1725 if (pGetComp(p)==0) pSetCompP(p,1); 1734 1726 q = kNF(s_temp,currQuotient,p,k); … … 1930 1922 1931 1923 ring orig_ring=currRing; 1932 ring syz_ring=r AddSyzComp(currRing);1924 ring syz_ring=rCurrRingAssureSyzComp(); 1933 1925 pSetSyzComp(kmax-1); 1934 1926 … … 1941 1933 s_q=pCopy(q); 1942 1934 else 1943 s_q=p PermPoly(q,NULL,orig_ring,NULL,0);1935 s_q=pFetchCopy(orig_ring,q); 1944 1936 1945 1937 ideal s_h4 = idInit(16,kmax); … … 1973 1965 s_p = pCopy(temph1->m[l]); 1974 1966 else 1975 s_p=p PermPoly(temph1->m[l],NULL,orig_ring,NULL,0);1967 s_p=pFetchCopy(orig_ring,temph1->m[l]); 1976 1968 if (k1 == 0) 1977 1969 pShift(&s_p,ll*k+1); … … 2988 2980 2989 2981 ring orig_ring=currRing; 2990 ring syz_ring=r AddSyzComp(currRing);2982 ring syz_ring=rCurrRingAssureSyzComp(); 2991 2983 pSetSyzComp(length); 2992 2984 -
Singular/kspoly.cc
rf0e41bc r9d06971 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kspoly.cc,v 1. 4 1999-10-25 08:32:15obachman Exp $ */4 /* $Id: kspoly.cc,v 1.5 1999-11-05 19:11:07 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Routines for Spoly creation and reductions … … 37 37 poly p1 = PR->p; 38 38 poly p2 = PW->p; 39 39 40 assume(p2 != NULL && p1 != NULL && pDivisibleBy(p2, p1)); 41 assume(pGetComp(p1) == pGetComp(p2) || 42 (pMaxComp(p2) == 0)); 43 40 44 poly a2 = pNext(p2), lm = p1; 41 45 42 46 p1 = pNext(p1); 43 47 44 BOOLEAN reset_vec=FALSE;45 46 48 if (a2==NULL) 47 49 { … … 65 67 else 66 68 { 67 if (coef != NULL) 68 *coef = nInit(1); 69 } 70 71 72 if (pGetComp(p2) != pGetComp(lm)) 73 { 74 pSetCompP(a2, pGetComp(lm)); 75 reset_vec = TRUE; 76 // need to make sure that Comp of lm is same as comp of p2 77 pSetComp(lm, pGetComp(p2)); 78 pSetmComp(lm); 79 } 80 69 if (coef != NULL) *coef = nInit(1); 70 } 71 72 81 73 pMonSubFrom(lm, p2); 82 assume(pGetComp(lm) == 0); 83 84 int l1, l2; 74 85 75 PR->p = p_Minus_m_Mult_q(p1, lm, a2, spNoether); 86 76 87 77 pDelete1(&lm); 88 if (reset_vec) pSetCompP(a2, 0);89 78 } 90 79 … … 465 454 } 466 455 467 #if 1468 456 void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether) 469 457 { … … 479 467 480 468 481 #else 482 483 /*2 484 * reduction of tail(q) with p1 485 * lead(p1) divides lead(pNext(q2)) and pNext(q2) is reduced 486 * do not destroy p1, but tail(q) 487 */ 488 void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether) 489 { 490 number t; 491 poly m, h; 492 poly a1 = pNext(p1), p2 = pNext(q2), a2 = pNext(p2); 493 number an = pGetCoeff(p1), bn = pGetCoeff(p2); 494 int ct = ksCheckCoeff(&an, &bn); 495 BOOLEAN reset_vec=FALSE; 496 497 if(a1==NULL) 498 { 499 nDelete(&an); 500 nDelete(&bn); 501 nDelete(&pGetCoeff(p2)); 502 pFree1(p2); 503 pNext(q2) = a2; 504 return; 505 } 506 if (p1 != q) 507 { 508 m = p2; 509 pSetCoeff(m,bn); 510 } 511 else 512 { 513 m = pHead0(p2); 514 pSetCoeff0(m,bn); 515 } 516 if ((ct == 0) || (ct == 2)) 517 { 518 pMultN(a2, an); 519 } 520 if ((pGetComp(p1) != pGetComp(p2)) 521 && (pGetComp(p1)==0)) 522 { 523 pSetCompP(a1,pGetComp(p2)); 524 reset_vec=TRUE; 525 } 526 pMonSubFrom(m,p1); 527 poly res = p_Minus_m_Mult_q(a2, m, a1); 528 if ((ct == 0) || (ct == 2)) 529 { 530 h = q; 531 do 532 { 533 t = nMult(pGetCoeff(h),an); 534 pSetCoeff(h,t); 535 pIter(h); 536 } 537 while (h != p2); 538 } 539 h = res; 540 nDelete(&an); 541 nDelete(&bn); 542 pFree1(m); 543 pNext(q2) = h; 544 if (reset_vec) 545 pSetCompP(a1,0); 546 if (p1 == q) 547 { 548 pDelete(&p2); 549 } 550 } 551 552 #endif 553 554 555 469 470 471 -
Singular/kstd1.cc
rf0e41bc r9d06971 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.4 5 1999-11-02 15:19:06 SingularExp $ */4 /* $Id: kstd1.cc,v 1.46 1999-11-05 19:11:07 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 93 93 //pTest(*with); 94 94 #endif 95 95 assume(strat->syzComp == 0 || 96 pGetComp(h->p) <= strat->syzComp); 96 97 if (!TEST_OPT_INTSTRATEGY) 97 98 pNorm(*with); … … 254 255 unsigned long not_sev; 255 256 257 assume(strat->syzComp == 0 || 258 pGetComp(h->p) <= strat->syzComp); 259 256 260 if (TEST_OPT_CANCELUNIT) cancelunit(h); 257 261 d = pFDeg((*h).p)+(*h).ecart; … … 358 362 return -2; 359 363 } 364 assume(pGetComp(h->p) <= strat->syzComp); 365 360 366 } 361 367 /*- try to reduce the s-polynomial -*/ -
Singular/mmcheck.c
rf0e41bc r9d06971 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmcheck.c,v 1.1 5 1999-10-26 15:06:10obachman Exp $ */4 /* $Id: mmcheck.c,v 1.16 1999-11-05 19:11:08 obachman Exp $ */ 5 5 6 6 /* … … 217 217 218 218 memset(what->front_pattern, MM_FRONT_PATTERN, MM_NUMBER_OF_FRONT_PATTERNS); 219 memset(addr, 255, size); 219 220 memset((char*) addr + size, MM_BACK_PATTERN, DebugOffsetBack); 220 221 } -
Singular/mmisc.c
rf0e41bc r9d06971 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mmisc.c,v 1.2 0 1999-10-26 15:06:11obachman Exp $ */4 /* $Id: mmisc.c,v 1.21 1999-11-05 19:11:08 obachman Exp $ */ 5 5 6 6 /* … … 70 70 int mm_this_specIndex = mmGetIndex(SizeFromRealSize(heap->size)); 71 71 72 mmGarbageCollectHeap(heap, 0); 72 /* mmGarbageCollectHeap(heap, 0); */ 73 73 74 74 if (mm_this_specIndex < 0 || -
Singular/polys-impl.cc
rf0e41bc r9d06971 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys-impl.cc,v 1.3 1 1999-10-25 08:32:17obachman Exp $ */4 /* $Id: polys-impl.cc,v 1.32 1999-11-05 19:11:08 obachman Exp $ */ 5 5 6 6 /*************************************************************** … … 339 339 assume(d_h != NULL && (d_h == mm_specHeap) || 340 340 d_h->size == mm_specHeap->size); 341 341 pTest(s_p); 342 342 while (s_p != NULL) 343 343 { … … 1122 1122 } 1123 1123 } 1124 if (currRing->order[0] == ringorder_s) 1125 { 1126 if (p->exp.l[currRing->typ[0].data.syz.place] != 0 && 1127 p->exp.l[currRing->typ[0].data.syz.place] != 1) 1128 { 1129 Warn("Syzcomp wrong %d in %s:%d", 1130 p->exp.l[currRing->typ[0].data.syz.place], f, l); 1131 } 1132 } 1124 1133 old=p; 1125 1134 pIter(p); -
Singular/ring.cc
rf0e41bc r9d06971 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.8 0 1999-11-05 15:54:29 SingularExp $ */4 /* $Id: ring.cc,v 1.81 1999-11-05 19:11:09 obachman Exp $ */ 5 5 6 6 /* … … 116 116 117 117 /*------------ Garbage Collection -----------------------------------*/ 118 mmGarbageCollectHeaps(2);118 // mmGarbageCollectHeaps(2); 119 119 } 120 120 } … … 3096 3096 for(j=0;j<r->OrdSize;j++) 3097 3097 { 3098 char *TYP[]={"ro_dp","ro_wp","ro_cp","ro_syzcomp", "ro_none"};3098 char *TYP[]={"ro_dp","ro_wp","ro_cp","ro_syzcomp", "ro_syz", "ro_none"}; 3099 3099 Print(" typ %s",TYP[r->typ[j].ord_typ]); 3100 3100 Print(" place %d",r->typ[j].data.dp.place); … … 3245 3245 } 3246 3246 3247 ring rAddSyzComp(ring r) 3248 { 3249 if (r->order[0]==ringorder_c) 3250 return currRing; 3251 3252 assume(currRing->order[0] != ringorder_s && 3253 currRing->order[0] != ringorder_S); 3254 3255 nMap=nCopy; // need to set nMap for mapping of polys 3256 // (at least with current implementation via pPermPoly) 3247 ///////////////////////////////////////////////////////////////////////////// 3248 // 3249 // The following routines all take as input a ring r, and return R 3250 // where R has a certain property. P might be equal r in which case r 3251 // had already this property 3252 // 3253 // Without argument, these functions work on currRing and change it, 3254 // if necessary 3255 3256 // for the time being, this is still here 3257 extern ideal idRingCopy(ideal id, ring r); 3258 static ring rAssureSyzComp(ring r); 3259 ring rCurrRingAssureSyzComp() 3260 { 3261 ring r = rAssureSyzComp(currRing); 3262 if (r != currRing) 3263 { 3264 ring old_ring = currRing; 3265 rChangeCurrRing(r, TRUE); 3266 if (old_ring->qideal != NULL) 3267 { 3268 r->qideal = idRingCopy(old_ring->qideal, old_ring); 3269 assume(idRankFreeModule(r->qideal) == 0); 3270 currQuotient = r->qideal; 3271 } 3272 } 3273 return r; 3274 } 3275 3276 static ring rAssureSyzComp(ring r) 3277 { 3278 if (r->order[0]==ringorder_c || r->order[0] == ringorder_s) 3279 return r; 3257 3280 3258 3281 ring res=rCopy0(r); 3259 if (res->qideal!=NULL)3260 {3261 idDelete(&(res->qideal));3262 }3263 3282 int i=rBlocks(r); 3264 3283 int j; … … 3283 3302 3284 3303 rComplete(res,1); 3285 rChangeCurrRing(res,TRUE);3286 if(r->qideal!=NULL)3287 {3288 res->qideal=idInit(IDELEMS(r->qideal),1);3289 for(i=IDELEMS(r->qideal)-1;i>=0;i--)3290 {3291 res->qideal->m[i]=pPermPoly(r->qideal->m[i],NULL,r,NULL,0);3292 }3293 }3294 currQuotient=res->qideal;3295 3304 return res; 3296 3305 } 3306 3307 3308 -
Singular/ring.h
rf0e41bc r9d06971 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1.3 8 1999-11-02 15:19:11 SingularExp $ */9 /* $Id: ring.h,v 1.39 1999-11-05 19:11:10 obachman Exp $ */ 10 10 11 11 /* includes */ … … 26 26 void rKill(ring r); 27 27 ring rCopy(ring r); 28 ring rAddSyzComp(ring r); 28 29 30 // Ring Manipulations 31 ring rCurrRingAssureSyzComp(); 29 32 30 33 #ifdef PDEBUG
Note: See TracChangeset
for help on using the changeset viewer.