Changeset e0d91c in git
- Timestamp:
- Sep 22, 1998, 4:09:05 PM (25 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- 7709bf1f0117c77f62572e798d2164f8f0a773a4
- Parents:
- 8a839d187e734df8873c2c8aa439609fb0eb3333
- Location:
- Singular
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/algmap.cc
r8a839d1 re0d91c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: algmap.cc,v 1.1 0 1998-03-27 15:43:17 obachmanExp $ */4 /* $Id: algmap.cc,v 1.11 1998-09-22 14:09:00 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - the mapping of polynomials from rings with … … 204 204 poly q, q0, q1 = NULL; 205 205 int i; 206 206 207 207 if (s == 0) 208 208 { -
Singular/clapsing.cc
r8a839d1 re0d91c 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapsing.cc,v 1. 39 1998-07-29 13:55:43Singular Exp $5 // $Id: clapsing.cc,v 1.40 1998-09-22 14:09:01 Singular Exp $ 6 6 /* 7 7 * ABSTRACT: interface between Singular and factory … … 407 407 CanonicalForm g, h; 408 408 poly p = pNext(f); 409 nTest(pGetCoeff(f));409 //nTest(pGetCoeff(f)); 410 410 FACTORY_ALGOUT( "G = ", (((lnumber)pGetCoeff(f))->z) ); 411 411 g = convSingTrClapP( ((lnumber)pGetCoeff(f))->z ); … … 414 414 while ( (p != NULL) && (g != 1) ) 415 415 { 416 nTest(pGetCoeff(p));416 //nTest(pGetCoeff(p)); 417 417 FACTORY_ALGOUT( "h = ", (((lnumber)pGetCoeff(p))->z) ); 418 418 h = convSingTrClapP( ((lnumber)pGetCoeff(p))->z ); … … 464 464 #endif 465 465 c->z=convClapPSingTr( i.getItem() / g ); 466 nTest((number)c);466 //nTest((number)c); 467 467 //#ifdef LDEBUG 468 468 //number cn=(number)c; … … 940 940 int sw=(int)dummy->Data(); 941 941 ideal f=singclap_factorize((poly)(u->Data()), &v, sw); 942 if (f==NULL) 943 return TRUE; 942 944 switch(sw) 943 945 { … … 957 959 case 1: 958 960 res->data=(void *)f; 959 return f==NULL; 961 return FALSE; 962 case 3: 963 { 964 poly p=f->m[0]; 965 int i=IDELEMS(f); 966 f->m[0]=NULL; 967 while(i>1) 968 { 969 i--; 970 p=pMult(p,f->m[i]); 971 f->m[i]=NULL; 972 } 973 res->data=(void *)p; 974 res->rtyp=POLY_CMD; 975 } 976 return FALSE; 960 977 } 961 978 WerrorS("invalid switch"); -
Singular/syz0.cc
r8a839d1 re0d91c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz0.cc,v 1.1 6 1998-06-12 17:41:41 obachmanExp $ */4 /* $Id: syz0.cc,v 1.17 1998-09-22 14:09:02 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 433 433 int j,i=0; 434 434 poly p; 435 435 436 436 if (toNorm==NULL) return NULL; 437 437 p = pHead(toNorm); … … 447 447 //pNorm(toNorm); 448 448 toNorm = spSpolyRed(currQuotient->m[i],toNorm,NULL, SpolyLoop); 449 pDelete(&p); 449 pDelete(&p); 450 450 if (toNorm==NULL) return NULL; 451 451 p = pHead(toNorm); … … 805 805 bl1[j] = currRing->block1[m_order]; 806 806 wv[j] = currRing->wvhdl[m_order]; 807 808 809 810 811 812 807 tmpR = *currRing; 808 tmpR.order = ord; 809 tmpR.block0 = bl0; 810 tmpR.block1 = bl1; 811 tmpR.wvhdl = wv; 812 rComplete(&tmpR); 813 813 rChangeCurrRing(&tmpR, TRUE); 814 814 } -
Singular/syz1.cc
r8a839d1 re0d91c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: syz1.cc,v 1.3 1 1998-08-05 11:40:58 siebertExp $ */4 /* $Id: syz1.cc,v 1.32 1998-09-22 14:09:03 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: resolutions … … 169 169 /*4 handle module case:*/ 170 170 if (pGetComp(p1)==pGetComp(p2)) return 0; 171 else if 172 (currcomponents[pGetComp(p1)]>currcomponents[pGetComp(p2)]) 171 else if 172 (currcomponents[pGetComp(p1)]>currcomponents[pGetComp(p2)]) 173 173 return 1; 174 174 else return -1; … … 194 194 int n1 = normal_syzcomp2dpc(p1, p2); 195 195 int n2 = SyVecSyzCmp(p1, p2); 196 196 197 197 if (n1 != n2) 198 198 { … … 281 281 } 282 282 for (int i=0;i<pVariables;i++) 283 { 283 { 284 284 binomials[i*(highdeg_1)/*i,0*/]=0; 285 285 } … … 323 323 poly q,result=q=pNew(); 324 324 int j; 325 325 326 326 if (pGetOrder(p)>0) 327 327 { 328 loop 328 loop 329 329 { 330 330 spMemcpy(q,p); … … 346 346 poly lastmon=NULL; 347 347 int i=0; 348 loop 348 loop 349 349 { 350 350 if (pGetOrder(p)!=i) … … 380 380 poly q,result=q=pNew(); 381 381 int j; 382 382 383 383 if (pGetOrder(p)>0) 384 384 { 385 loop 385 loop 386 386 { 387 387 spMemcpy(q,p); … … 404 404 poly lastmon=NULL; 405 405 int i=0; 406 loop 406 loop 407 407 { 408 408 if (pGetOrder(p)!=i) … … 439 439 poly q,result=q=pNew(); 440 440 int j; 441 441 442 442 if (pGetOrder(p)>0) 443 443 { 444 loop 444 loop 445 445 { 446 446 spMemcpy(q,p); … … 462 462 poly lastmon=NULL; 463 463 int i=0; 464 loop 464 loop 465 465 { 466 466 if (pGetOrder(p)!=i) … … 574 574 { 575 575 poly temp1 = pCopy(m1); 576 576 577 577 poly p1 = normal_sySPAdd(m1, m2, m); 578 578 poly p2 = syVecSpoly(m2, temp1, m); 579 579 580 580 pTest(p1); 581 581 pTest(p2); 582 if (p1 != NULL) 582 if (p1 != NULL) 583 583 { 584 584 if (p2 == NULL || ! pEqual(p1, p2)) … … 591 591 } 592 592 } 593 else if (p2 != NULL) 593 else if (p2 != NULL) 594 594 PrintS("Error in SySpoly\n"); 595 595 … … 683 683 break; 684 684 } 685 else 685 else 686 686 { 687 687 j = currcomponents[pGetComp(m1)]-currcomponents[pGetComp(m2)]; … … 695 695 break; 696 696 } 697 else 697 else 698 698 { 699 699 if (j<0/*currcomponents[pGetComp(m1)]<currcomponents[pGetComp(m2)]*/) … … 809 809 #if defined(HAVE_SY_VECTOR) && ! defined (SY_VEC_DEBUG) 810 810 res = sySpolyProc(m2, m1,a); 811 #else 811 #else 812 812 if (pGetOrder(m1)>0) 813 813 { … … 940 940 arg->m[(*iv)[i]-1] = NULL; 941 941 (resPairs[0])[i].order = pTotaldegree((resPairs[0])[i].syz); 942 } 942 } 943 943 } 944 944 else … … 983 983 if (p==NULL) return; 984 984 if (realcomp==0) realcomp=1; 985 985 986 986 if (index>1) 987 987 tc = trind1[pGetComp(p)]-1; … … 1064 1064 if (o_r->m[l]!=NULL) 1065 1065 { 1066 isDivisible = isDivisible || 1066 isDivisible = isDivisible || 1067 1067 pDivisibleBy2(o_r->m[l],tso.lcm); 1068 1068 } … … 1115 1115 if (o_r->m[l]!=NULL) 1116 1116 { 1117 isDivisible = isDivisible || 1117 isDivisible = isDivisible || 1118 1118 pDivisibleBy2(o_r->m[l],tso.lcm); 1119 1119 } … … 1129 1129 else 1130 1130 { 1131 nextPairs[i].p = 1131 nextPairs[i].p = 1132 1132 sySPoly(tso.p1, tso.p2,tso.lcm); 1133 1133 (*spl)[i] = pLength(nextPairs[i].p); … … 1142 1142 for (i1=0;i1<howmuch;i1++) 1143 1143 { 1144 if (i2==-1) 1144 if (i2==-1) 1145 1145 { 1146 1146 if ((*spl)[i1]!=-1) … … 1174 1174 * reduces all pairs of degree deg in the module index 1175 1175 * put the reduced generators to the resolvente which contains 1176 * the truncated kStd 1176 * the truncated kStd 1177 1177 */ 1178 1178 static void syRedNextPairs(SSet nextPairs, syStrategy syzstr, … … 1201 1201 if ((tso.p1!=NULL) && (tso.p2!=NULL)) 1202 1202 { 1203 coefgcd = 1203 coefgcd = 1204 1204 nGcd(pGetCoeff(tso.p1),pGetCoeff(tso.p2)); 1205 1205 tso.syz = pHead(tso.lcm); … … 1310 1310 if (index % 2==0) 1311 1311 euler++; 1312 else 1312 else 1313 1313 euler--; 1314 1314 } … … 1354 1354 } 1355 1355 delete spl1; 1356 } 1356 } 1357 1357 1358 1358 /*3 … … 1368 1368 1369 1369 while ((k>0) && (res->m[k-1]==NULL)) k--; 1370 while ((i<(*syzstr->Tl)[index-1]) && (((sPairs)[i].syz==NULL) || 1370 while ((i<(*syzstr->Tl)[index-1]) && (((sPairs)[i].syz==NULL) || 1371 1371 ((sPairs)[i].order<deg))) 1372 1372 i++; 1373 1373 if ((i>=(*syzstr->Tl)[index-1]) || ((sPairs)[i].order>deg)) return; 1374 1374 while ((i<(*syzstr->Tl)[index-1]) && (((sPairs)[i].syz==NULL) || 1375 ((sPairs)[i].order==deg))) 1375 ((sPairs)[i].order==deg))) 1376 1376 { 1377 1377 if ((sPairs)[i].syz!=NULL) 1378 1378 { 1379 1379 j = k-1; 1380 while ((j>=0) && (res->m[j]!=NULL) && 1380 while ((j>=0) && (res->m[j]!=NULL) && 1381 1381 ((sPairs)[i].syz!=NULL)) 1382 1382 { … … 1384 1384 { 1385 1385 //Print("r"); 1386 (sPairs)[i].syz = 1386 (sPairs)[i].syz = 1387 1387 //spSpolyRed(res->m[j],(sPairs)[i].syz,NULL); 1388 1388 sySPolyRed((sPairs)[i].syz,res->m[j]); … … 1463 1463 { 1464 1464 int an=0,en=sP-1; 1465 loop 1465 loop 1466 1466 { 1467 1467 if (an>=en-1) … … 1537 1537 pSetComp(p,j+1); 1538 1538 ii = first; 1539 loop 1539 loop 1540 1540 { 1541 1541 j1 = bci[ii]; … … 1593 1593 { 1594 1594 int ii=index-1,jj=pGetComp(q); 1595 while (ii>0) 1595 while (ii>0) 1596 1596 { 1597 1597 jj = pGetComp(syzstr->res[ii]->m[jj-1]); … … 1641 1641 SSet result; 1642 1642 SRes resPairs=syzstr->resPairs; 1643 1643 1644 1644 if (an>syzstr->length) return NULL; 1645 1645 if (en>syzstr->length) en=syzstr->length; … … 1709 1709 { 1710 1710 t = *actdeg+*index; 1711 if (((resPairs[*index])[i].lcm!=NULL) || 1711 if (((resPairs[*index])[i].lcm!=NULL) || 1712 1712 ((resPairs[*index])[i].syz!=NULL)) 1713 1713 { … … 1722 1722 } 1723 1723 i++; 1724 } 1724 } 1725 1725 } 1726 1726 (*index)++; … … 1782 1782 * int newdeg=*actdeg,newindex=-1,i,t; 1783 1783 * SSet result; 1784 * 1784 * 1785 1785 * while (*index>=0) 1786 1786 * { … … 1863 1863 * } 1864 1864 * i++; 1865 * } 1865 * } 1866 1866 * } 1867 1867 * (*index)--; … … 1912 1912 int result; 1913 1913 1914 if (syzstr->res[index]==NULL) 1914 if (syzstr->res[index]==NULL) 1915 1915 { 1916 1916 syzstr->res[index] = idInit(init-1,1); … … 1949 1949 { 1950 1950 int i,j; 1951 1951 1952 1952 if (syzstr->resPairs!=NULL) 1953 1953 { … … 2066 2066 int i,j=-1,jj=-1,l; 2067 2067 SRes rP=syzstr->resPairs; 2068 2068 2069 2069 l = syzstr->length; 2070 2070 while ((l>0) && (rP[l-1]==NULL)) l--; … … 2074 2074 { 2075 2075 i = 0; 2076 while ((i<(*syzstr->Tl)[l]) && 2076 while ((i<(*syzstr->Tl)[l]) && 2077 2077 ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL))) 2078 2078 { 2079 if (rP[l][i].isNotMinimal==NULL) 2079 if (rP[l][i].isNotMinimal==NULL) 2080 2080 { 2081 2081 if (j<rP[l][i].order-l) … … 2094 2094 { 2095 2095 j = 0; 2096 while ((j<(*syzstr->Tl)[i]) && 2096 while ((j<(*syzstr->Tl)[i]) && 2097 2097 ((rP[i][j].lcm!=NULL) || (rP[i][j].syz!=NULL))) 2098 2098 { … … 2147 2147 { 2148 2148 SRes rP=syzstr->resPairs; 2149 2149 2150 2150 l = syzstr->length; 2151 2151 while ((l>0) && (rP[l-1]==NULL)) l--; … … 2155 2155 { 2156 2156 i = 0; 2157 while ((i<(*syzstr->Tl)[l]) && 2157 while ((i<(*syzstr->Tl)[l]) && 2158 2158 ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) && 2159 2159 (rP[l][i].isNotMinimal!=NULL)) … … 2169 2169 return l; 2170 2170 } 2171 else 2171 else 2172 2172 return sySize(syzstr); 2173 2173 } … … 2228 2228 void syPrint(syStrategy syzstr) 2229 2229 { 2230 if ((syzstr->resPairs==NULL) && (syzstr->fullres==NULL) 2230 if ((syzstr->resPairs==NULL) && (syzstr->fullres==NULL) 2231 2231 && (syzstr->minres==NULL)) 2232 2232 { … … 2246 2246 { 2247 2247 j=0; 2248 while ((j<(*syzstr->Tl)[l]) && 2248 while ((j<(*syzstr->Tl)[l]) && 2249 2249 ((rP[l][j].lcm!=NULL) || (rP[l][j].syz!=NULL))) 2250 2250 { … … 2329 2329 resolvente fullres; 2330 2330 fullres = (resolvente)Alloc0((length+1)*sizeof(ideal)); 2331 if (totake==NULL) 2331 if (totake==NULL) 2332 2332 totake = res; 2333 2333 for (i=length-1;i>0;i--) … … 2471 2471 if (toStrip==NULL) return p; 2472 2472 poly pp=p; 2473 2473 2474 2474 while ((pp!=NULL) && ((*toStrip)[pGetComp(pp)]!=0)) 2475 2475 pDelete1(&pp); 2476 2476 p = pp; 2477 if (pp!=NULL) 2477 if (pp!=NULL) 2478 2478 { 2479 2479 while (pNext(pp)!=NULL) … … 2522 2522 pGetCoeff(tq) = nNeg(pGetCoeff(tq)); 2523 2523 q = syAdd(q,syMultT1(tempStripped,tq)); 2524 } 2524 } 2525 2525 pIter(p); 2526 2526 } … … 2558 2558 { 2559 2559 ri->m[j] = ri->m[j+k]; 2560 (*changes)[j+k+1] = j+1; 2560 (*changes)[j+k+1] = j+1; 2561 2561 j++; 2562 2562 } … … 2622 2622 else 2623 2623 { 2624 if (sPairs[i].syzind<l) 2624 if (sPairs[i].syzind<l) 2625 2625 { 2626 2626 l = sPairs[i].syzind; … … 2634 2634 j++; 2635 2635 k = l; 2636 } 2636 } 2637 2637 return result; 2638 2638 } 2639 2639 2640 static resolvente syReadOutMinimalRes(syStrategy syzstr, 2640 static resolvente syReadOutMinimalRes(syStrategy syzstr, 2641 2641 BOOLEAN computeStd=FALSE) 2642 2642 { … … 2659 2659 pSetmProc oldSetm=pSetm; 2660 2660 pCompProc oldComp0=pComp0; 2661 2661 2662 2662 if ((currRing->order[0]==ringorder_dp) 2663 2663 && (currRing->order[1]==ringorder_C) … … 2684 2684 rChangeCurrRing(&tmpR, TRUE); 2685 2685 } 2686 #if ! defined(HAVE_SY_VECTOR) || defined(SY_VEC_DEBUG) 2686 #if ! defined(HAVE_SY_VECTOR) || defined(SY_VEC_DEBUG) 2687 2687 pSetm =syzSetm; 2688 2688 #endif … … 2808 2808 ring origR = currRing; 2809 2809 2810 if ((idIs0(arg)) || 2810 if ((idIs0(arg)) || 2811 2811 ((idRankFreeModule(arg)>0) && (!idHomModule(arg,NULL,&(syzstr->cw))))) 2812 2812 { … … 2833 2833 { 2834 2834 ord=NULL; 2835 } 2835 } 2836 2836 /*--- changes to a dpC-ring with special comp0------*/ 2837 2837 else … … 2851 2851 //pChangeRing(pVariables,1,ord,b0,b1,currRing->wvhdl); 2852 2852 rChangeCurrRing(&tmpR, TRUE); 2853 } 2853 } 2854 2854 /*--- initializes the data structures---------------*/ 2855 2855 syzstr->Tl = new intvec(*length); … … 2858 2858 { 2859 2859 temp->m[i] = pOrdPolyInsertSetm(pCopy(arg->m[i])); 2860 if (temp->m[i]!=NULL) 2860 if (temp->m[i]!=NULL) 2861 2861 { 2862 2862 j = pTotaldegree(temp->m[i]); … … 2870 2870 binomials = (int*)Alloc(pVariables*(highdeg+1)*sizeof(int)); 2871 2871 syBinomSet(); 2872 #if ! defined(HAVE_SY_VECTOR) || defined(SY_VEC_DEBUG) 2872 #if ! defined(HAVE_SY_VECTOR) || defined(SY_VEC_DEBUG) 2873 2873 pSetm =syzSetm; 2874 2874 for (i=0;i<IDELEMS(temp);i++) … … 2905 2905 nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg); 2906 2906 //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index); 2907 /*--- computes the resolution ----------------------*/ 2907 /*--- computes the resolution ----------------------*/ 2908 2908 while (nextPairs!=NULL) 2909 2909 { … … 2923 2923 else 2924 2924 syRedGenerOfCurrDeg(syzstr,actdeg,index+1); 2925 /*--- creates new pairs -----------------------------*/ 2925 /*--- creates new pairs -----------------------------*/ 2926 2926 syCreateNewPairs(syzstr,index,i); 2927 if (index<(*length)-1) 2927 if (index<(*length)-1) 2928 2928 { 2929 2929 syCreateNewPairs(syzstr,index+1,j); … … 2953 2953 Free((ADDRESS)b0,3*sizeof(int)); 2954 2954 Free((ADDRESS)b1,3*sizeof(int)); 2955 } 2955 } 2956 2956 syzstr->binom = binomials; 2957 2957 syzstr->highdeg_1 = highdeg_1; -
Singular/tesths.cc
r8a839d1 re0d91c 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: tesths.cc,v 1.5 1 1998-08-03 16:39:34Singular Exp $ */4 /* $Id: tesths.cc,v 1.52 1998-09-22 14:09:05 Singular Exp $ */ 5 5 6 6 /* … … 278 278 ttGen2(); 279 279 #else 280 int i;281 280 thisfile = argv[0]; 282 281 BOOLEAN load_std_lib=TRUE; … … 297 296 switch(optc) 298 297 { 299 298 300 299 case 'b': 301 #ifdef HAVE_MPSR 300 #ifdef HAVE_MPSR 302 301 feBatch=TRUE; 303 302 mainSetSingOptionValue(LON_BATCH, (char*) 1); … … 339 338 tclmode = TRUE; 340 339 mainSetSingOptionValue(LON_TCLMODE, (char*) 1); 341 340 verbose|=Sy_bit(V_SHOW_MEM); 342 341 break; 343 342 #else … … 378 377 mainSetSingOptionValue(LON_EXECUTE, optarg); 379 378 break; 380 379 381 380 case 'r': 382 381 errno = 0; … … 398 397 mainSetSingOptionValue(LON_RANDOM, optarg); 399 398 break; 400 399 401 400 case 'u': 402 401 mainSetSingOptionValue(LON_USER_OPTION, optarg); … … 436 435 mainSetSingOptionValue(LON_MP_HOST, optarg); 437 436 } 438 #endif 437 #endif 439 438 else if (strcmp(longopts[option_index].name, LON_TICKS_PER_SEC) == 0) 440 439 { … … 507 506 errorreported = 0; 508 507 #ifndef macintosh 509 #if defined(HAVE_ FEREAD) || defined(HAVE_READLINE)508 #if defined(HAVE_READLINE) 510 509 fe_set_input_mode(); 511 510 #endif
Note: See TracChangeset
for help on using the changeset viewer.