Changeset f99917f in git
- Timestamp:
- Mar 11, 1999, 4:58:09 PM (25 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 00f47bba032424d132ee7ddb27980fee77618bc3
- Parents:
- 52c2fbd6f734a6e530dac2589becda5a013ced56
- Location:
- Singular
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r52c2fb rf99917f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iparith.cc,v 1.13 3 1999-03-09 14:23:07Singular Exp $ */4 /* $Id: iparith.cc,v 1.134 1999-03-11 15:58:05 Singular Exp $ */ 5 5 6 6 /* … … 1495 1495 // Allow imap to be make an exception only for: 1496 1496 if ( (rField_is_Q_a(r) && // Q(a..) -> Q(a..) || Q || Zp || Zp(a) 1497 (rField_is_Q() || rField_is_Q_a() || 1497 (rField_is_Q() || rField_is_Q_a() || 1498 1498 (rField_is_Zp() || rField_is_Zp_a()))) 1499 1499 || 1500 1500 (rField_is_Zp_a(r) && // Zp(a..) -> Zp(a..) || Zp 1501 (rField_is_Zp(currRing, rInternalChar(r)) || 1501 (rField_is_Zp(currRing, rInternalChar(r)) || 1502 1502 rField_is_Zp_a(currRing, rInternalChar(r)))) ) 1503 1503 { … … 1975 1975 1976 1976 /*=================== operations with 2 args.: table =================*/ 1977 1977 1978 struct sValCmd2 dArith2[]= 1978 1979 { … … 2508 2509 assumeStdFlag(v); 2509 2510 ideal I=(ideal)v->Data(); 2510 BOOLEAN *UsedAxis=(BOOLEAN *)Alloc0(pVariables*sizeof(BOOLEAN)); 2511 int i,n; 2512 poly po; 2513 for(i=IDELEMS(I)-1;i>=0;i--) 2514 { 2515 po=I->m[i]; 2516 if ((po!=NULL) &&((n=pIsPurePower(po))!=0)) UsedAxis[n-1]=TRUE; 2517 } 2518 for(i=pVariables-1;i>=0;i--) 2519 { 2520 if(UsedAxis[i]==FALSE) return FALSE; // not zero-dim. 2521 } 2522 if (currRing->OrdSgn==1) 2523 { 2524 res->data=pOne(); 2525 return FALSE; 2526 } 2527 po=NULL; 2528 scComputeHC(I,0,po); 2529 if (po!=NULL) 2530 { 2531 pGetCoeff(po)=nInit(1); 2532 for (i=pVariables; i>0; i--) 2533 { 2534 if (pGetExp(po, i) > 0) pDecrExp(po,i); 2535 } 2536 pSetm(po); 2537 } 2511 res->data=(void *)iiHighCorner(I,0); 2512 return FALSE; 2513 } 2514 static BOOLEAN jjHIGHCORNER_M(leftv res, leftv v) 2515 { 2516 assumeStdFlag(v); 2517 intvec *module_w=new intvec(*(intvec*)atGet(v,"isHomog")); 2518 ideal I=(ideal)v->Data(); 2519 int i; 2520 poly p=NULL,po=NULL; 2521 int rk=idRankFreeModule(I); 2522 if (module_w==NULL) 2523 module_w = new intvec(rk); 2524 for(i=rk;i>0;i--) 2525 { 2526 p=iiHighCorner(I,i); 2527 if (p==NULL) 2528 { 2529 Werror("module must be zero-dimensional"); 2530 delete module_w; 2531 return TRUE; 2532 } 2533 if (po==NULL) 2534 po=p; 2535 else 2536 { 2537 // now po!=NULL, p!=NULL 2538 int d=(pFDeg(po)+(*module_w)[pGetComp(po)] - pFDeg(p)+ (*module_w)[i]); 2539 if (d==0) 2540 d=pComp0(po,p); 2541 if (d < 0) 2542 { 2543 pDelete(&po); po=p; 2544 } 2545 else // (d > 0) 2546 { 2547 pDelete(&p); 2548 } 2549 } 2550 } 2551 delete module_w; 2538 2552 res->data=(void *)po; 2539 2553 return FALSE; … … 3401 3415 ,{jjGETDUMP, GETDUMP_CMD, NONE, LINK_CMD } 3402 3416 ,{jjHIGHCORNER, HIGHCORNER_CMD, POLY_CMD, IDEAL_CMD } 3417 ,{jjHIGHCORNER_M, HIGHCORNER_CMD,VECTOR_CMD, MODUL_CMD } 3403 3418 ,{jjHILBERT, HILBERT_CMD, NONE, IDEAL_CMD } 3404 3419 ,{jjHILBERT, HILBERT_CMD, NONE, MODUL_CMD } -
Singular/ipshell.cc
r52c2fb rf99917f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1.3 6 1999-03-09 12:28:48 obachmanExp $ */4 /* $Id: ipshell.cc,v 1.37 1999-03-11 15:58:06 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 31 31 #include "ipconv.h" 32 32 #include "silink.h" 33 #include "stairc.h" 33 34 #include "ipshell.h" 34 35 … … 1065 1066 return FALSE; 1066 1067 } 1068 1069 poly iiHighCorner(ideal I, int ak) 1070 { 1071 BOOLEAN *UsedAxis=(BOOLEAN *)Alloc0(pVariables*sizeof(BOOLEAN)); 1072 int i,n; 1073 poly po; 1074 for(i=IDELEMS(I)-1;i>=0;i--) 1075 { 1076 po=I->m[i]; 1077 if ((po!=NULL) &&((n=pIsPurePower(po))!=0)) UsedAxis[n-1]=TRUE; 1078 } 1079 for(i=pVariables-1;i>=0;i--) 1080 { 1081 if(UsedAxis[i]==FALSE) return NULL; // not zero-dim. 1082 } 1083 if (currRing->OrdSgn== -1) 1084 { 1085 po=NULL; 1086 scComputeHC(I,ak,po); 1087 if (po!=NULL) 1088 { 1089 pGetCoeff(po)=nInit(1); 1090 for (i=pVariables; i>0; i--) 1091 { 1092 if (pGetExp(po, i) > 0) pDecrExp(po,i); 1093 } 1094 } 1095 } 1096 if (po!=NULL) 1097 { 1098 pSetComp(po,ak); 1099 pSetm(po); 1100 } 1101 return po; 1102 } -
Singular/ipshell.h
r52c2fb rf99917f 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: ipshell.h,v 1.1 5 1998-10-22 12:26:11 krueger Exp $ */6 /* $Id: ipshell.h,v 1.16 1999-03-11 15:58:07 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 71 71 void iiDebug(); 72 72 BOOLEAN iiCheckRing(int i); 73 poly iiHighCorner(ideal i, int ak); 73 74 /* ================================================================== */ 74 75 /* Expressions : */ -
Singular/matpol.cc
r52c2fb rf99917f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: matpol.cc,v 1.2 1 1999-03-08 17:30:42Singular Exp $ */4 /* $Id: matpol.cc,v 1.22 1999-03-11 15:58:08 Singular Exp $ */ 5 5 6 6 /* … … 780 780 poly sel, h; 781 781 int l, i; 782 int pos_of_1 = -1; 782 783 matrix co; 784 783 785 if (f==NULL) 784 786 { … … 795 797 for (i=l; i>=1; i--) 796 798 { 797 h = pHead(sel); 799 h = sel; 800 pIter(sel); 801 pNext(h)=NULL; 798 802 MATELEM(co,1,i) = h; 799 803 MATELEM(co,2,i) = NULL; 800 sel = sel->next;804 if (pIsConstant(h)) pos_of_1 = i; 801 805 } 802 806 } … … 805 809 for (i=1; i<=l; i++) 806 810 { 807 h = pHead(sel); 811 h = sel; 812 pIter(sel); 813 pNext(h)=NULL; 808 814 MATELEM(co,1,i) = h; 809 815 MATELEM(co,2,i) = NULL; 810 sel = sel->next;816 if (pIsConstant(h)) pos_of_1 = i; 811 817 } 812 818 } … … 816 822 loop 817 823 { 818 h = mpExdiv(f, MATELEM(co,1,i)); 819 if (h!=NULL) 820 { 821 MATELEM(co,2,i) = pAdd(MATELEM(co,2,i), h); 824 if (i!=pos_of_1) 825 { 826 h = mpExdiv(f, MATELEM(co,1,i)); 827 if (h!=NULL) 828 { 829 MATELEM(co,2,i) = pAdd(MATELEM(co,2,i), h); 830 break; 831 } 832 } 833 if (i == l) 834 { 835 // check monom 1 last: 836 h = mpExdiv(f, MATELEM(co,1,pos_of_1)); 837 if (h!=NULL) 838 { 839 MATELEM(co,2,pos_of_1) = pAdd(MATELEM(co,2,pos_of_1), h); 840 break; 841 } 822 842 break; 823 } 824 if (i < l) 825 i++; 826 else 827 break; 843 } 844 i ++; 828 845 } 829 846 pIter(f); -
Singular/ring.cc
r52c2fb rf99917f 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.4 4 1999-03-08 18:11:50Singular Exp $ */4 /* $Id: ring.cc,v 1.45 1999-03-11 15:58:09 Singular Exp $ */ 5 5 6 6 /* … … 673 673 { 674 674 int VarCompIndex, VarLowIndex, VarHighIndex; 675 675 676 676 r->VarOffset = (int*) Alloc((r->N + 1)*sizeof(int)); 677 pGetVarIndicies(r, r->VarOffset, VarCompIndex, 677 pGetVarIndicies(r, r->VarOffset, VarCompIndex, 678 678 VarLowIndex, VarHighIndex); 679 679 r->VarCompIndex = VarCompIndex; … … 732 732 733 733 if (rField_is_GF(r)) 734 PrintS("// # ground field : "); 734 { 735 Print("// # ground field : %d\n",rInternalChar(r)); 736 Print("// primitive element : %s\n", r->parameter[0]); 737 if (r==currRing) 738 { 739 StringSetS("// minpoly : "); 740 nfShowMipo();PrintS(StringAppend("\n")); 741 } 742 } 735 743 else 744 { 736 745 PrintS("// characteristic : "); 737 if ( rField_is_R(r) ) PrintS("0 (real)\n"); /* R */ 738 else Print ("%d\n",rChar(r)); /* Fp(a) */ 739 if (r->parameter!=NULL) 740 { 741 if (r->ch<2) 746 if ( rField_is_R(r) ) PrintS("0 (real)\n"); /* R */ 747 else Print ("%d\n",rChar(r)); /* Fp(a) */ 748 if (r->parameter!=NULL) 742 749 { 743 750 Print ("// %d parameter : ",rPar(r)); … … 762 769 { 763 770 PrintS("...\n"); 764 }765 }766 else767 {768 Print("// primitive element : %s\n", r->parameter[0]);769 if (r==currRing)770 {771 StringSetS("// minpoly : ");772 nfShowMipo();PrintS(StringAppend("\n"));773 771 } 774 772 } … … 1346 1344 tmpR.P=1; 1347 1345 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1348 1346 rPar(currRing)); 1349 1347 } 1350 1348 else 1351 1349 { 1352 1350 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1353 1351 rPar(currRing)); 1354 1352 WerrorS("different minpolys"); 1355 1353 return -1; … … 1367 1365 tmpR.minpoly=naCopy(r1->minpoly); 1368 1366 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1369 1367 rPar(currRing)); 1370 1368 } 1371 1369 else … … 1389 1387 tmpR.minpoly=naCopy(r2->minpoly); 1390 1388 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1391 1389 rPar(currRing)); 1392 1390 } 1393 1391 else … … 1444 1442 tmpR.minpoly=naCopy(r1->minpoly); 1445 1443 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1446 1444 rPar(currRing)); 1447 1445 } 1448 1446 } … … 1471 1469 tmpR.minpoly=naCopy(r2->minpoly); 1472 1470 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1473 1471 rPar(currRing)); 1474 1472 } 1475 1473 } … … 1507 1505 tmpR.minpoly=naCopy(r1->minpoly); 1508 1506 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1509 1507 rPar(currRing)); 1510 1508 } 1511 1509 } … … 1537 1535 tmpR.minpoly=naCopy(r2->minpoly); 1538 1536 nSetChar(rInternalChar(currRing),TRUE,currRing->parameter, 1539 1537 rPar(currRing)); 1540 1538 } 1541 1539 } … … 1920 1918 1921 1919 if (r->N == 0) return true; 1922 1920 1923 1921 if (r->VarOffset == NULL) 1924 1922 { … … 1927 1925 return false; 1928 1926 } 1929 1930 int 1931 VarCompIndex = r->VarCompIndex, 1932 VarLowIndex = r->VarLowIndex, 1927 1928 int 1929 VarCompIndex = r->VarCompIndex, 1930 VarLowIndex = r->VarLowIndex, 1933 1931 VarHighIndex = r->VarHighIndex, 1934 1932 i; 1935 1933 BOOLEAN ok = false; 1936 1934 int* VarOffset = r->VarOffset; 1937 1935 1938 1936 rComplete(r); 1939 1937 1940 1938 if ( VarCompIndex != r->VarCompIndex || 1941 1939 VarLowIndex != r->VarLowIndex || … … 1946 1944 ok = FALSE; 1947 1945 } 1948 1946 1949 1947 for (i=0; i<=r->N; i++) 1950 1948 {
Note: See TracChangeset
for help on using the changeset viewer.