Changeset ac00e2f in git
- Timestamp:
- May 14, 2014, 4:02:50 PM (10 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
- Children:
- 0f74a1d360bc1f2c80ba740d66bcf0a755b6e43d
- Parents:
- 8b5fff53b54b8c7889b6490e4871793cfd8e4efe
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/syzextra/mod_main.cc
r8b5fff rac00e2f 30 30 #include <Singular/attrib.h> 31 31 32 #include <Singular/ipid.h> 32 #include <Singular/ipid.h> 33 33 #include <Singular/ipshell.h> // For iiAddCproc 34 34 … … 45 45 46 46 47 #if GOOGLE_PROFILE_ENABLED 47 #if GOOGLE_PROFILE_ENABLED 48 48 #include <google/profiler.h> 49 #endif // #if GOOGLE_PROFILE_ENABLED 49 #endif // #if GOOGLE_PROFILE_ENABLED 50 50 51 51 … … 84 84 85 85 const char *usage = "'ClearContent' needs a (non-zero!) poly or vector argument..."; 86 86 87 87 if( h == NULL ) 88 88 { … … 100 100 101 101 assume (h->Next() == NULL); 102 102 103 103 poly ph = reinterpret_cast<poly>(h->Data()); 104 104 105 105 if( ph == NULL ) 106 106 { … … 108 108 return TRUE; 109 109 } 110 110 111 111 const ring r = currRing; 112 112 assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf; … … 185 185 } 186 186 187 return (_n); 187 return (_n); 188 188 } 189 189 … … 201 201 { 202 202 const char* name = (char*)(h->Data()); 203 assume( name != NULL ); 203 assume( name != NULL ); 204 204 ProfilerStart(name); 205 205 } else 206 WerrorS("ProfilerStart requires a string [name] argument"); 206 WerrorS("ProfilerStart requires a string [name] argument"); 207 207 #else 208 208 WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLE!=1)..."); … … 249 249 } 250 250 251 251 252 252 253 253 static BOOLEAN DetailedPrint(leftv __res, leftv h) … … 263 263 if( h->Typ() == NUMBER_CMD) 264 264 { 265 number n = (number)h->Data(); 265 number n = (number)h->Data(); 266 266 267 267 const ring r = currRing; … … 278 278 return FALSE; 279 279 } 280 280 281 281 if( h->Typ() == RING_CMD) 282 282 { … … 301 301 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) 302 302 { 303 const ideal id = (const ideal)h->Data(); h = h->Next(); 303 const ideal id = (const ideal)h->Data(); h = h->Next(); 304 304 305 305 dPrint(id, currRing, currRing, getOptionalInteger(h, 3)); 306 307 return FALSE; 306 307 return FALSE; 308 308 } 309 309 … … 344 344 if (r == NULL) 345 345 Print("ring '%10s': NULL", "syRing"); 346 else 346 else 347 347 if (r == currRing) 348 348 Print("ring '%10s': currRing", "syRing"); … … 356 356 #endif 357 357 // rChangeCurrRing(r); 358 } 358 } 359 359 PrintLn(); 360 360 … … 489 489 490 490 h = h->Next(); assume (h == NULL); 491 491 492 492 return FALSE; 493 493 } … … 495 495 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) 496 496 { 497 res->data = id_Tail( (const ideal)h->Data(), r ); 497 res->data = id_Tail( (const ideal)h->Data(), r ); 498 498 res->rtyp = h->Typ(); 499 499 500 500 h = h->Next(); assume (h == NULL); 501 501 502 502 return FALSE; 503 503 } … … 512 512 { 513 513 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 514 514 515 515 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 516 516 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; … … 528 528 } 529 529 530 assume( h != NULL ); 530 assume( h != NULL ); 531 531 532 532 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) … … 538 538 if( __DEBUG__ ) 539 539 { 540 PrintS("ComputeLeadingSyzygyTerms::Input: \n"); 540 PrintS("ComputeLeadingSyzygyTerms::Input: \n"); 541 541 dPrint(id, r, r, 1); 542 542 } 543 543 544 544 assume( !__LEAD2SYZ__ ); 545 545 … … 547 547 548 548 const ideal newid = ComputeLeadingSyzygyTerms(id, attributes); 549 549 550 550 res->data = newid; res->rtyp = MODUL_CMD; 551 551 return FALSE; … … 580 580 } 581 581 582 assume( h != NULL ); 582 assume( h != NULL ); 583 583 584 584 if( (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) 585 585 && (h->rtyp == IDHDL) // must be a variable! 586 586 && (h->e == NULL) // not a list element 587 ) 587 ) 588 588 { 589 589 const ideal id = (const ideal)h->Data(); … … 594 594 { 595 595 PrintS("Sort_c_ds::Input: \n"); 596 dPrint(id, r, r, 1); 596 dPrint(id, r, r, 1); 597 597 } 598 598 … … 605 605 // res->data = id; 606 606 // res->rtyp = h->Typ(); 607 607 608 608 if( __DEBUG__ ) 609 609 { … … 617 617 618 618 WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument (must be a variable!)..."); 619 return TRUE; 619 return TRUE; 620 620 } 621 621 … … 640 640 } 641 641 642 assume( h != NULL ); 642 assume( h != NULL ); 643 643 644 644 assume( __LEAD2SYZ__ ); // ??? 645 645 646 646 if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) 647 647 { … … 690 690 { 691 691 WerrorS(usage); 692 return TRUE; 693 } 694 692 return TRUE; 693 } 694 695 695 const poly product = (poly) h->Data(); assume (product != NULL); 696 696 … … 700 700 { 701 701 WerrorS(usage); 702 return TRUE; 702 return TRUE; 703 703 } 704 704 705 705 poly syzterm = NULL; 706 706 707 if(h->Typ()==VECTOR_CMD) 707 if(h->Typ()==VECTOR_CMD) 708 708 syzterm = (poly) h->Data(); 709 709 … … 714 714 { 715 715 WerrorS(usage); 716 return TRUE; 717 } 718 716 return TRUE; 717 } 718 719 719 const ideal L = (ideal) h->Data(); h = h->Next(); 720 720 … … 758 758 PrintS("FindReducer::Output: \n"); 759 759 dPrint((poly)res->data, r, r, 2); 760 } 761 762 return FALSE; 763 760 } 761 762 return FALSE; 763 764 764 } 765 765 … … 781 781 782 782 assume( __HYBRIDNF__ ); // ??? 783 783 784 784 if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL)) 785 785 { 786 786 WerrorS(usage); 787 return TRUE; 787 return TRUE; 788 788 } 789 789 … … 795 795 { 796 796 WerrorS(usage); 797 return TRUE; 797 return TRUE; 798 798 } 799 799 … … 804 804 { 805 805 WerrorS(usage); 806 return TRUE; 806 return TRUE; 807 807 } 808 808 … … 814 814 { 815 815 WerrorS(usage); 816 return TRUE; 816 return TRUE; 817 817 } 818 818 … … 851 851 PrintS("LS: "); dPrint(LS, r, r, 0); 852 852 } 853 } 854 853 } 854 855 855 res->rtyp = VECTOR_CMD; 856 856 res->data = SchreyerSyzygyNF(syz_lead, … … 889 889 { 890 890 WerrorS(usage); 891 return TRUE; 891 return TRUE; 892 892 } 893 893 894 894 const poly multiplier = (poly) h->Data(); assume (multiplier != NULL); 895 895 896 896 897 897 h = h->Next(); 898 898 if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL)) 899 899 { 900 900 WerrorS(usage); 901 return TRUE; 901 return TRUE; 902 902 } 903 903 904 904 const poly term4reduction = (poly) h->Data(); assume( term4reduction != NULL ); 905 905 906 906 907 907 poly syztermCheck = NULL; 908 908 909 909 h = h->Next(); 910 910 if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) ) 911 911 { 912 912 WerrorS(usage); 913 return TRUE; 914 } 915 916 if(h->Typ()==VECTOR_CMD) 913 return TRUE; 914 } 915 916 if(h->Typ()==VECTOR_CMD) 917 917 syztermCheck = (poly) h->Data(); 918 918 919 919 920 920 h = h->Next(); 921 921 if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) 922 922 { 923 923 WerrorS(usage); 924 return TRUE; 924 return TRUE; 925 925 } 926 926 927 927 const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 ); 928 928 929 929 930 930 h = h->Next(); 931 931 if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) 932 932 { 933 933 WerrorS(usage); 934 return TRUE; 934 return TRUE; 935 935 } 936 936 … … 960 960 PrintS("t: "); dPrint(term4reduction, r, r, 2); 961 961 PrintS("syzterm: "); dPrint(syztermCheck, r, r, 2); 962 962 963 963 PrintS("L: "); dPrint(L, r, r, 0); 964 964 PrintS("T: "); dPrint(T, r, r, 0); … … 977 977 const int c = p_GetComp(syztermCheck, r) - 1; 978 978 assume( c >= 0 && c < IDELEMS(L) ); 979 979 980 980 const poly p = L->m[c]; 981 assume( p != NULL ); assume( pNext(p) == NULL ); 981 assume( p != NULL ); assume( pNext(p) == NULL ); 982 982 983 983 assume( p_EqualPolys(term4reduction, p, r) ); // assume? TODO … … 989 989 assume( p_EqualPolys(multiplier, m, r) ); // assume? TODO 990 990 991 p_Delete(&m, r); 992 991 p_Delete(&m, r); 992 993 993 // NOTE: leadmonomial(syzterm) == m && L[leadcomp(syzterm)] == t 994 994 } … … 1004 1004 dPrint((poly)res->data, r, r, 2); 1005 1005 } 1006 1007 1006 1007 1008 1008 return FALSE; 1009 1009 } … … 1031 1031 { 1032 1032 WerrorS(usage); 1033 return TRUE; 1033 return TRUE; 1034 1034 } 1035 1035 … … 1040 1040 { 1041 1041 WerrorS(usage); 1042 return TRUE; 1043 } 1044 1045 const poly tail = (poly) h->Data(); 1042 return TRUE; 1043 } 1044 1045 const poly tail = (poly) h->Data(); 1046 1046 1047 1047 h = h->Next(); … … 1050 1050 { 1051 1051 WerrorS(usage); 1052 return TRUE; 1052 return TRUE; 1053 1053 } 1054 1054 … … 1061 1061 { 1062 1062 WerrorS(usage); 1063 return TRUE; 1063 return TRUE; 1064 1064 } 1065 1065 … … 1069 1069 1070 1070 h = h->Next(); 1071 1071 1072 1072 ideal LS = NULL; 1073 1073 … … 1118 1118 { 1119 1119 const SchreyerSyzygyComputationFlags attributes(currRingHdl); 1120 1120 1121 1121 const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 1122 1122 1123 1123 const char* usage = "`ComputeResolution(<ideal/module>[,int])` expected"; 1124 1124 const ring r = attributes.m_rBaseRing; … … 1130 1130 { 1131 1131 WerrorS(usage); 1132 return TRUE; 1132 return TRUE; 1133 1133 } 1134 1134 … … 1144 1144 { 1145 1145 WerrorS(usage); 1146 return TRUE; 1147 } 1148 1146 return TRUE; 1147 } 1148 1149 1149 ideal L = (ideal)(h->CopyD()); // no copy! 1150 1150 assume( IDELEMS(L) == size ); 1151 1151 1152 1152 h = h->Next(); 1153 1153 if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) 1154 1154 { 1155 1155 WerrorS(usage); 1156 return TRUE; 1156 return TRUE; 1157 1157 } 1158 1158 1159 1159 ideal T = (ideal)(h->CopyD()); // no copy! 1160 1160 assume( IDELEMS(T) == size ); 1161 1161 1162 1162 h = h->Next(); 1163 1163 1164 1164 // length..? 1165 1165 long length = 0; 1166 1166 1167 1167 if ((h!=NULL) && (h->Typ()==INT_CMD)) 1168 1168 { … … 1170 1170 h = h->Next(); 1171 1171 } 1172 1172 1173 1173 assume( h == NULL ); 1174 1174 1175 1175 if( length <= 0 ) 1176 length = 1 + rVar(r); 1176 length = 1 + rVar(r); 1177 1177 1178 1178 if( __DEBUG__ ) … … 1187 1187 1188 1188 syStrategy _res=(syStrategy)omAlloc0(sizeof(ssyStrategy)); 1189 1189 1190 1190 // class ssyStrategy; typedef ssyStrategy * syStrategy; 1191 1191 // typedef ideal * resolvente; … … 1198 1198 // if (attributes.__TREEOUTPUT__) 1199 1199 // Print("{ \"RESOLUTION: HYBRIDNF:%d, TAILREDSYZ: %d, LEAD2SYZ: %d, IGNORETAILS: %d\": [\n", attributes.__HYBRIDNF__, attributes.__TAILREDSYZ__, attributes.__LEAD2SYZ__, attributes.__IGNORETAILS__); 1200 1200 1201 1201 while( (!idIs0(L)) && (index < length)) 1202 1202 { 1203 1203 attributes.nextSyzygyLayer(); 1204 ideal LL, TT; 1205 1204 ideal LL, TT; 1205 1206 1206 ComputeSyzygy(L, T, LL, TT, attributes); 1207 1207 … … 1215 1215 1216 1216 assume( size == IDELEMS(TT) ); 1217 1217 1218 1218 id_Delete(&L, r); id_Delete(&T, r); 1219 1219 1220 1220 L = LL; T = TT; 1221 1221 1222 1222 // id_Add(T, L, r); 1223 1223 M = idInit(size, 0); … … 1227 1227 } 1228 1228 M->rank = id_RankFreeModule(M, r); 1229 1229 1230 1230 if( __DEBUG__ ) 1231 1231 { … … 1233 1233 PrintS("M = LL + TT: \n"); dPrint(M, r, r, 0); 1234 1234 } 1235 1235 1236 1236 _res->fullres[index++] = M; // ??? 1237 1237 } … … 1240 1240 1241 1241 id_Delete(&L, r); id_Delete(&T, r); 1242 1242 1243 1243 res->data = _res; 1244 1244 res->rtyp = RESOLUTION_CMD; … … 1253 1253 1254 1254 // omFreeSize(_res, sizeof(ssyStrategy)); 1255 1255 1256 1256 return FALSE; 1257 1257 … … 1280 1280 { 1281 1281 WerrorS(usage); 1282 return TRUE; 1282 return TRUE; 1283 1283 } 1284 1284 … … 1291 1291 { 1292 1292 WerrorS(usage); 1293 return TRUE; 1293 return TRUE; 1294 1294 } 1295 1295 … … 1298 1298 1299 1299 1300 h = h->Next(); assume( h == NULL ); 1300 h = h->Next(); assume( h == NULL ); 1301 1301 1302 1302 if( __DEBUG__ ) … … 1317 1317 1318 1318 l->m[1].rtyp = MODUL_CMD; l->m[1].data = reinterpret_cast<void *>(TT); 1319 1319 1320 1320 res->data = l; res->rtyp = LIST_CMD; 1321 1321 1322 1322 if( __DEBUG__ ) 1323 1323 { … … 1374 1374 } else 1375 1375 res->data = reinterpret_cast<void *>(jjLONG2N(0)); 1376 1376 1377 1377 1378 1378 res->rtyp = BIGINT_CMD; … … 1432 1432 res->data = reinterpret_cast<void *>(rAssure_SyzComp(currRing, TRUE)); 1433 1433 res->rtyp = RING_CMD; // return new ring! 1434 // QRING_CMD? 1434 // QRING_CMD? 1435 1435 1436 1436 return FALSE; … … 1455 1455 } 1456 1456 1457 sign = s; 1457 sign = s; 1458 1458 } 1459 1459 … … 1461 1461 res->data = reinterpret_cast<void *>(rAssure_InducedSchreyerOrdering(currRing, TRUE, sign)); 1462 1462 res->rtyp = RING_CMD; // return new ring! 1463 // QRING_CMD? 1463 // QRING_CMD? 1464 1464 return FALSE; 1465 1465 } … … 1521 1521 1522 1522 1523 1523 1524 1524 lists l=(lists)omAllocBin(slists_bin); 1525 1525 l->Init(2); … … 1552 1552 1553 1553 1554 /* // the following turned out to be unnecessary... 1554 /* // the following turned out to be unnecessary... 1555 1555 /// Finds p^th AM ordering, and returns its position in r->typ[] AND 1556 1556 /// corresponding &r->wvhdl[] … … 1605 1605 // { 1606 1606 // NoReturn(res); 1607 // 1607 // 1608 1608 // const ring r = currRing; 1609 // 1609 // 1610 1610 // int p = 0; // which IS-block? p^th! 1611 // 1611 // 1612 1612 // if ((h!=NULL) && (h->Typ()==INT_CMD)) 1613 1613 // p = (int)((long)(h->Data())); h=h->next; 1614 // 1614 // 1615 1615 // assume(p >= 0); 1616 // 1616 // 1617 1617 // int d, w; 1618 // 1618 // 1619 1619 // if( !rGetAMPos(r, p, d, w, TRUE) ) 1620 1620 // { … … 1622 1622 // return TRUE; 1623 1623 // } 1624 // 1624 // 1625 1625 // assume( r->typ[d].ord_typ == ro_am ); 1626 1626 // assume( r->order[w] == ringorder_am ); 1627 // 1628 // 1627 // 1628 // 1629 1629 // const short start = r->typ[d].data.am.start; // bounds of ordering (in E) 1630 1630 // const short end = r->typ[d].data.am.end; … … 1632 1632 // const int *weights = r->typ[d].data.am.weights; // pointers into wvhdl field of length (end-start+1) + len_gen 1633 1633 // // contents w_1,... w_n, len, mod_w_1, .. mod_w_len, 0 1634 // 1634 // 1635 1635 // assume( weights == r->wvhdl[w] ); 1636 // 1637 // 1636 // 1637 // 1638 1638 // lists l=(lists)omAllocBin(slists_bin); 1639 1639 // l->Init(2); 1640 // 1640 // 1641 1641 // const short V = end-start+1; 1642 1642 // intvec* ww_vars = new intvec(V); 1643 1643 // intvec* ww_gens = new intvec(len_gen); 1644 // 1644 // 1645 1645 // for (int i = 0; i < V; i++ ) 1646 1646 // (*ww_vars)[i] = weights[i]; 1647 // 1647 // 1648 1648 // assume( weights[V] == len_gen ); 1649 // 1649 // 1650 1650 // for (int i = 0; i < len_gen; i++ ) 1651 1651 // (*ww_gens)[i] = weights[i - V - 1]; 1652 // 1653 // 1652 // 1653 // 1654 1654 // l->m[0].rtyp = INTVEC_CMD; 1655 1655 // l->m[0].data = reinterpret_cast<void *>(ww_vars); 1656 // 1656 // 1657 1657 // l->m[1].rtyp = INTVEC_CMD; 1658 1658 // l->m[1].data = reinterpret_cast<void *>(ww_gens); 1659 // 1660 // 1659 // 1660 // 1661 1661 // return FALSE; 1662 // 1662 // 1663 1663 // } 1664 1664 */ … … 1782 1782 1783 1783 if ( ( (h!=NULL) && (h->Typ()== INT_CMD) ) ) 1784 iLazyReduce = (int)((long)(h->Data())); 1785 1786 res->data = (void *)kNFLength(M, curr Quotient, v, iSyzComp, iLazyReduce); // NOTE: currRing :(1784 iLazyReduce = (int)((long)(h->Data())); 1785 1786 res->data = (void *)kNFLength(M, currRing->qideal, v, iSyzComp, iLazyReduce); // NOTE: currRing :( 1787 1787 return FALSE; 1788 1788 } … … 1830 1830 iComp = id_RankFreeModule(r->typ[posIS].data.is.F, r); // ; 1831 1831 } 1832 1832 1833 1833 assume(iComp >= 0); 1834 1834 … … 1838 1838 1839 1839 // int add_row_shift = 0; 1840 // 1840 // 1841 1841 if (w!=NULL) 1842 1842 { 1843 1843 w = ivCopy(w); 1844 1844 // add_row_shift = ww->min_in(); 1845 // 1845 // 1846 1846 // (*ww) -= add_row_shift; 1847 // 1848 // if (idTestHomModule(I, curr Quotient, ww))1847 // 1848 // if (idTestHomModule(I, currRing->qideal, ww)) 1849 1849 // { 1850 1850 hom = isHomog; … … 1867 1867 1868 1868 ideal J = // idPrepare( I, hom, iComp, &w); 1869 kStd(I, curr Quotient, hom, &w, NULL, iComp);1869 kStd(I, currRing->qideal, hom, &w, NULL, iComp); 1870 1870 1871 1871 idTest(J); … … 1892 1892 const poly p = reinterpret_cast<poly>(h->Data()); 1893 1893 1894 1894 1895 1895 pTest(p); pWrite(p); PrintLn(); 1896 1896 1897 1898 p_Content( p, currRing); 1897 1898 p_Content( p, currRing); 1899 1899 1900 1900 pTest(p); 1901 1901 pWrite(p); PrintLn(); 1902 1902 1903 1903 NoReturn(res); 1904 1904 return FALSE; … … 1908 1908 { 1909 1909 int ret = 0; 1910 1910 1911 1911 if ( (h!=NULL) && (h->Typ()!=INT_CMD) ) 1912 1912 { … … 1922 1922 } 1923 1923 1924 1924 1925 1925 1926 1926 END_NAMESPACE 1927 1927 1928 1928 1929 int SI_MOD_INIT(syzextra)(SModulFunctions* psModulFunctions) 1929 int SI_MOD_INIT(syzextra)(SModulFunctions* psModulFunctions) 1930 1930 { 1931 1931 … … 1985 1985 // ADD("", FALSE, ); 1986 1986 1987 #undef ADD 1987 #undef ADD 1988 1988 return 0; 1989 1989 } 1990 1990 1991 1991 #ifndef EMBED_PYTHON 1992 extern "C" { 1992 extern "C" { 1993 1993 int mod_init(SModulFunctions* psModulFunctions) 1994 { 1995 return SI_MOD_INIT(syzextra)(psModulFunctions); 1994 { 1995 return SI_MOD_INIT(syzextra)(psModulFunctions); 1996 1996 } 1997 1997 } -
Singular/dyn_modules/syzextra/myNF.cc
r8b5fff rac00e2f 1 1 // -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 2 /*****************************************************************************\ 3 * Computer Algebra System SINGULAR 3 * Computer Algebra System SINGULAR 4 4 \*****************************************************************************/ 5 5 /** @file DebugPrint.cc 6 * 6 * 7 7 * Here we implement dPrint-s. 8 8 * … … 303 303 pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing); 304 304 305 if(Q == curr Quotient)305 if(Q == currRing->qideal) 306 306 Q = SCAQuotient(currRing); 307 307 } -
Singular/dyn_modules/syzextra/syzextra.cc
r8b5fff rac00e2f 1 1 // -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 2 /*****************************************************************************\ 3 * Computer Algebra System SINGULAR 3 * Computer Algebra System SINGULAR 4 4 \*****************************************************************************/ 5 5 /** @file syzextra.cc 6 * 6 * 7 7 * Here we implement the Computation of Syzygies 8 8 * … … 50 50 #include <Singular/attrib.h> 51 51 52 #include <Singular/ipid.h> 52 #include <Singular/ipid.h> 53 53 #include <Singular/ipshell.h> // For iiAddCproc 54 54 … … 73 73 static int cmp_c_ds(const void *p1, const void *p2) 74 74 { 75 void *R = currRing; 75 void *R = currRing; 76 76 #endif 77 77 … … 151 151 } 152 152 153 return 0; 154 } 155 156 153 return 0; 154 } 155 156 157 157 static int cmp_poly(const poly &a, const poly &b) 158 158 { … … 171 171 assume( p_GetComp(a, r) == 0 ); 172 172 assume( p_GetComp(b, r) == 0 ); 173 173 174 174 #ifndef NDEBUG 175 175 const int __DEBUG__ = 0; … … 198 198 } 199 199 200 return 0; 201 } 202 200 return 0; 201 } 202 203 203 END_NAMESPACE 204 204 /* namespace SORT_c_ds */ … … 213 213 return; 214 214 } 215 215 216 216 assume( r != NULL ); 217 217 const coeffs C = r->cf; assume(C != NULL); … … 221 221 222 222 do { 223 assume( p != NULL ); 224 223 assume( p != NULL ); 224 225 225 // write coef... 226 226 number& n = p_GetCoeff(p, r); 227 227 228 228 n_Normalize(n, C); 229 229 230 230 BOOLEAN writeMult = FALSE; ///< needs * before pp or module generator 231 231 232 232 BOOLEAN writeOne = FALSE; ///< need to write something after '-'! 233 233 234 234 if( n_IsZero(n, C) ) 235 235 { … … 237 237 // return; // yes? 238 238 } 239 239 240 240 if (n_IsMOne(n, C)) 241 { 241 { 242 242 PrintS(" - "); writeOne = TRUE; writePlus = FALSE; 243 } 243 } 244 244 else if (!n_IsOne(n, C)) 245 245 { 246 246 if( writePlus && n_GreaterZero(n, C) ) 247 247 PrintS(" + "); 248 249 StringSetS(""); n_WriteLong(n, C); 250 if (true) 248 249 StringSetS(""); n_WriteLong(n, C); 250 if (true) 251 251 { 252 252 char *s = StringEndS(); PrintS(s); omFree(s); 253 253 } 254 255 254 255 256 256 writeMult = TRUE; 257 257 writePlus = TRUE; 258 258 } else 259 259 writeOne = TRUE; 260 260 261 261 // missing '1' if no PP and gen...!? 262 262 // write monom... … … 268 268 { 269 269 const long ee = p_GetExp(p, i+1, r); 270 270 271 271 if (ee!=0L) 272 272 { … … 285 285 else 286 286 Print(" %s ", rRingVar(i, r)); 287 287 288 288 writeOne = FALSE; 289 289 wrotePP = TRUE; … … 292 292 293 293 writePlus = writePlus || wrotePP; 294 writeMult = writeMult || wrotePP; 294 writeMult = writeMult || wrotePP; 295 295 296 296 // write module gen... 297 297 const long comp = p_GetComp(p, r); 298 298 299 299 if (comp > 0 ) 300 300 { 301 301 if (writeMult) 302 302 PrintS(" \\\\cdot "); 303 else 303 else 304 304 if( writePlus ) 305 305 PrintS(" + "); … … 309 309 else 310 310 Print(" \\\\GENP{%ld} ", comp); 311 312 writeOne = FALSE; 313 } 314 311 312 writeOne = FALSE; 313 } 314 315 315 if ( writeOne ) 316 316 PrintS( writePlus? " + 1 " : " 1 " ); 317 317 318 318 319 319 pIter(p); 320 320 321 321 writePlus = TRUE; 322 322 } while( (!bLTonly) && (p != NULL) ); 323 324 } 325 326 327 328 329 323 324 } 325 326 327 328 329 330 330 /// return a new term: leading coeff * leading monomial of p 331 331 /// with 0 leading component! … … 346 346 p_Setm(m, r); 347 347 348 348 349 349 assume( m != NULL ); 350 350 assume( pNext(m) == NULL ); 351 351 assume( p_LmTest(m, r) ); 352 352 353 353 if( bSetZeroComp ) 354 354 assume( p_GetComp(m, r) == 0 ); … … 359 359 360 360 361 361 362 362 poly p_Tail(const poly p, const ring r) 363 363 { … … 375 375 376 376 const ideal newid = idInit(IDELEMS(id),id->rank); 377 377 378 378 for (int i=IDELEMS(id) - 1; i >= 0; i--) 379 379 newid->m[i] = p_Tail( id->m[i], r ); … … 381 381 newid->rank = id_RankFreeModule(newid, currRing); 382 382 383 return newid; 383 return newid; 384 384 } 385 385 … … 395 395 #define qsort_my(m, s, ss, r, cmp) qsort_r(m, s, ss, cmp) 396 396 #endif 397 397 398 398 if( sizeNew >= 2 ) 399 399 qsort_my(id->m, sizeNew, sizeof(poly), r, FROM_NAMESPACE(SORT_c_ds, cmp_c_ds)); … … 408 408 { 409 409 extern void id_Delete (ideal*, const ring); 410 410 411 411 id_Delete(const_cast<ideal*>(&m_idTails), m_rBaseRing); // TODO!!! 412 412 … … 422 422 m_spoly_bucket = NULL; 423 423 } 424 424 425 425 for( TCache::iterator it = m_cache.begin(); it != m_cache.end(); it++ ) 426 426 { 427 427 TP2PCache& T = it->second; 428 428 429 429 for(TP2PCache::iterator vit = T.begin(); vit != T.end(); vit++ ) 430 { 430 { 431 431 p_Delete( (&(vit->second)), m_rBaseRing); 432 432 p_Delete( const_cast<poly*>(&(vit->first)), m_rBaseRing); … … 465 465 CReducersHash::const_iterator itr = m_hash.find(comp); 466 466 467 if ( itr == m_hash.end() ) 467 if ( itr == m_hash.end() ) 468 468 return 2; // no such leading component!!! 469 469 470 470 assume( itr->first == comp ); 471 472 const bool bIdealCase = (comp == 0); 471 472 const bool bIdealCase = (comp == 0); 473 473 const bool bSyzCheck = syzChecker.IsNonempty(); // need to check even in ideal case????? proof? "&& !bIdealCase" 474 474 … … 485 485 const poly p = (*vit)->m_lt; 486 486 487 assume( p_GetComp(p, r) == comp ); 487 assume( p_GetComp(p, r) == comp ); 488 488 489 489 // TODO: check if coprime with Leads... if __TAILREDSYZ__ ! 490 490 for( int var = N; var > 0; --var ) 491 491 if( (p_GetExp(p, var, r) != 0) && (p_GetExp(t, var, r) != 0) ) 492 { 492 { 493 493 #ifndef NDEBUG 494 494 if( __DEBUG__ | 0) 495 { 495 { 496 496 PrintS("CReducerFinder::PreProcessTerm, 't' is NOT co-prime with the following leading term: \n"); 497 497 dPrint(p, r, r, 1); 498 498 } 499 #endif 499 #endif 500 500 coprime = false; // t not coprime with p! 501 501 break; … … 513 513 #ifndef NDEBUG 514 514 if( __DEBUG__ && !coprime) 515 { 515 { 516 516 PrintS("CReducerFinder::PreProcessTerm, 't' is co-prime with p but may lead to NOT divisible syz.term: \n"); 517 517 dPrint(ss, r, r, 1); 518 518 } 519 519 #endif 520 520 521 521 p_LmDelete(&ss, r); // deletes coeff as well??? 522 522 } … … 528 528 PrintS("CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n"); 529 529 #endif 530 531 return coprime? 3: 0; // t was coprime with all of leading terms!!! 530 531 return coprime? 3: 0; // t was coprime with all of leading terms!!! 532 532 533 533 } … … 536 536 return 0; 537 537 } 538 539 538 539 540 540 void SchreyerSyzygyComputation::SetUpTailTerms() 541 541 { 542 const ideal idTails = m_idTails; 542 const ideal idTails = m_idTails; 543 543 assume( idTails != NULL ); 544 544 assume( idTails->m != NULL ); … … 557 557 for( int p = IDELEMS(idTails) - 1; p >= 0; --p ) 558 558 for( poly* tt = &(idTails->m[p]); (*tt) != NULL; ) 559 { 559 { 560 560 const poly t = *tt; 561 561 const int k = m_div.PreProcessTerm(t, m_checker); // 0..3 … … 565 565 pp[k]++; 566 566 #endif 567 567 568 568 if( k ) 569 569 { 570 570 #ifndef NDEBUG 571 571 if( __DEBUG__) 572 { 572 { 573 573 Print("SchreyerSyzygyComputation::SetUpTailTerms(): PP (%d) the following TT: \n", k); 574 574 dPrint(t, r, r, 1); … … 577 577 578 578 (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next... 579 } 580 else 579 } 580 else 581 581 tt = &pNext(t); // go next? 582 582 … … 588 588 Print("%% **!!** SchreyerSyzygyComputation::SetUpTailTerms()::PreProcessing(): X: {c: %lu, C: %lu, P: %lu} + %lu\n", pp[1], pp[2], pp[3], pp[0]); 589 589 #endif 590 590 591 591 #ifndef NDEBUG 592 592 if( !__TREEOUTPUT__ ) … … 597 597 } 598 598 #endif 599 600 } 601 /* 599 600 } 601 /* 602 602 m_idTailTerms.resize( IDELEMS(idTails) ); 603 603 604 604 for( unsigned int p = IDELEMS(idTails) - 1; p >= 0; p -- ) 605 605 { … … 609 609 610 610 unsigned int pp = 0; 611 611 612 612 while( t != NULL ) 613 613 { 614 614 assume( t != NULL ); 615 615 // TODO: compute L:t! 616 // ideal reducers; 616 // ideal reducers; 617 617 // CReducerFinder m_reducers 618 618 619 619 CTailTerm* d = v[pp] = new CTailTerm(); 620 620 621 621 ++pp; pIter(t); 622 622 } … … 649 649 if( size < 2 ) 650 650 { 651 const ideal newid = idInit(1, 0); newid->m[0] = NULL; // zero ideal... 651 const ideal newid = idInit(1, 0); newid->m[0] = NULL; // zero ideal... 652 652 return newid; 653 653 } … … 745 745 const ring& r = m_rBaseRing; 746 746 // const SchreyerSyzygyComputationFlags& attributes = m_atttributes; 747 747 748 748 // const BOOLEAN __DEBUG__ = attributes.__DEBUG__; 749 749 // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; … … 751 751 // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; 752 752 // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; 753 753 754 754 755 755 // 1. set of components S? … … 762 762 if( size < 2 ) 763 763 { 764 const ideal newid = idInit(1, 1); newid->m[0] = NULL; // zero module... 764 const ideal newid = idInit(1, 1); newid->m[0] = NULL; // zero module... 765 765 return newid; 766 766 } … … 768 768 769 769 // TODO/NOTE: input is supposed to be sorted wrt "C,ds"!?? 770 770 771 771 // components should come in groups: count elements in each group 772 772 // && estimate the real size!!! … … 863 863 // TEST_OPT_REDTAIL 864 864 assume( r == currRing ); 865 865 866 866 BITSET _save_test; SI_SAVE_OPT1(_save_test); 867 867 SI_RESTORE_OPT1(Sy_bit(OPT_REDTAIL) | Sy_bit(OPT_REDSB) | _save_test); 868 868 869 869 intvec* w=new intvec(IDELEMS(newid)); 870 ideal tmp = kStd(newid, curr Quotient, isHomog, &w);870 ideal tmp = kStd(newid, currRing->qideal, isHomog, &w); 871 871 delete w; 872 872 … … 887 887 888 888 Sort_c_ds(newid, r); 889 889 890 890 return newid; 891 891 } … … 898 898 const ring& R = m_rBaseRing; 899 899 900 const int r = p_GetComp(a, R) - 1; 900 const int r = p_GetComp(a, R) - 1; 901 901 902 902 assume( r >= 0 && r < IDELEMS(T) ); 903 903 assume( r >= 0 && r < IDELEMS(L) ); 904 905 assume( a != NULL ); 904 905 assume( a != NULL ); 906 906 907 907 if( __TREEOUTPUT__ ) … … 909 909 PrintS("{ \"nodelabel\": \""); writeLatexTerm(a, R); PrintS("\", \"children\": ["); 910 910 } 911 911 912 912 913 913 poly aa = leadmonom(a, R); assume( aa != NULL); // :( 914 914 915 poly t = TraverseTail(aa, r); 916 915 poly t = TraverseTail(aa, r); 916 917 917 if( a2 != NULL ) 918 918 { … … 929 929 assume( r2 >= 0 && r2 < IDELEMS(T) ); 930 930 931 t = p_Add_q(a2, p_Add_q(t, TraverseTail(aa2, r2), R), R); 931 t = p_Add_q(a2, p_Add_q(t, TraverseTail(aa2, r2), R), R); 932 932 933 933 p_Delete(&aa2, R); 934 934 935 935 if( __TREEOUTPUT__ ) 936 936 PrintS("]},"); … … 946 946 { 947 947 PrintS("], \"noderesult\": \""); writeLatexTerm(t, R, true, false); PrintS("\" },"); 948 } 948 } 949 949 return t; 950 950 } … … 971 971 assume( IDELEMS(L) == IDELEMS(T) ); 972 972 #ifndef NDEBUG 973 int t, r; 973 int t, r; 974 974 #endif 975 975 976 976 if( __TREEOUTPUT__ ) 977 977 { 978 Print("\n{ \"syzygylayer\": \"%d\", \"hybridnf\": \"%d\", \"diagrams\": \n[", __SYZNUMBER__, __HYBRIDNF__ ); 979 } 980 978 Print("\n{ \"syzygylayer\": \"%d\", \"hybridnf\": \"%d\", \"diagrams\": \n[", __SYZNUMBER__, __HYBRIDNF__ ); 979 } 980 981 981 if( m_syzLeads == NULL ) 982 { 982 { 983 983 #ifndef NDEBUG 984 984 if( !__TREEOUTPUT__ ) … … 988 988 Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r); 989 989 } 990 #endif 990 #endif 991 991 ComputeLeadingSyzygyTerms( __LEAD2SYZ__ && !__IGNORETAILS__ ); // 2 terms OR 1 term! 992 992 #ifndef NDEBUG … … 998 998 } 999 999 #endif 1000 1000 1001 1001 } 1002 1002 … … 1010 1010 { 1011 1011 if( __TREEOUTPUT__ ) 1012 PrintS("]},"); 1012 PrintS("]},"); 1013 1013 return; 1014 1014 } 1015 1015 1016 1016 1017 1017 // use hybrid method? … … 1030 1030 } 1031 1031 #endif 1032 1032 1033 1033 SetUpTailTerms(); 1034 1034 #ifndef NDEBUG … … 1040 1040 } 1041 1041 #endif 1042 } 1042 } 1043 1043 } 1044 1044 … … 1051 1051 } 1052 1052 #endif 1053 1053 1054 1054 for( int k = size - 1; k >= 0; k-- ) 1055 1055 { 1056 1056 const poly a = LL->m[k]; assume( a != NULL ); 1057 1057 1058 poly a2 = pNext(a); 1058 poly a2 = pNext(a); 1059 1059 1060 1060 // Splitting 2-terms Leading syzygy module 1061 1061 if( a2 != NULL ) 1062 1062 pNext(a) = NULL; 1063 1063 1064 1064 if( __IGNORETAILS__ ) 1065 1065 { … … 1089 1089 Print("%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r); 1090 1090 } 1091 #endif 1091 #endif 1092 1092 1093 1093 TT->rank = id_RankFreeModule(TT, R); 1094 1094 1095 1095 if( __TREEOUTPUT__ ) 1096 1096 PrintS("\n]},"); … … 1115 1115 { 1116 1116 assume( !__LEAD2SYZ__ ); 1117 1117 1118 1118 m_syzLeads = Compute1LeadingSyzygyTerms(); 1119 1119 } 1120 1120 // m_syzLeads = FROM_NAMESPACE(INTERNAL, _ComputeLeadingSyzygyTerms(m_idLeads, m_rBaseRing, m_atttributes)); 1121 1121 1122 1122 // NOTE: set m_LS if tails are to be reduced! 1123 1123 assume( m_syzLeads!= NULL ); … … 1127 1127 m_LS = m_syzLeads; 1128 1128 m_checker.Initialize(m_syzLeads); 1129 #ifndef NDEBUG 1129 #ifndef NDEBUG 1130 1130 if( __DEBUG__ ) 1131 1131 { … … 1146 1146 poly SchreyerSyzygyComputation::SchreyerSyzygyNF(const poly syz_lead, poly syz_2) const 1147 1147 { 1148 1148 1149 1149 assume( !__IGNORETAILS__ ); 1150 1150 … … 1160 1160 PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_lead, r); PrintS("\", \"children\": ["); 1161 1161 } 1162 1162 1163 1163 if( syz_2 == NULL ) 1164 1164 { 1165 const int rr = p_GetComp(syz_lead, r) - 1; 1165 const int rr = p_GetComp(syz_lead, r) - 1; 1166 1166 1167 1167 assume( rr >= 0 && rr < IDELEMS(T) ); … … 1175 1175 PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_2, r); PrintS("\" },"); 1176 1176 } 1177 #else 1177 #else 1178 1178 poly aa = leadmonom(syz_lead, r); assume( aa != NULL); // :( 1179 1179 aa = p_Mult_mm(aa, L->m[rr], r); … … 1183 1183 PrintS("{ \"nodelabel\": \""); writeLatexTerm(syz_2, r); PrintS("\", \"edgelable\": \""); writeLatexTerm(aa, r, false); PrintS("\" },"); 1184 1184 } 1185 1185 1186 1186 syz_2 = m_div.FindReducer(aa, syz_lead, m_checker); 1187 1187 1188 1188 p_Delete(&aa, r); 1189 1189 #endif 1190 1191 } 1192 1193 assume( syz_2 != NULL ); // by construction of S-Polynomial 1190 1191 } 1192 1193 assume( syz_2 != NULL ); // by construction of S-Polynomial 1194 1194 1195 1195 assume( L != NULL ); … … 1213 1213 1214 1214 // kBucketInit(bucket, NULL, 0); // not needed!? 1215 1216 poly p = leadmonom(syz_lead, r); // :( 1217 // poly spoly = pp_Mult_qq(p, T->m[c], r); 1218 kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // TODO: store pLength(T->m[c]) separately!? 1215 1216 poly p = leadmonom(syz_lead, r); // :( 1217 // poly spoly = pp_Mult_qq(p, T->m[c], r); 1218 kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // TODO: store pLength(T->m[c]) separately!? 1219 1219 p_Delete(&p, r); 1220 1221 kbTest(bucket); 1220 1221 kbTest(bucket); 1222 1222 1223 1223 c = p_GetComp(syz_2, r) - 1; … … 1232 1232 // TODO: use bucket!? 1233 1233 // const bool bUsePolynomial = TEST_OPT_NOT_BUCKETS; // || (pLength(spoly) < MIN_LENGTH_BUCKET); 1234 // CPolynomialSummator tail(r, bUsePolynomial); 1235 sBucket_Add_p(tail, syz_2, 1); // tail.AddAndDelete(syz_2, 1); 1236 1234 // CPolynomialSummator tail(r, bUsePolynomial); 1235 sBucket_Add_p(tail, syz_2, 1); // tail.AddAndDelete(syz_2, 1); 1236 1237 1237 kbTest(bucket); 1238 1238 for( poly spoly = kBucketExtractLm(bucket); spoly != NULL; p_LmDelete(&spoly, r), spoly = kBucketExtractLm(bucket)) 1239 { 1239 { 1240 1240 kbTest(bucket); 1241 poly t = m_div.FindReducer(spoly, NULL, m_checker); 1241 poly t = m_div.FindReducer(spoly, NULL, m_checker); 1242 1242 1243 1243 if( t != NULL ) … … 1247 1247 1248 1248 assume( c >= 0 && c < IDELEMS(T) ); 1249 1249 1250 1250 if( __TREEOUTPUT__ ) 1251 1251 { … … 1270 1270 sBucketClearAdd(tail, &result, &len); // TODO: use Merge with sBucket??? 1271 1271 assume( pLength(result) == len ); 1272 1272 1273 1273 if( __TREEOUTPUT__ ) 1274 { 1274 { 1275 1275 PrintS("]},"); 1276 1276 } 1277 1277 1278 1278 1279 1279 return result; 1280 1280 } 1281 1281 1282 // namespace { 1282 // namespace { 1283 1283 1284 1284 // }; … … 1291 1291 { 1292 1292 const ring& r = m_rBaseRing; 1293 1293 1294 1294 assume(m_idTails != NULL && m_idTails->m != NULL); 1295 1295 assume( tail >= 0 && tail < IDELEMS(m_idTails) ); 1296 1296 1297 1297 /* return ComputeImage(multiplier, tail); */ 1298 1298 1299 1299 // TODO: store (multiplier, tail) -.-^-.-^-.--> ! 1300 1300 TCache::iterator top_itr = m_cache.find(tail); 1301 1301 1302 1302 if ( top_itr != m_cache.end() ) 1303 1303 { … … 1305 1305 1306 1306 TP2PCache& T = top_itr->second; 1307 1307 1308 1308 TP2PCache::iterator itr = T.find(multiplier); 1309 1309 1310 1310 if( itr != T.end() ) // Yey - Reuse!!! 1311 1311 { 1312 1312 assume( p_LmEqual(itr->first, multiplier, r) ); 1313 1313 1314 1314 if( itr->second == NULL ) 1315 1316 1315 return (NULL); 1316 1317 1317 poly p = p_Copy(itr->second, r); // no copy??? 1318 1318 1319 1319 if( __TREEOUTPUT__ ) 1320 1320 { 1321 // PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); 1321 // PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); 1322 1322 // Print(" \\\\cdot \\\\GEN{%d}\", \"children\": [ ", tail + 1); 1323 1324 1323 Print("{ \"lookedupnode\": \"1\", \"nodelabel\": \""); 1324 writeLatexTerm(p, r, true, false); 1325 1325 } 1326 1326 1327 1327 if( !n_Equal( pGetCoeff(multiplier), pGetCoeff(itr->first), r) ) // normalize coeffs!? 1328 1328 { 1329 number n = n_Div( pGetCoeff(multiplier), pGetCoeff(itr->first), r); 1330 p = p_Mult_nn(p, n, r); 1329 number n = n_Div( pGetCoeff(multiplier), pGetCoeff(itr->first), r); 1330 p = p_Mult_nn(p, n, r); 1331 1331 n_Delete(&n, r); 1332 1332 1333 1333 if( __TREEOUTPUT__ ) 1334 1334 Print("\", \"RESCALEDRESULT\": \"1\" },"); … … 1338 1338 Print("\", \"RESCALEDRESULT\": \"0\" },"); 1339 1339 } 1340 1340 1341 1341 return p; 1342 1342 } … … 1345 1345 { 1346 1346 // PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); Print(" \\\\cdot \\\\GEN{%d}\", \"children\": [", tail + 1); 1347 } 1348 1347 } 1348 1349 1349 const poly p = ComputeImage(multiplier, tail); 1350 1350 T.insert( TP2PCache::value_type(p_Copy(multiplier, r), p) ); // T[ multiplier ] = p; … … 1352 1352 // if( p == NULL ) 1353 1353 // return (NULL); 1354 1354 1355 1355 if( __TREEOUTPUT__ ) 1356 1356 { 1357 // 1357 // PrintS("], \"storedResult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },"); 1358 1358 } 1359 1359 1360 1360 return p_Copy(p, r); 1361 1361 } 1362 1362 1363 1363 CCacheCompare o(r); TP2PCache T(o); 1364 1364 … … 1367 1367 // PrintS("{ \"nodelabel\": \""); writeLatexTerm(multiplier, r, false); Print(" \\\\cdot \\\\GEN{%d}\", \"children\": [", tail + 1); 1368 1368 } 1369 1370 1369 1370 1371 1371 const poly p = ComputeImage(multiplier, tail); 1372 1372 1373 1373 T.insert( TP2PCache::value_type(p_Copy(multiplier, r), p) ); 1374 1374 1375 1375 m_cache.insert( TCache::value_type(tail, T) ); 1376 1376 1377 1377 // if( p == NULL ) 1378 1378 // return (NULL); 1379 1379 1380 1380 if( __TREEOUTPUT__ ) 1381 1381 { 1382 1382 // PrintS("], \"storedResult\": \""); writeLatexTerm(p, r, true, false); PrintS("\" },"); 1383 1383 } 1384 1384 1385 1385 return p_Copy(p, r); 1386 1386 } … … 1396 1396 } 1397 1397 1398 1398 1399 1399 poly SchreyerSyzygyComputation::TraverseTail(poly multiplier, poly tail) const 1400 1400 { … … 1419 1419 sBucket_pt& sum = m_sum_bucket; assume( sum != NULL ); 1420 1420 poly s; int len; 1421 1421 1422 1422 // CPolynomialSummator sum(r, bUsePolynomial); 1423 1423 // poly s = NULL; … … 1431 1431 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1432 1432 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1433 1433 1434 1434 const int lp = pLength(rt); 1435 1435 if( rt != NULL && lp != 0 ) 1436 sBucket_Add_p(sum, rt, lp); 1436 sBucket_Add_p(sum, rt, lp); 1437 1437 } 1438 1438 … … 1474 1474 if( s == NULL ) // No Reducer? 1475 1475 return s; 1476 1476 1477 1477 if( __TREEOUTPUT__ ) 1478 1478 { 1479 PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r); 1480 } 1481 1482 #else 1479 PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r); 1480 } 1481 1482 #else 1483 1483 // NOTE: only LT(term4reduction) should be used in the following: 1484 1484 poly product = pp_Mult_mm(multiplier, term4reduction, r); … … 1487 1487 if( s == NULL ) // No Reducer? 1488 1488 return s; 1489 1489 1490 1490 if( __TREEOUTPUT__ ) 1491 1491 { 1492 PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r); PrintS("\", \"edgelable\": \""); writeLatexTerm(product, r, false); 1493 } 1494 1492 PrintS("{ \"nodelabel\": \""); writeLatexTerm(s, r); PrintS("\", \"edgelable\": \""); writeLatexTerm(product, r, false); 1493 } 1494 1495 1495 p_Delete(&product, r); 1496 1496 #endif … … 1499 1499 if( s == NULL ) // No Reducer? 1500 1500 return s; 1501 1501 1502 1502 1503 1503 poly b = leadmonom(s, r); … … 1506 1506 assume( c >= 0 && c < IDELEMS(T) ); 1507 1507 1508 1508 1509 1509 if( __TREEOUTPUT__ ) 1510 1510 PrintS("\", \"children\": ["); 1511 1511 1512 1512 const poly t = TraverseTail(b, c); // T->m[c]; 1513 1513 1514 1514 if( t != NULL ) 1515 s = p_Add_q(s, t, r); 1515 s = p_Add_q(s, t, r); 1516 1516 1517 1517 if( __TREEOUTPUT__ ) 1518 1518 { 1519 1519 1520 1520 PrintS("], \"noderesult\": \""); 1521 writeLatexTerm(s, r, true, false); 1521 writeLatexTerm(s, r, true, false); 1522 1522 PrintS("\" },"); 1523 1523 } 1524 1524 1525 1525 return s; 1526 1526 } … … 1531 1531 1532 1532 BEGIN_NAMESPACE_NONAME 1533 1533 1534 1534 static inline int atGetInt(idhdl rootRingHdl, const char* attribute, long def) 1535 1535 { … … 1537 1537 } 1538 1538 1539 END_NAMESPACE 1540 1541 1539 END_NAMESPACE 1540 1541 1542 1542 SchreyerSyzygyComputationFlags::SchreyerSyzygyComputationFlags(idhdl rootRingHdl): 1543 1543 #ifndef NDEBUG … … 1547 1547 #endif 1548 1548 // __SYZCHECK__( (BOOLEAN)atGetInt(rootRingHdl, "SYZCHECK", __DEBUG__) ), 1549 __LEAD2SYZ__( atGetInt(rootRingHdl, "LEAD2SYZ", 1) ), 1550 __TAILREDSYZ__( atGetInt(rootRingHdl, "TAILREDSYZ", 1) ), 1549 __LEAD2SYZ__( atGetInt(rootRingHdl, "LEAD2SYZ", 1) ), 1550 __TAILREDSYZ__( atGetInt(rootRingHdl, "TAILREDSYZ", 1) ), 1551 1551 __HYBRIDNF__( atGetInt(rootRingHdl, "HYBRIDNF", 2) ), 1552 1552 __IGNORETAILS__( atGetInt(rootRingHdl, "IGNORETAILS", 0) ), … … 1554 1554 __TREEOUTPUT__( atGetInt(rootRingHdl, "TREEOUTPUT", 0) ), 1555 1555 m_rBaseRing( rootRingHdl->data.uring ) 1556 { 1556 { 1557 1557 #ifndef NDEBUG 1558 1558 if( __DEBUG__ ) … … 1568 1568 } 1569 1569 #endif 1570 1570 1571 1571 // TODO: just current setting! 1572 1572 assume( rootRingHdl == currRingHdl ); … … 1576 1576 } 1577 1577 1578 1578 1579 1579 1580 1580 CLeadingTerm::CLeadingTerm(unsigned int _label, const poly _lt, const ring R): … … 1601 1601 1602 1602 assume( m_L == L ); 1603 1603 1604 1604 if( L != NULL ) 1605 1605 { 1606 1606 const ring& R = m_rBaseRing; 1607 1607 assume( R != NULL ); 1608 1608 1609 1609 for( int k = IDELEMS(L) - 1; k >= 0; k-- ) 1610 1610 { … … 1685 1685 const unsigned long p_sev = m_sev; 1686 1686 1687 assume( p_sev == p_GetShortExpVector(p, r) ); 1687 assume( p_sev == p_GetShortExpVector(p, r) ); 1688 1688 1689 1689 return p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r); … … 1704 1704 1705 1705 const unsigned long p_sev = m_sev; 1706 assume( p_sev == p_GetShortExpVector(p, r) ); 1706 assume( p_sev == p_GetShortExpVector(p, r) ); 1707 1707 1708 1708 if (p_sev & not_sev) … … 1720 1720 class CDivisorEnumerator: public SchreyerSyzygyComputationFlags 1721 1721 { 1722 private: 1722 private: 1723 1723 const CReducerFinder& m_reds; 1724 1724 const poly m_product; … … 1742 1742 { 1743 1743 assume( m_comp >= 0 ); 1744 assume( m_reds.m_L != NULL ); 1744 assume( m_reds.m_L != NULL ); 1745 1745 } 1746 1746 … … 1748 1748 { 1749 1749 m_active = false; 1750 1750 1751 1751 m_itr = m_reds.m_hash.find(m_comp); 1752 1752 … … 1763 1763 1764 1764 // m_active = true; 1765 return true; 1765 return true; 1766 1766 } 1767 1767 … … 1773 1773 return *(*m_current); 1774 1774 } 1775 1775 1776 1776 inline bool MoveNext() 1777 1777 { … … 1782 1782 else 1783 1783 m_active = true; // for Current() 1784 1784 1785 1785 // looking for the next good entry 1786 1786 for( ; m_current != m_finish; ++m_current ) … … 1804 1804 // the end... :( 1805 1805 assume( m_current == m_finish ); 1806 1806 1807 1807 m_active = false; 1808 1808 return false; … … 1819 1819 1820 1820 return itr.MoveNext(); 1821 1822 /* 1821 1822 /* 1823 1823 const ring& r = m_rBaseRing; 1824 1824 1825 1825 const long comp = p_GetComp(product, r); 1826 1826 const unsigned long not_sev = ~p_GetShortExpVector(product, r); … … 1830 1830 CReducersHash::const_iterator it = m_hash.find(comp); // same module component 1831 1831 1832 assume( m_L != NULL ); 1832 assume( m_L != NULL ); 1833 1833 1834 1834 if( it == m_hash.end() ) 1835 1835 return false; 1836 1836 // assume comp! 1837 1837 1838 1838 const TReducers& reducers = it->second; 1839 1839 … … 1855 1855 1856 1856 return false; 1857 */ 1857 */ 1858 1858 } 1859 1859 … … 1892 1892 class CDivisorEnumerator2: public SchreyerSyzygyComputationFlags 1893 1893 { 1894 private: 1894 private: 1895 1895 const CReducerFinder& m_reds; 1896 1896 const poly m_multiplier, m_term; … … 1914 1914 { 1915 1915 assume( m_comp >= 0 ); 1916 assume( m_reds.m_L != NULL ); 1917 assume( m_multiplier != NULL ); 1916 assume( m_reds.m_L != NULL ); 1917 assume( m_multiplier != NULL ); 1918 1918 assume( m_term != NULL ); 1919 1919 // assume( p_GetComp(m_multiplier, m_rBaseRing) == 0 ); … … 1923 1923 { 1924 1924 m_active = false; 1925 1926 m_itr = m_reds.m_hash.find(m_comp); 1925 1926 m_itr = m_reds.m_hash.find(m_comp); 1927 1927 1928 1928 if( m_itr == m_reds.m_hash.end() ) … … 1937 1937 return false; 1938 1938 1939 return true; 1939 return true; 1940 1940 } 1941 1941 … … 1947 1947 return *(*m_current); 1948 1948 } 1949 1949 1950 1950 inline bool MoveNext() 1951 1951 { … … 1954 1954 if( m_active ) 1955 1955 ++m_current; 1956 else 1956 else 1957 1957 m_active = true; 1958 1959 1958 1959 1960 1960 // looking for the next good entry 1961 1961 for( ; m_current != m_finish; ++m_current ) … … 1974 1974 // m_active = true; 1975 1975 return true; 1976 1976 1977 1977 } 1978 1978 } … … 1980 1980 // the end... :( 1981 1981 assume( m_current == m_finish ); 1982 1982 1983 1983 m_active = false; 1984 1984 return false; 1985 1985 } 1986 1986 }; 1987 1987 1988 1988 poly CReducerFinder::FindReducer(const poly multiplier, const poly t, 1989 1989 const poly syzterm, … … 2018 2018 2019 2019 poly pr = p_Mult_q( leadmonom(multiplier, r, false), leadmonom(t, r, false), r); 2020 2020 2021 2021 assume( p_EqualPolys(lm, pr, r) ); 2022 2022 … … 2024 2024 // def @@product = leadmonomial(syzterm) * L[@@r]; 2025 2025 2026 p_Delete(&lm, r); 2027 p_Delete(&pr, r); 2028 } 2029 2030 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 2026 p_Delete(&lm, r); 2027 p_Delete(&pr, r); 2028 } 2029 2030 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 2031 2031 2032 2032 const poly q = p_New(r); pNext(q) = NULL; … … 2039 2039 const poly p = itr.Current().m_lt; 2040 2040 const int k = itr.Current().m_label; 2041 2041 2042 2042 p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t // TODO: do it once? 2043 2043 p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k])) 2044 2044 2045 2045 p_SetComp(q, k + 1, r); 2046 2046 p_Setm(q, r); … … 2055 2055 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); 2056 2056 dPrint(syzterm, r, r, 1); 2057 } 2057 } 2058 2058 #endif 2059 2059 continue; 2060 2060 } 2061 2061 2062 // while the complement (the fraction) is not reducible by leading syzygies 2063 if( to_check && syz_checker.IsDivisible(q) ) 2062 // while the complement (the fraction) is not reducible by leading syzygies 2063 if( to_check && syz_checker.IsDivisible(q) ) 2064 2064 { 2065 2065 #ifndef NDEBUG … … 2075 2075 p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r); 2076 2076 n_Delete(&n, r); 2077 2077 2078 2078 return q; 2079 2079 } 2080 2080 2081 2081 /* 2082 2082 const long comp = p_GetComp(t, r); assume( comp >= 0 ); … … 2086 2086 // { 2087 2087 // const poly p = L->m[k]; 2088 // 2088 // 2089 2089 // if ( p_GetComp(p, r) != comp ) 2090 2090 // continue; 2091 // 2091 // 2092 2092 // const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!! 2093 2093 … … 2099 2099 2100 2100 // assume comp! 2101 2101 2102 2102 assume( m_L != NULL ); 2103 2103 … … 2113 2113 2114 2114 // const unsigned long p_sev = (*vit)->m_sev; 2115 // assume( p_sev == p_GetShortExpVector(p, r) ); 2115 // assume( p_sev == p_GetShortExpVector(p, r) ); 2116 2116 2117 2117 // if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) ) 2118 // continue; 2118 // continue; 2119 2119 2120 2120 if( !(*vit)->DivisibilityCheck(multiplier, t, not_sev, r) ) 2121 2121 continue; 2122 2123 2122 2123 2124 2124 // if (p_sev & not_sev) continue; 2125 // if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue; 2126 2127 2128 p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t 2125 // if( !_p_LmDivisibleByNoComp(p, multiplier, t, r) ) continue; 2126 2127 2128 p_ExpVectorSum(q, multiplier, t, r); // q == product == multiplier * t 2129 2129 p_ExpVectorDiff(q, q, p, r); // (LM(product) / LM(L[k])) 2130 2130 2131 2131 p_SetComp(q, k + 1, r); 2132 2132 p_Setm(q, r); … … 2140 2140 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); 2141 2141 dPrint(syzterm, r, r, 1); 2142 } 2142 } 2143 2143 2144 2144 continue; 2145 2145 } 2146 2146 2147 // while the complement (the fraction) is not reducible by leading syzygies 2148 if( to_check && syz_checker.IsDivisible(q) ) 2147 // while the complement (the fraction) is not reducible by leading syzygies 2148 if( to_check && syz_checker.IsDivisible(q) ) 2149 2149 { 2150 2150 if( __DEBUG__ ) … … 2159 2159 p_SetCoeff0(q, n_Neg( n_Div(n, p_GetCoeff(p, r), r), r), r); 2160 2160 n_Delete(&n, r); 2161 2161 2162 2162 return q; 2163 2163 } 2164 */ 2164 */ 2165 2165 2166 2166 p_LmFree(q, r); 2167 2167 2168 2168 return NULL; 2169 2169 2170 2170 } 2171 2171 … … 2203 2203 // def @@product = leadmonomial(syzterm) * L[@@r]; 2204 2204 2205 p_Delete(&lm, r); 2206 } 2207 2208 2209 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 2205 p_Delete(&lm, r); 2206 } 2207 2208 2209 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 2210 2210 2211 2211 const poly q = p_New(r); pNext(q) = NULL; … … 2218 2218 const poly p = itr.Current().m_lt; 2219 2219 const int k = itr.Current().m_label; 2220 2220 2221 2221 p_ExpVectorDiff(q, product, p, r); // (LM(product) / LM(L[k])) 2222 2222 p_SetComp(q, k + 1, r); … … 2232 2232 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); 2233 2233 dPrint(syzterm, r, r, 1); 2234 } 2234 } 2235 2235 #endif 2236 2236 continue; 2237 2237 } 2238 2238 2239 // while the complement (the fraction) is not reducible by leading syzygies 2240 if( to_check && syz_checker.IsDivisible(q) ) 2239 // while the complement (the fraction) is not reducible by leading syzygies 2240 if( to_check && syz_checker.IsDivisible(q) ) 2241 2241 { 2242 2242 #ifndef NDEBUG … … 2250 2250 2251 2251 p_SetCoeff0(q, n_Neg( n_Div( p_GetCoeff(product, r), p_GetCoeff(p, r), r), r), r); 2252 2252 2253 2253 return q; 2254 2254 } 2255 2256 2257 2258 /* 2255 2256 2257 2258 /* 2259 2259 const long comp = p_GetComp(product, r); 2260 2260 const unsigned long not_sev = ~p_GetShortExpVector(product, r); … … 2265 2265 // { 2266 2266 // const poly p = L->m[k]; 2267 // 2267 // 2268 2268 // if ( p_GetComp(p, r) != comp ) 2269 2269 // continue; 2270 // 2270 // 2271 2271 // const unsigned long p_sev = p_GetShortExpVector(p, r); // to be stored in m_hash!!! 2272 2272 2273 2273 // looking for an appropriate diviser p = L[k]... 2274 2274 CReducersHash::const_iterator it = m_hash.find(comp); // same module component … … 2281 2281 const TReducers& reducers = it->second; 2282 2282 2283 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 2283 const BOOLEAN to_check = (syz_checker.IsNonempty()); // __TAILREDSYZ__ && 2284 2284 2285 2285 const poly q = p_New(r); pNext(q) = NULL; … … 2287 2287 if( __DEBUG__ ) 2288 2288 p_SetCoeff0(q, 0, r); // for printing q 2289 2289 2290 2290 for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ ) 2291 2291 { … … 2300 2300 const unsigned long p_sev = (*vit)->m_sev; 2301 2301 2302 assume( p_sev == p_GetShortExpVector(p, r) ); 2302 assume( p_sev == p_GetShortExpVector(p, r) ); 2303 2303 2304 2304 if( !p_LmShortDivisibleByNoComp(p, p_sev, product, not_sev, r) ) 2305 continue; 2305 continue; 2306 2306 2307 2307 // // ... which divides the product, looking for the _1st_ appropriate one! … … 2321 2321 Print("_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: "); 2322 2322 dPrint(syzterm, r, r, 1); 2323 } 2323 } 2324 2324 2325 2325 continue; 2326 2326 } 2327 2327 2328 // while the complement (the fraction) is not reducible by leading syzygies 2329 if( to_check && syz_checker.IsDivisible(q) ) 2328 // while the complement (the fraction) is not reducible by leading syzygies 2329 if( to_check && syz_checker.IsDivisible(q) ) 2330 2330 { 2331 2331 if( __DEBUG__ ) … … 2333 2333 PrintS("_FindReducer::Test LS: q is divisible by LS[?] !:((: "); 2334 2334 } 2335 2335 2336 2336 continue; 2337 2337 } … … 2376 2376 } 2377 2377 2378 m_compute = true; 2378 m_compute = true; 2379 2379 } 2380 2380 } … … 2385 2385 assume( m != NULL ); 2386 2386 if( m_compute && (m != NULL)) 2387 { 2387 { 2388 2388 const ring& R = m_rBaseRing; 2389 2389 … … 2400 2400 } 2401 2401 2402 CCacheCompare::CCacheCompare(): m_ring(currRing) {} 2402 CCacheCompare::CCacheCompare(): m_ring(currRing) {} 2403 2403 2404 2404 -
Singular/fglm.cc
r8b5fff rac00e2f 53 53 }; 54 54 55 // Has to be called, if curr Quotient!= NULL. ( i.e. qring-case )55 // Has to be called, if currRing->qideal != NULL. ( i.e. qring-case ) 56 56 // Then a new ideal is build, consisting of the generators of sourceIdeal 57 // and the generators of curr Quotient, which are completely reduced by57 // and the generators of currRing->qideal, which are completely reduced by 58 58 // the sourceIdeal. This means: If sourceIdeal is reduced, then the new 59 59 // ideal will be reduced as well. … … 63 63 int k, l, offset; 64 64 BOOLEAN found; 65 ideal newSource= idInit( IDELEMS( sourceIdeal ) + IDELEMS( curr Quotient), 1 );65 ideal newSource= idInit( IDELEMS( sourceIdeal ) + IDELEMS( currRing->qideal ), 1 ); 66 66 for ( k= IDELEMS( sourceIdeal )-1; k >=0; k-- ) 67 67 (newSource->m)[k]= pCopy( (sourceIdeal->m)[k] ); 68 68 offset= IDELEMS( sourceIdeal ); 69 for ( l= IDELEMS( curr Quotient)-1; l >= 0; l-- )70 { 71 if ( (curr Quotient->m)[l] != NULL )69 for ( l= IDELEMS( currRing->qideal )-1; l >= 0; l-- ) 70 { 71 if ( (currRing->qideal->m)[l] != NULL ) 72 72 { 73 73 found= FALSE; 74 74 for ( k= IDELEMS( sourceIdeal )-1; (k >= 0) && (found == FALSE); k-- ) 75 if ( pDivisibleBy( (sourceIdeal->m)[k], (curr Quotient->m)[l] ) )75 if ( pDivisibleBy( (sourceIdeal->m)[k], (currRing->qideal->m)[l] ) ) 76 76 found= TRUE; 77 77 if ( ! found ) 78 78 { 79 (newSource->m)[offset]= pCopy( (curr Quotient->m)[l] );79 (newSource->m)[offset]= pCopy( (currRing->qideal->m)[l] ); 80 80 offset++; 81 81 } … … 86 86 } 87 87 88 // Has to be called, if curr Quotient!= NULL, i.e. in qring-case.88 // Has to be called, if currRing->qideal != NULL, i.e. in qring-case. 89 89 // Gets rid of the elements of result which are contained in 90 // curr Quotientand skips Zeroes.90 // currRing->qideal and skips Zeroes. 91 91 // Assumes that currRing == destRing 92 92 void … … 100 100 { 101 101 found= FALSE; 102 for ( l= IDELEMS( curr Quotient)-1; (l >= 0) && ( found == FALSE ); l-- )103 if ( pDivisibleBy( (curr Quotient->m)[l], (result->m)[k] ) )102 for ( l= IDELEMS( currRing->qideal )-1; (l >= 0) && ( found == FALSE ); l-- ) 103 if ( pDivisibleBy( (currRing->qideal->m)[l], (result->m)[k] ) ) 104 104 found= TRUE; 105 105 if ( found ) pDelete( & ((result->m)[k]) ); … … 302 302 { 303 303 ideal sourceIdeal; 304 if ( curr Quotient!= NULL )304 if ( currRing->qideal != NULL ) 305 305 sourceIdeal= fglmUpdatesource( IDIDEAL( ih ) ); 306 306 else … … 311 311 // Now the settings are compatible with FGLM 312 312 assumeStdFlag( (leftv)ih ); 313 if ( fglmzero( IDRING(sourceRingHdl), sourceIdeal, IDRING(destRingHdl), destIdeal, FALSE, (curr Quotient!= NULL) ) == FALSE )313 if ( fglmzero( IDRING(sourceRingHdl), sourceIdeal, IDRING(destRingHdl), destIdeal, FALSE, (currRing->qideal != NULL) ) == FALSE ) 314 314 state= FglmNotReduced; 315 315 } … … 321 321 { 322 322 case FglmOk: 323 if ( curr Quotient!= NULL ) fglmUpdateresult( destIdeal );323 if ( currRing->qideal != NULL ) fglmUpdateresult( destIdeal ); 324 324 break; 325 325 case FglmHasOne: -
Singular/iparith.cc
r8b5fff rac00e2f 1981 1981 } 1982 1982 #endif 1983 if(curr Quotient==NULL)1983 if(currRing->qideal==NULL) 1984 1984 res->data = (char *)((long)scDimInt((ideal)(v->Data()),(ideal)w->Data())); 1985 1985 else 1986 1986 { 1987 ideal q=idSimpleAdd(curr Quotient,(ideal)w->Data());1987 ideal q=idSimpleAdd(currRing->qideal,(ideal)w->Data()); 1988 1988 res->data = (char *)((long)scDimInt((ideal)(v->Data()),q)); 1989 1989 idDelete(&q); … … 2408 2408 Print("// performed for generic fibre, that is, over Q\n"); 2409 2409 intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD); 2410 intvec *iv=hFirstSeries(uu,module_w,curr Quotient);2410 intvec *iv=hFirstSeries(uu,module_w,currRing->qideal); 2411 2411 int returnWithTrue = 1; 2412 2412 switch((int)(long)v->Data()) … … 2433 2433 assumeStdFlag(u); 2434 2434 intvec *module_w=(intvec*)atGet(u,"isHomog",INTVEC_CMD); 2435 intvec *iv=hFirstSeries((ideal)u->Data(),module_w,curr Quotient);2435 intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal); 2436 2436 switch((int)(long)v->Data()) 2437 2437 { … … 2499 2499 kModW=w; 2500 2500 pSetDegProcs(currRing,kHomModDeg); 2501 res->data=(void *)(long)idHomModule(v_id,curr Quotient,&w);2501 res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w); 2502 2502 currRing->pLexOrder=save_pLexOrder; 2503 2503 kHomW=NULL; … … 2511 2511 assumeStdFlag(u); 2512 2512 res->data=(void *)scIndIndset((ideal)(u->Data()),(int)(long)(v->Data()), 2513 curr Quotient);2513 currRing->qideal); 2514 2514 return FALSE; 2515 2515 } … … 2558 2558 intvec *w_u=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 2559 2559 res->data = (char *)scKBase((int)(long)v->Data(), 2560 (ideal)(u->Data()),curr Quotient, w_u);2560 (ideal)(u->Data()),currRing->qideal, w_u); 2561 2561 if (w_u!=NULL) 2562 2562 { … … 2646 2646 else 2647 2647 { 2648 if ((!idTestHomModule(u_id,curr Quotient,w_v))2649 || (!idTestHomModule(v_id,curr Quotient,w_v)))2648 if ((!idTestHomModule(u_id,currRing->qideal,w_v)) 2649 || (!idTestHomModule(v_id,currRing->qideal,w_v))) 2650 2650 { 2651 2651 WarnS("wrong weights"); … … 3000 3000 { 3001 3001 assumeStdFlag(v); 3002 res->data = (char *)kNF((ideal)v->Data(),curr Quotient,(poly)u->Data());3002 res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data()); 3003 3003 return FALSE; 3004 3004 } … … 3008 3008 ideal ui=(ideal)u->Data(); 3009 3009 ideal vi=(ideal)v->Data(); 3010 res->data = (char *)kNF(vi,curr Quotient,ui);3010 res->data = (char *)kNF(vi,currRing->qideal,ui); 3011 3011 return FALSE; 3012 3012 } … … 3031 3031 { 3032 3032 maxl = currRing->N-1+2*(iiOp==MRES_CMD); 3033 if (curr Quotient!=NULL)3033 if (currRing->qideal!=NULL) 3034 3034 { 3035 3035 Warn( … … 3041 3041 if (weights!=NULL) 3042 3042 { 3043 if (!idTestHomModule(u_id,curr Quotient,weights))3043 if (!idTestHomModule(u_id,currRing->qideal,weights)) 3044 3044 { 3045 3045 WarnS("wrong weights given:");weights->show();PrintLn(); … … 3056 3056 } 3057 3057 else 3058 idHomModule(u_id,curr Quotient,&ww);3058 idHomModule(u_id,currRing->qideal,&ww); 3059 3059 weights=ww; 3060 3060 … … 3069 3069 { 3070 3070 int dummy; 3071 if((curr Quotient!=NULL)||3071 if((currRing->qideal!=NULL)|| 3072 3072 (!idHomIdeal (u_id,NULL))) 3073 3073 { … … 3081 3081 { 3082 3082 int dummy; 3083 if((curr Quotient!=NULL)||3083 if((currRing->qideal!=NULL)|| 3084 3084 (!idHomIdeal (u_id,NULL))) 3085 3085 { … … 3093 3093 { 3094 3094 int dummy; 3095 if((curr Quotient!=NULL)||3095 if((currRing->qideal!=NULL)|| 3096 3096 (!idHomIdeal (u_id,NULL))) 3097 3097 { … … 3146 3146 { 3147 3147 maxl = currRing->N-1+2*(iiOp==MRES_CMD); 3148 if (curr Quotient!=NULL)3148 if (currRing->qideal!=NULL) 3149 3149 { 3150 3150 Warn( … … 3156 3156 if (weights!=NULL) 3157 3157 { 3158 if (!idTestHomModule(u_id,curr Quotient,weights))3158 if (!idTestHomModule(u_id,currRing->qideal,weights)) 3159 3159 { 3160 3160 WarnS("wrong weights given:");weights->show();PrintLn(); … … 3180 3180 { 3181 3181 int dummy; 3182 if((curr Quotient!=NULL)||3182 if((currRing->qideal!=NULL)|| 3183 3183 (!idHomIdeal (u_id,NULL))) 3184 3184 { … … 3194 3194 { 3195 3195 int dummy; 3196 if((curr Quotient!=NULL)||3196 if((currRing->qideal!=NULL)|| 3197 3197 (!idHomIdeal (u_id,NULL))) 3198 3198 { … … 3206 3206 { 3207 3207 int dummy; 3208 if((curr Quotient!=NULL)||3208 if((currRing->qideal!=NULL)|| 3209 3209 (!idHomIdeal (u_id,NULL))) 3210 3210 { … … 3399 3399 if (w!=NULL) 3400 3400 { 3401 if (!idTestHomModule(u_id,curr Quotient,w))3401 if (!idTestHomModule(u_id,currRing->qideal,w)) 3402 3402 { 3403 3403 WarnS("wrong weights:");w->show();PrintLn(); … … 3410 3410 } 3411 3411 } 3412 result=kStd(u_id,curr Quotient,hom,&w,(intvec *)v->Data());3412 result=kStd(u_id,currRing->qideal,hom,&w,(intvec *)v->Data()); 3413 3413 idSkipZeroes(result); 3414 3414 res->data = (char *)result; … … 3479 3479 if (w!=NULL) 3480 3480 { 3481 if (!idTestHomModule(i1,curr Quotient,w))3481 if (!idTestHomModule(i1,currRing->qideal,w)) 3482 3482 { 3483 3483 // no warnung: this is legal, if i in std(i,p) … … 3496 3496 /* ii0 appears to be the position of the first element of il that 3497 3497 does not belong to the old SB ideal */ 3498 result=kStd(i1,curr Quotient,hom,&w,NULL,0,ii0);3498 result=kStd(i1,currRing->qideal,hom,&w,NULL,0,ii0); 3499 3499 SI_RESTORE_OPT1(save1); 3500 3500 idDelete(&i1); … … 3860 3860 Print("// generic fibre, that is, over Q\n"); 3861 3861 intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD); 3862 scDegree(vv,module_w,curr Quotient);3862 scDegree(vv,module_w,currRing->qideal); 3863 3863 idDelete(&vv); 3864 3864 rChangeCurrRing(origR); … … 3868 3868 assumeStdFlag(v); 3869 3869 intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD); 3870 scDegree((ideal)v->Data(),module_w,curr Quotient);3870 scDegree((ideal)v->Data(),module_w,currRing->qideal); 3871 3871 char *s=SPrintEnd(); 3872 3872 int l=strlen(s)-1; … … 3987 3987 /* drop degree zero generator from vv (if any) */ 3988 3988 if (i != -1) pDelete(&vv->m[i]); 3989 long d = (long)scDimInt(vv, curr Quotient);3989 long d = (long)scDimInt(vv, currRing->qideal); 3990 3990 if (rField_is_Ring_Z(currRing) && (i == -1)) d++; 3991 3991 res->data = (char *)d; … … 3996 3996 } 3997 3997 #endif 3998 res->data = (char *)(long)scDimInt((ideal)(v->Data()),curr Quotient);3998 res->data = (char *)(long)scDimInt((ideal)(v->Data()),currRing->qideal); 3999 3999 return FALSE; 4000 4000 } … … 4180 4180 Print("// performed for generic fibre, that is, over Q\n"); 4181 4181 intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD); 4182 //scHilbertPoly(vv,curr Quotient);4183 hLookSeries(vv,module_w,curr Quotient);4182 //scHilbertPoly(vv,currRing->qideal); 4183 hLookSeries(vv,module_w,currRing->qideal); 4184 4184 idDelete(&vv); 4185 4185 rChangeCurrRing(origR); … … 4190 4190 assumeStdFlag(v); 4191 4191 intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD); 4192 //scHilbertPoly((ideal)v->Data(),curr Quotient);4193 hLookSeries((ideal)v->Data(),module_w,curr Quotient);4192 //scHilbertPoly((ideal)v->Data(),currRing->qideal); 4193 hLookSeries((ideal)v->Data(),module_w,currRing->qideal); 4194 4194 return FALSE; 4195 4195 } … … 4212 4212 if (w==NULL) 4213 4213 { 4214 res->data=(void *)(long)idHomModule(v_id,curr Quotient,&w);4214 res->data=(void *)(long)idHomModule(v_id,currRing->qideal,&w); 4215 4215 if (res->data!=NULL) 4216 4216 { … … 4228 4228 else 4229 4229 { 4230 res->data=(void *)(long)idTestHomModule(v_id,curr Quotient,w);4230 res->data=(void *)(long)idTestHomModule(v_id,currRing->qideal,w); 4231 4231 if((res->data==NULL) && (v->rtyp==IDHDL)) 4232 4232 { … … 4305 4305 { 4306 4306 assumeStdFlag(v); 4307 res->data=(void *)scIndIntvec((ideal)(v->Data()),curr Quotient);4307 res->data=(void *)scIndIntvec((ideal)(v->Data()),currRing->qideal); 4308 4308 return FALSE; 4309 4309 } 4310 4310 static BOOLEAN jjINTERRED(leftv res, leftv v) 4311 4311 { 4312 ideal result=kInterRed((ideal)(v->Data()), curr Quotient);4312 ideal result=kInterRed((ideal)(v->Data()), currRing->qideal); 4313 4313 #ifdef HAVE_RINGS 4314 4314 if(rField_is_Ring(currRing)) … … 4391 4391 { 4392 4392 assumeStdFlag(v); 4393 res->data = (char *)scKBase(-1,(ideal)(v->Data()),curr Quotient);4393 res->data = (char *)scKBase(-1,(ideal)(v->Data()),currRing->qideal); 4394 4394 return FALSE; 4395 4395 } … … 4572 4572 int t=v->Typ(); 4573 4573 ideal r,m; 4574 r=kMin_std((ideal)v->Data(),curr Quotient,testHomog,NULL,m);4574 r=kMin_std((ideal)v->Data(),currRing->qideal,testHomog,NULL,m); 4575 4575 lists l=(lists)omAllocBin(slists_bin); 4576 4576 l->Init(2); … … 4586 4586 { 4587 4587 assumeStdFlag(v); 4588 res->data = (char *)(long)scMultInt((ideal)(v->Data()),curr Quotient);4588 res->data = (char *)(long)scMultInt((ideal)(v->Data()),currRing->qideal); 4589 4589 return FALSE; 4590 4590 } … … 4744 4744 if (w!=NULL) 4745 4745 { 4746 if (!idTestHomModule(v_id,curr Quotient,w))4746 if (!idTestHomModule(v_id,currRing->qideal,w)) 4747 4747 { 4748 4748 WarnS("wrong weights"); … … 4851 4851 #endif 4852 4852 4853 if ((curr Quotient!=NULL) && !bIsSCA)4853 if ((currRing->qideal!=NULL) && !bIsSCA) 4854 4854 { 4855 4855 WerrorS("qring not supported by slimgb at the moment"); … … 4866 4866 if (w!=NULL) 4867 4867 { 4868 if (!idTestHomModule(u_id,curr Quotient,w))4868 if (!idTestHomModule(u_id,currRing->qideal,w)) 4869 4869 { 4870 4870 WarnS("wrong weights"); … … 4895 4895 if (w!=NULL) 4896 4896 { 4897 if (!idTestHomModule(v_id,curr Quotient,w))4897 if (!idTestHomModule(v_id,currRing->qideal,w)) 4898 4898 { 4899 4899 WarnS("wrong weights"); … … 4906 4906 } 4907 4907 } 4908 result=kSba(v_id,curr Quotient,hom,&w,1,0);4908 result=kSba(v_id,currRing->qideal,hom,&w,1,0); 4909 4909 idSkipZeroes(result); 4910 4910 res->data = (char *)result; … … 4921 4921 if (w!=NULL) 4922 4922 { 4923 if (!idTestHomModule(v_id,curr Quotient,w))4923 if (!idTestHomModule(v_id,currRing->qideal,w)) 4924 4924 { 4925 4925 WarnS("wrong weights"); … … 4932 4932 } 4933 4933 } 4934 result=kSba(v_id,curr Quotient,hom,&w,(int)(long)u->Data(),0);4934 result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),0); 4935 4935 idSkipZeroes(result); 4936 4936 res->data = (char *)result; … … 4947 4947 if (w!=NULL) 4948 4948 { 4949 if (!idTestHomModule(v_id,curr Quotient,w))4949 if (!idTestHomModule(v_id,currRing->qideal,w)) 4950 4950 { 4951 4951 WarnS("wrong weights"); … … 4958 4958 } 4959 4959 } 4960 result=kSba(v_id,curr Quotient,hom,&w,(int)(long)u->Data(),(int)(long)t->Data());4960 result=kSba(v_id,currRing->qideal,hom,&w,(int)(long)u->Data(),(int)(long)t->Data()); 4961 4961 idSkipZeroes(result); 4962 4962 res->data = (char *)result; … … 4973 4973 if (w!=NULL) 4974 4974 { 4975 if (!idTestHomModule(v_id,curr Quotient,w))4975 if (!idTestHomModule(v_id,currRing->qideal,w)) 4976 4976 { 4977 4977 WarnS("wrong weights"); … … 4984 4984 } 4985 4985 } 4986 result=kStd(v_id,curr Quotient,hom,&w);4986 result=kStd(v_id,currRing->qideal,hom,&w); 4987 4987 idSkipZeroes(result); 4988 4988 res->data = (char *)result; … … 5034 5034 add_row_shift=w->min_in(); 5035 5035 (*w)-=add_row_shift; 5036 if (idTestHomModule(v_id,curr Quotient,w))5036 if (idTestHomModule(v_id,currRing->qideal,w)) 5037 5037 hom=isHomog; 5038 5038 else … … 5196 5196 { 5197 5197 assumeStdFlag(v); 5198 res->data = (char *)(long)scMult0Int((ideal)v->Data(),curr Quotient);5198 res->data = (char *)(long)scMult0Int((ideal)v->Data(),currRing->qideal); 5199 5199 return FALSE; 5200 5200 } … … 5908 5908 Print("// performed for generic fibre, that is, over Q\n"); 5909 5909 intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD); 5910 intvec *iv=hFirstSeries(uu,module_w,curr Quotient,wdegree);5910 intvec *iv=hFirstSeries(uu,module_w,currRing->qideal,wdegree); 5911 5911 int returnWithTrue = 1; 5912 5912 switch((int)(long)v->Data()) … … 5933 5933 assumeStdFlag(u); 5934 5934 intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD); 5935 intvec *iv=hFirstSeries((ideal)u->Data(),module_w,curr Quotient,wdegree);5935 intvec *iv=hFirstSeries((ideal)u->Data(),module_w,currRing->qideal,wdegree); 5936 5936 switch((int)(long)v->Data()) 5937 5937 { … … 6553 6553 { 6554 6554 assumeStdFlag(v); 6555 res->data = (char *)kNF((ideal)v->Data(),curr Quotient,(poly)u->Data(),6555 res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(poly)u->Data(), 6556 6556 0,(int)(long)w->Data()); 6557 6557 return FALSE; … … 6560 6560 { 6561 6561 assumeStdFlag(v); 6562 res->data = (char *)kNF((ideal)v->Data(),curr Quotient,(ideal)u->Data(),6562 res->data = (char *)kNF((ideal)v->Data(),currRing->qideal,(ideal)u->Data(), 6563 6563 0,(int)(long)w->Data()); 6564 6564 return FALSE; … … 6582 6582 { 6583 6583 l=1; 6584 if (!idTestHomModule(u_id,curr Quotient,iv))6584 if (!idTestHomModule(u_id,currRing->qideal,iv)) 6585 6585 { 6586 6586 WarnS("wrong weights"); … … 6631 6631 if (ww!=NULL) 6632 6632 { 6633 if (!idTestHomModule(u_id,curr Quotient,ww))6633 if (!idTestHomModule(u_id,currRing->qideal,ww)) 6634 6634 { 6635 6635 WarnS("wrong weights"); … … 6643 6643 } 6644 6644 result=kStd(u_id, 6645 curr Quotient,6645 currRing->qideal, 6646 6646 hom, 6647 6647 &ww, // module weights … … 7759 7759 if (ww!=NULL) 7760 7760 { 7761 if (!idTestHomModule(i1,curr Quotient,ww))7761 if (!idTestHomModule(i1,currRing->qideal,ww)) 7762 7762 { 7763 7763 WarnS("wrong weights"); … … 7774 7774 si_opt_1|=Sy_bit(OPT_SB_1); 7775 7775 result=kStd(i1, 7776 curr Quotient,7776 currRing->qideal, 7777 7777 hom, 7778 7778 &ww, // module weights -
Singular/ipassign.cc
r8b5fff rac00e2f 471 471 res->data=(void*)p; 472 472 jiAssignAttr(res,a); 473 if (TEST_V_QRING && (curr Quotient!=NULL) && (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingP(res);473 if (TEST_V_QRING && (currRing->qideal!=NULL) && (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingP(res); 474 474 } 475 475 else … … 643 643 setFlag(res,FLAG_STD); 644 644 } 645 if (TEST_V_QRING && (curr Quotient!=NULL)&& (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingId(res);645 if (TEST_V_QRING && (currRing->qideal!=NULL)&& (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingId(res); 646 646 return FALSE; 647 647 } … … 661 661 pNormalize(I->m[0]); 662 662 res->data=(void *)I; 663 if (TEST_V_QRING && (curr Quotient!=NULL))663 if (TEST_V_QRING && (currRing->qideal!=NULL)) 664 664 { 665 665 if (hasFlag(a,FLAG_QRING)) setFlag(res,FLAG_QRING); … … 677 677 id_Normalize((ideal)m, currRing); 678 678 res->data=(void *)m; 679 if (TEST_V_QRING && (curr Quotient!=NULL)) jjNormalizeQRingId(res);679 if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingId(res); 680 680 return FALSE; 681 681 } … … 1172 1172 l1->CleanUp(); 1173 1173 r->CleanUp(); 1174 //if (TEST_V_QRING && (curr Quotient!=NULL)) jjNormalizeQRingP(l);1174 //if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingP(l); 1175 1175 return FALSE; 1176 1176 } … … 1909 1909 void jjNormalizeQRingId(leftv I) 1910 1910 { 1911 if ((curr Quotient!=NULL) && (!hasFlag(I,FLAG_QRING)))1911 if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING))) 1912 1912 { 1913 1913 if (I->e==NULL) … … 1920 1920 { 1921 1921 ideal F=idInit(1,1); 1922 ideal II=kNF(F,curr Quotient,I0);1922 ideal II=kNF(F,currRing->qideal,I0); 1923 1923 idDelete(&F); 1924 1924 if (I->rtyp!=IDHDL) … … 1944 1944 void jjNormalizeQRingP(leftv I) 1945 1945 { 1946 if ((curr Quotient!=NULL) && (!hasFlag(I,FLAG_QRING)))1946 if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING))) 1947 1947 { 1948 1948 poly p=(poly)I->Data(); … … 1950 1950 { 1951 1951 ideal F=idInit(1,1); 1952 poly II=kNF(F,curr Quotient,p);1952 poly II=kNF(F,currRing->qideal,p); 1953 1953 idDelete(&F); 1954 1954 if ((I->rtyp==POLY_CMD) -
Singular/ipid.h
r8b5fff rac00e2f 90 90 91 91 /*extern ring currRing; in ring.h */ 92 /*extern ideal currQuotient; in structs.h */93 92 94 93 idhdl enterid(const char * a, int lev, int t, idhdl* root, BOOLEAN init=TRUE, BOOLEAN serach=TRUE); -
Singular/ipshell.cc
r8b5fff rac00e2f 1463 1463 if (rHasLocalOrMixedOrdering_currRing()) 1464 1464 { 1465 scComputeHC(I,curr Quotient,ak,po);1465 scComputeHC(I,currRing->qideal,ak,po); 1466 1466 if (po!=NULL) 1467 1467 { … … 3444 3444 #endif 3445 3445 3446 ideal stdJ = kStd(J,curr Quotient,isNotHomog,NULL);3446 ideal stdJ = kStd(J,currRing->qideal,isNotHomog,NULL); 3447 3447 idSkipZeroes( stdJ ); 3448 3448 … … 3511 3511 poly hc = (poly)NULL; 3512 3512 3513 scComputeHC( stdJ,curr Quotient, 0,hc );3513 scComputeHC( stdJ,currRing->qideal, 0,hc ); 3514 3514 3515 3515 if( hc!=(poly)NULL ) … … 5555 5555 { 5556 5556 // all dependend stuff is done, clean global vars: 5557 if (r->qideal!=NULL)5558 {5559 currQuotient=NULL;5560 }5561 5557 if ((currRing->ppNoether)!=NULL) pDelete(&(currRing->ppNoether)); 5562 5558 if (sLastPrinted.RingDependend()) -
Singular/subexpr.cc
r8b5fff rac00e2f 139 139 case MODUL_CMD: 140 140 case IDEAL_CMD: 141 if ((TEST_V_QRING) &&(curr Quotient!=NULL)141 if ((TEST_V_QRING) &&(currRing->qideal!=NULL) 142 142 &&(!hasFlag(this,FLAG_QRING))) 143 143 { … … 151 151 case POLY_CMD: 152 152 case VECTOR_CMD: 153 if ((TEST_V_QRING) &&(curr Quotient!=NULL)153 if ((TEST_V_QRING) &&(currRing->qideal!=NULL) 154 154 &&(!hasFlag(this,FLAG_QRING))) 155 155 { -
kernel/GBEngine/f5gb.cc
r8b5fff rac00e2f 128 128 //Print("%p\n",gPrev->getFirst()); 129 129 //pWrite(gPrev->getFirst()->getPoly()); 130 poly tempNF = kNF(gbPrev,curr Quotient,f_i);130 poly tempNF = kNF(gbPrev,currRing->qideal,f_i); 131 131 f_i = tempNF; 132 132 //gPrev->insert(ONE,i,f_i); … … 642 642 testNode = testNode->getNext(); 643 643 } 644 poly temp = kNF(testId,curr Quotient,u1);644 poly temp = kNF(testId,currRing->qideal,u1); 645 645 //pWrite(temp); 646 646 for(i=0;i<IDELEMS(testId);i++) { … … 1096 1096 //sPolyList->print(); 1097 1097 sPolyList->setFirst(temp->getNext()); 1098 poly tempNF = kNF(gbPrev,curr Quotient,temp->getPoly());1098 poly tempNF = kNF(gbPrev,currRing->qideal,temp->getPoly()); 1099 1099 if(NULL != tempNF) { 1100 1100 pNorm(tempNF); … … 1149 1149 //} 1150 1150 //pWrite(temp->getPoly()); 1151 //poly tempNF = kNF(gbPrev,curr Quotient,temp->getPoly());1151 //poly tempNF = kNF(gbPrev,currRing->qideal,temp->getPoly()); 1152 1152 //Print("!!!\n"); 1153 1153 //if(NULL != tempNF) { … … 1758 1758 pNorm(temp); 1759 1759 //pWrite(temp); 1760 poly tempNF = kNF(gbPrev,curr Quotient,temp);1760 poly tempNF = kNF(gbPrev,currRing->qideal,temp); 1761 1761 pNorm(tempNF); 1762 1762 if(NULL == tempNF) { … … 1962 1962 gbPrev->m[0] = gPrev->getFirst()->getPoly(); 1963 1963 //idShow(gbPrev); 1964 //idShow(curr Quotient);1964 //idShow(currRing->qideal); 1965 1965 for(i=2; i<=IDELEMS(id); i++) { 1966 1966 LNode* gPrevTag = gPrev->getLast(); -
kernel/GBEngine/kstd1.cc
r8b5fff rac00e2f 2654 2654 pp = p_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing); 2655 2655 2656 if(Q == curr Quotient)2656 if(Q == currRing->qideal) 2657 2657 Q = SCAQuotient(currRing); 2658 2658 } … … 2704 2704 pp = id_KillSquares(pp, m_iFirstAltVar, m_iLastAltVar, currRing, false); 2705 2705 2706 if(Q == curr Quotient)2706 if(Q == currRing->qideal) 2707 2707 Q = SCAQuotient(currRing); 2708 2708 } … … 2770 2770 // tempQ = SCAQuotient(currRing); 2771 2771 2772 if(Q == curr Quotient)2772 if(Q == currRing->qideal) 2773 2773 tempQ = SCAQuotient(currRing); 2774 2774 } -
kernel/GBEngine/nc.cc
r8b5fff rac00e2f 22 22 ideal twostd(ideal I) // works in currRing only! 23 23 { 24 ideal J = kStd(I, curr Quotient, testHomog, NULL, NULL, 0, 0, NULL); // in currRing!!!24 ideal J = kStd(I, currRing->qideal, testHomog, NULL, NULL, 0, 0, NULL); // in currRing!!! 25 25 idSkipZeroes(J); // ring independent! 26 26 … … 95 95 96 96 // if( q != NULL) 97 q = kNF(J, curr Quotient, q, 0, KSTD_NF_NONORM); // in currRing!!!97 q = kNF(J, currRing->qideal, q, 0, KSTD_NF_NONORM); // in currRing!!! 98 98 99 99 #ifdef PDEBUG 100 100 p_Test(q, currRing); 101 101 #if 0 102 Print("NF(J/curr Quotient)=> q: "); // !102 Print("NF(J/currRing->qideal)=> q: "); // ! 103 103 p_Write(q, currRing); 104 104 #endif … … 179 179 SI_SAVE_OPT1(save1); 180 180 si_opt_1|=Sy_bit(OPT_SB_1); // ring independent 181 J = kStd(id_tmp, curr Quotient, testHomog, NULL, NULL, 0, iSize); // J = J + K, J - std // in currRing!181 J = kStd(id_tmp, currRing->qideal, testHomog, NULL, NULL, 0, iSize); // J = J + K, J - std // in currRing! 182 182 SI_RESTORE_OPT1(save1); 183 183 #else 184 J=kStd(id_tmp, curr Quotient,testHomog,NULL,NULL,0,0,NULL);184 J=kStd(id_tmp, currRing->qideal,testHomog,NULL,NULL,0,0,NULL); 185 185 #endif 186 186 … … 258 258 int flag, flagcnt=0, syzcnt=0; 259 259 int syzcomp = 0; 260 ideal I = kStd(L, curr Quotient,testHomog,NULL,NULL,0,0,NULL);260 ideal I = kStd(L, currRing->qideal,testHomog,NULL,NULL,0,0,NULL); 261 261 idSkipZeroes(I); 262 262 ideal s_I; 263 263 int idI = idElem(I); 264 264 ideal trickyQuotient; 265 if (curr Quotient!=NULL)266 { 267 trickyQuotient = idSimpleAdd(curr Quotient,I);265 if (currRing->qideal !=NULL) 266 { 267 trickyQuotient = idSimpleAdd(currRing->qideal,I); 268 268 } 269 269 else … … 295 295 { 296 296 q = pp_Mult_mm(I->m[j],var[i],currRing); 297 q = kNF(I,curr Quotient,q,0,0);297 q = kNF(I,currRing->qideal,q,0,0); 298 298 if (q!=0) 299 299 { … … 345 345 idDelete(&s_h3); 346 346 Print("...computing Syz"); 347 s_h3 = kStd(s_h2, curr Quotient,(tHomog)FALSE,NULL,NULL,syzcomp,idI);347 s_h3 = kStd(s_h2, currRing->qideal,(tHomog)FALSE,NULL,NULL,syzcomp,idI); 348 348 SI_RESTORE_OPT1(save1); 349 349 //idShow(s_h3); … … 369 369 } 370 370 idTest(s_h3); 371 S[syzcnt]=kStd(s_h3,curr Quotient,(tHomog)FALSE,NULL,NULL);371 S[syzcnt]=kStd(s_h3,currRing->qideal,(tHomog)FALSE,NULL,NULL); 372 372 syzcnt++; 373 373 idDelete(&s_h3); … … 408 408 } 409 409 Print("final std"); 410 res = kStd(res, curr Quotient,testHomog,NULL,NULL,0,0,NULL);410 res = kStd(res, currRing->qideal,testHomog,NULL,NULL,0,0,NULL); 411 411 idSkipZeroes(res); 412 412 return(res); -
kernel/GBEngine/sca.cc
r8b5fff rac00e2f 139 139 ideal tempQ = Q; 140 140 141 if(Q == curr Quotient)141 if(Q == currRing->qideal) 142 142 tempQ = SCAQuotient(currRing); 143 143 … … 413 413 ideal tempQ = Q; 414 414 415 if(Q == curr Quotient)415 if(Q == currRing->qideal) 416 416 tempQ = SCAQuotient(currRing); 417 417 … … 912 912 ideal tempQ = Q; 913 913 914 if(Q == curr Quotient)914 if(Q == currRing->qideal) 915 915 tempQ = SCAQuotient(currRing); 916 916 -
kernel/GBEngine/syz.cc
r8b5fff rac00e2f 364 364 365 365 if (syzIndex<1) syzIndex=1; 366 if ((syzIndex==1) && (idHomModule(res[0],curr Quotient,&dummy)) && (!rIsPluralRing(currRing)))366 if ((syzIndex==1) && (idHomModule(res[0],currRing->qideal,&dummy)) && (!rIsPluralRing(currRing))) 367 367 { 368 368 syMinStep1(res,length); … … 438 438 if ((weights!=NULL) && (*weights!=NULL)&& ((*weights)[0]!=NULL)) 439 439 { 440 if (!idTestHomModule(res[0],curr Quotient,(*weights)[0]))440 if (!idTestHomModule(res[0],currRing->qideal,(*weights)[0])) 441 441 { 442 442 WarnS("wrong weights given(1):"); (*weights)[0]->show();PrintLn(); 443 idHomModule(res[0],curr Quotient,&w);443 idHomModule(res[0],currRing->qideal,&w); 444 444 w->show();PrintLn(); 445 445 *weights=NULL; … … 449 449 if ((weights==NULL) || (*weights==NULL) || ((*weights)[0]==NULL)) 450 450 { 451 hom=(tHomog)idHomModule(res[0],curr Quotient,&w);451 hom=(tHomog)idHomModule(res[0],currRing->qideal,&w); 452 452 if (hom==isHomog) 453 453 { … … 523 523 if (minim || (syzIndex!=0)) 524 524 { 525 temp = kInterRedOld(res[syzIndex],curr Quotient);525 temp = kInterRedOld(res[syzIndex],currRing->qideal); 526 526 idDelete(&res[syzIndex]); 527 527 idSkipZeroes(temp); … … 530 530 temp = NULL; 531 531 /*--- computing the syzygy modules --------------------------------*/ 532 if ((curr Quotient==NULL)&&(syzIndex==0)&& (!TEST_OPT_DEGBOUND))532 if ((currRing->qideal==NULL)&&(syzIndex==0)&& (!TEST_OPT_DEGBOUND)) 533 533 { 534 534 res[/*syzIndex+*/1] = idSyzygies(res[0/*syzIndex*/],hom,&w,FALSE,setRegularity,&Kstd1_deg); … … 629 629 #ifdef HAVE_PLURAL 630 630 631 const ideal idSaveCurrQuotient = currQuotient;632 631 const ideal idSaveCurrRingQuotient = currRing->qideal; 633 632 … … 642 641 if( ncExtensions(TESTSYZSCAMASK) ) 643 642 { 644 currQuotient = SCAQuotient(currRing); 645 currRing->qideal = currQuotient; 643 currRing->qideal = SCAQuotient(currRing); 646 644 } 647 645 … … 655 653 syStrategy result=(syStrategy)omAlloc0(sizeof(ssyStrategy)); 656 654 657 if ((w!=NULL) && (!idTestHomModule(arg,curr Quotient,w))) // is this right in SCA case???655 if ((w!=NULL) && (!idTestHomModule(arg,currRing->qideal,w))) // is this right in SCA case??? 658 656 { 659 657 WarnS("wrong weights given(2):");w->show();PrintLn(); 660 idHomModule(arg,curr Quotient,&w);658 idHomModule(arg,currRing->qideal,&w); 661 659 w->show();PrintLn(); 662 660 w=NULL; … … 694 692 if( ncExtensions(TESTSYZSCAMASK) ) 695 693 { 696 currQuotient = idSaveCurrQuotient;697 694 currRing->qideal = idSaveCurrRingQuotient; 698 695 } … … 828 825 if (weights!=NULL) 829 826 { 830 if (!idTestHomModule(res[0],curr Quotient,weights))827 if (!idTestHomModule(res[0],currRing->qideal,weights)) 831 828 { 832 829 WarnS("wrong weights given(3):");weights->show();PrintLn(); 833 idHomModule(res[0],curr Quotient,&w);830 idHomModule(res[0],currRing->qideal,&w); 834 831 if (w!=NULL) { w->show();PrintLn();} 835 832 weights=NULL; … … 837 834 } 838 835 #if 0 839 if (idHomModule(res[0],curr Quotient,&w)!=isHomog)836 if (idHomModule(res[0],currRing->qideal,&w)!=isHomog) 840 837 { 841 838 Warn("betti-command: Input is not homogeneous!"); -
kernel/GBEngine/syz0.cc
r8b5fff rac00e2f 79 79 80 80 while (((k<wend) && (pGetComp(F[k]) == i)) || 81 ((curr Quotient!=NULL) && (k<regularPairs+IDELEMS(currQuotient))))81 ((currRing->qideal!=NULL) && (k<regularPairs+IDELEMS(currRing->qideal)))) 82 82 { 83 83 p = pOne(); 84 84 if ((k<wend) && (pGetComp(F[k]) == i) && (k!=j)) 85 85 pLcm(F[j],F[k],p); 86 else if (ii<IDELEMS(curr Quotient))86 else if (ii<IDELEMS(currRing->qideal)) 87 87 { 88 88 q = pHead(F[j]); … … 93 93 pSetm(q); 94 94 } 95 pLcm(q,curr Quotient->m[ii],p);95 pLcm(q,currRing->qideal->m[ii],p); 96 96 if (mW!=NULL) 97 97 { … … 472 472 pSetExp(p,j,pGetExp(p,j) -pGetExp(mW->m[pGetComp(p)-1],j)); 473 473 } 474 while ((p!=NULL) && (i<IDELEMS(curr Quotient)))475 { 476 if (pDivisibleBy(curr Quotient->m[i],p))474 while ((p!=NULL) && (i<IDELEMS(currRing->qideal))) 475 { 476 if (pDivisibleBy(currRing->qideal->m[i],p)) 477 477 { 478 478 //pNorm(toNorm); 479 toNorm = ksOldSpolyRed(curr Quotient->m[i],toNorm);479 toNorm = ksOldSpolyRed(currRing->qideal->m[i],toNorm); 480 480 pDelete(&p); 481 481 if (toNorm==NULL) return NULL; … … 530 530 //for (j=0;j<Fl;j++) pWrite(F[j]); 531 531 //PrintLn(); 532 if (curr Quotient==NULL)532 if (currRing->qideal==NULL) 533 533 pairs=(polyset)omAlloc0(Fl*sizeof(poly)); 534 534 else 535 535 { 536 gencQ = IDELEMS(curr Quotient);536 gencQ = IDELEMS(currRing->qideal); 537 537 pairs=(polyset)omAlloc0((Fl+gencQ)*sizeof(poly)); 538 538 } … … 564 564 } 565 565 syCreatePairs(F,lini,wend,k,j,i,pairs,Fl,mW); 566 if (curr Quotient!=NULL) wend = Fl+gencQ;566 if (currRing->qideal!=NULL) wend = Fl+gencQ; 567 567 for (k=lini;k<wend;k++) 568 568 { … … 593 593 { 594 594 syz = pairs[k]; 595 syz->coef = nCopy(curr Quotient->m[k-Fl]->coef);595 syz->coef = nCopy(currRing->qideal->m[k-Fl]->coef); 596 596 syz->coef = nNeg(syz->coef); 597 597 lastmonom = syz; 598 598 multWith = pDivide(syz,F[j]); 599 multWith->coef = nCopy(curr Quotient->m[k-Fl]->coef);599 multWith->coef = nCopy(currRing->qideal->m[k-Fl]->coef); 600 600 } 601 601 pSetComp(syz,j+1); … … 611 611 else 612 612 { 613 PrintS("pair: ");pWrite0(F[j]);PrintS(" ");pWrite(curr Quotient->m[k-Fl]);613 PrintS("pair: ");pWrite0(F[j]);PrintS(" ");pWrite(currRing->qideal->m[k-Fl]); 614 614 } 615 615 } … … 646 646 if (l<kkk) 647 647 { 648 if ((curr Quotient!=NULL) && (isNotReduced))648 if ((currRing->qideal!=NULL) && (isNotReduced)) 649 649 { 650 650 kBucketClear(sy0buck,&toRed,<R); … … 727 727 } 728 728 (*newmodcomp)[Fl+1] = Sl; 729 if (curr Quotient==NULL)729 if (currRing->qideal==NULL) 730 730 omFreeSize((ADDRESS)pairs,Fl*sizeof(poly)); 731 731 else 732 omFreeSize((ADDRESS)pairs,(Fl+IDELEMS(curr Quotient))*sizeof(poly));732 omFreeSize((ADDRESS)pairs,(Fl+IDELEMS(currRing->qideal))*sizeof(poly)); 733 733 omFreeSize((ADDRESS)Flength,Fl*sizeof(int)); 734 734 delete *modcomp; … … 1030 1030 fr[i] = NULL; 1031 1031 } 1032 if (curr Quotient!=NULL)1032 if (currRing->qideal!=NULL) 1033 1033 { 1034 1034 for (int i=0; i<rl; i++) … … 1036 1036 if (result->fullres[i]!=NULL) 1037 1037 { 1038 ideal t=kNF(curr Quotient,NULL,result->fullres[i]);1038 ideal t=kNF(currRing->qideal,NULL,result->fullres[i]); 1039 1039 idDelete(&result->fullres[i]); 1040 1040 result->fullres[i]=t; -
kernel/GBEngine/syz3.cc
r8b5fff rac00e2f 1852 1852 if (temp->m[i]!=NULL) 1853 1853 { 1854 new_generators->m[0] = kNF(syzstr->res[0],curr Quotient,temp->m[i]);1854 new_generators->m[0] = kNF(syzstr->res[0],currRing->qideal,temp->m[i]); 1855 1855 if (!nIsOne(pGetCoeff(new_generators->m[0]))) 1856 1856 pNorm(new_generators->m[0]); -
kernel/GBEngine/test.cc
r8b5fff rac00e2f 267 267 268 268 { 269 ideal G = kStd(I, curr Quotient, testHomog, NULL);269 ideal G = kStd(I, currRing->qideal, testHomog, NULL); 270 270 271 271 #ifdef PDEBUG -
kernel/GBEngine/units.cc
r8b5fff rac00e2f 34 34 } 35 35 ideal M0=idInit(IDELEMS(M),M->rank); 36 ideal M1=kNF(N,curr Quotient,M,0,KSTD_NF_ECART);36 ideal M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART); 37 37 while(idElem(M1)>0&&(d==-1||id_MinDegW(M1,w,currRing)<=d)) 38 38 { … … 47 47 } 48 48 idDelete(&M1); 49 M1=kNF(N,curr Quotient,M,0,KSTD_NF_ECART);49 M1=kNF(N,currRing->qideal,M,0,KSTD_NF_ECART); 50 50 } 51 51 idDelete(&M1); -
kernel/fglm/fglmhom.cc
r8b5fff rac00e2f 109 109 { 110 110 int numelems; 111 intvec * newhilb = hHstdSeries( current, NULL, curr Quotient);111 intvec * newhilb = hHstdSeries( current, NULL, currRing->qideal ); 112 112 113 113 loop … … 351 351 rChangeCurrRing( sourceRing ); 352 352 353 intvec * hilb = hHstdSeries( sourceIdeal, NULL, curr Quotient);353 intvec * hilb = hHstdSeries( sourceIdeal, NULL, currRing->qideal ); 354 354 int s; 355 355 dat.sourceIdeal= sourceIdeal; -
kernel/ideals.cc
r8b5fff rac00e2f 68 68 } 69 69 #endif 70 homog = idHomModule(h1,curr Quotient,&wth);70 homog = idHomModule(h1,currRing->qideal,&wth); 71 71 if (rHasGlobalOrdering(currRing)) 72 72 { … … 79 79 else 80 80 { 81 ideal re=kMin_std(h1,curr Quotient,(tHomog)homog,&wth,h2,NULL,0,3);81 ideal re=kMin_std(h1,currRing->qideal,(tHomog)homog,&wth,h2,NULL,0,3); 82 82 idDelete(&re); 83 83 return h2; … … 91 91 pEnlargeSet(&(e->m),IDELEMS(e),15); 92 92 IDELEMS(e) = 16; 93 h2 = kStd(h1,curr Quotient,isNotHomog,NULL);93 h2 = kStd(h1,currRing->qideal,isNotHomog,NULL); 94 94 h3 = idMaxIdeal(1); 95 95 h4=idMult(h2,h3); 96 96 idDelete(&h3); 97 h3=kStd(h4,curr Quotient,isNotHomog,NULL);97 h3=kStd(h4,currRing->qideal,isNotHomog,NULL); 98 98 k = IDELEMS(h3); 99 99 while ((k > 0) && (h3->m[k-1] == NULL)) k--; … … 124 124 idDelete(&h3); 125 125 idDelete(&h4); 126 if (curr Quotient!=NULL)126 if (currRing->qideal!=NULL) 127 127 { 128 128 h3=idInit(1,e->rank); 129 h2=kNF(h3,curr Quotient,e);129 h2=kNF(h3,currRing->qideal,e); 130 130 idDelete(&h3); 131 131 idDelete(&e); … … 236 236 if (length==0) 237 237 { 238 if ((curr Quotient==NULL)238 if ((currRing->qideal==NULL) 239 239 && (currRing->OrdSgn==1) 240 240 && (!rIsPluralRing(currRing)) … … 284 284 } 285 285 intvec *w=NULL; 286 temp1 = kStd(temp,curr Quotient,testHomog,&w,NULL,length);286 temp1 = kStd(temp,currRing->qideal,testHomog,&w,NULL,length); 287 287 if (w!=NULL) delete w; 288 288 idDelete(&temp); … … 336 336 { 337 337 w=NULL; 338 temp1=kStd(result,curr Quotient,testHomog,&w);338 temp1=kStd(result,currRing->qideal,testHomog,&w); 339 339 if (w!=NULL) delete w; 340 340 idDelete(&result); … … 342 342 return temp1; 343 343 } 344 else //temp1=kInterRed(result,curr Quotient);344 else //temp1=kInterRed(result,currRing->qideal); 345 345 return result; 346 346 } … … 424 424 } 425 425 /* std computation --------------------------------------------*/ 426 tempstd = kStd(bigmat,curr Quotient,testHomog,&w,NULL,syzComp);426 tempstd = kStd(bigmat,currRing->qideal,testHomog,&w,NULL,syzComp); 427 427 if (w!=NULL) delete w; 428 428 idDelete(&bigmat); … … 491 491 //if (hom==testHomog) 492 492 //{ 493 // if(idHomIdeal(h1,curr Quotient))493 // if(idHomIdeal(h1,currRing->qideal)) 494 494 // { 495 495 // hom=TRUE; … … 531 531 532 532 Print("Prepare::currQuotient: "); 533 idPrint(curr Quotient);533 idPrint(currRing->qideal); 534 534 #endif 535 535 #endif … … 539 539 idTest(h2); 540 540 541 h3 = kStd(h2,curr Quotient,hom,w,NULL,syzcomp);541 h3 = kStd(h2,currRing->qideal,hom,w,NULL,syzcomp); 542 542 543 543 #if MYTEST … … 700 700 } 701 701 idTest(s_h3); 702 if (curr Quotient!= NULL)703 { 704 ideal ts_h3=kStd(s_h3,curr Quotient,h,w);702 if (currRing->qideal != NULL) 703 { 704 ideal ts_h3=kStd(s_h3,currRing->qideal,h,w); 705 705 idDelete(&s_h3); 706 706 s_h3 = ts_h3; … … 1041 1041 } 1042 1042 } 1043 ideal s_result = kNF(s_h3,curr Quotient,s_temp,k);1043 ideal s_result = kNF(s_h3,currRing->qideal,s_temp,k); 1044 1044 s_result->rank = s_h3->rank; 1045 1045 ideal s_rest = idInit(IDELEMS(s_result),k); … … 1225 1225 if ((k2==0) && (k>1)) *addOnlyOne = FALSE; 1226 1226 intvec * weights; 1227 hom = (tHomog)idHomModule(h1,curr Quotient,&weights);1227 hom = (tHomog)idHomModule(h1,currRing->qideal,&weights); 1228 1228 if /**addOnlyOne &&*/ (/*(*/ !h1IsStb /*)*/) 1229 temph1 = kStd(h1,curr Quotient,hom,&weights,NULL);1229 temph1 = kStd(h1,currRing->qideal,hom,&weights,NULL); 1230 1230 else 1231 1231 temph1 = idCopy(h1); … … 1343 1343 ideal s_h4 = idInitializeQuot (h1,h2,h1IsStb,&addOnlyOne,&kmax); 1344 1344 1345 hom = (tHomog)idHomModule(s_h4,curr Quotient,&weights1);1345 hom = (tHomog)idHomModule(s_h4,currRing->qideal,&weights1); 1346 1346 1347 1347 ring orig_ring=currRing; … … 1363 1363 if (addOnlyOne) 1364 1364 { 1365 s_h3 = kStd(s_h4,curr Quotient,hom,&weights1,NULL,0/*kmax-1*/,IDELEMS(s_h4)-1);1365 s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,0/*kmax-1*/,IDELEMS(s_h4)-1); 1366 1366 } 1367 1367 else 1368 1368 { 1369 s_h3 = kStd(s_h4,curr Quotient,hom,&weights1,NULL,kmax-1);1369 s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,kmax-1); 1370 1370 } 1371 1371 SI_RESTORE_OPT1(old_test1); … … 1428 1428 return idCopy(h1); 1429 1429 } 1430 if ((curr Quotient!=NULL) && rIsPluralRing(origR))1430 if ((currRing->qideal!=NULL) && rIsPluralRing(origR)) 1431 1431 { 1432 1432 WerrorS("cannot eliminate in a qring"); … … 1698 1698 { 1699 1699 q = p; 1700 p = kNF(R,curr Quotient,q);1700 p = kNF(R,currRing->qideal,q); 1701 1701 p_Delete(&q,currRing); 1702 1702 } … … 1762 1762 { 1763 1763 q = p; 1764 p = kNF(R,curr Quotient,q);1764 p = kNF(R,currRing->qideal,q); 1765 1765 p_Delete(&q,currRing); 1766 1766 } … … 1834 1834 //if (ar>1) // otherwise done in mpMinorToResult 1835 1835 //{ 1836 // matrix bb=(matrix)kNF(R,curr Quotient,(ideal)b);1836 // matrix bb=(matrix)kNF(R,currRing->qideal,(ideal)b); 1837 1837 // bb->rank=b->rank; bb->nrows=b->nrows; bb->ncols=b->ncols; 1838 1838 // idDelete((ideal*)&b); b=bb; … … 1866 1866 if (id1->m[i] != NULL) 1867 1867 { 1868 p = kNF(id2,curr Quotient,id1->m[i]);1868 p = kNF(id2,currRing->qideal,id1->m[i]); 1869 1869 if (p != NULL) 1870 1870 { … … 1989 1989 s_temp=arg; 1990 1990 1991 ideal s_temp1 = kStd(s_temp,curr Quotient,testHomog,&w,NULL,length);1991 ideal s_temp1 = kStd(s_temp,currRing->qideal,testHomog,&w,NULL,length); 1992 1992 if (w!=NULL) delete w; 1993 1993 … … 2121 2121 2122 2122 idTest(s_temp); 2123 ideal s_temp1 = kStd(s_temp,curr Quotient,hom,&wtmp,NULL,length);2123 ideal s_temp1 = kStd(s_temp,currRing->qideal,hom,&wtmp,NULL,length); 2124 2124 2125 2125 //if (wtmp!=NULL) Print("output weights:");wtmp->show(1);PrintLn(); -
kernel/ideals.h
r8b5fff rac00e2f 16 16 typedef ideal * resolvente; 17 17 18 extern ideal currQuotient;19 20 21 18 inline ideal idCopyFirstK (const ideal ide, const int k, ring R = currRing) 22 19 { -
kernel/polys.cc
r8b5fff rac00e2f 11 11 12 12 ring currRing = NULL; 13 ideal currQuotient = NULL;14 13 15 14 void rChangeCurrRing(ring r) … … 27 26 //------------ set global ring vars -------------------------------- 28 27 currRing = r; 29 curr Quotient= r->qideal;28 currRing->qideal = r->qideal; 30 29 //------------ global variables related to coefficients ------------ 31 30 assume( r->cf!= NULL ); … … 38 37 { 39 38 currRing = NULL; 40 curr Quotient= NULL;39 currRing->qideal = NULL; 41 40 } 42 41 } … … 53 52 //------------ set global ring vars -------------------------------- 54 53 //currRing = r; 55 //currQuotient=NULL;56 54 if (r != NULL) 57 55 { 58 56 rTest(r); 59 57 //------------ set global ring vars -------------------------------- 60 //currQuotient=r->qideal;61 58 62 59 //------------ global variables related to coefficients ------------ -
kernel/test.cc
r8b5fff rac00e2f 378 378 379 379 { 380 ideal G = kStd(I, curr Quotient, testHomog, NULL);380 ideal G = kStd(I, currRing->qideal, testHomog, NULL); 381 381 382 382 #ifdef PDEBUG -
libpolys/polys/matpol.cc
r8b5fff rac00e2f 1423 1423 //for (j=c-1;j>=0;j--) 1424 1424 //{ 1425 // if (q1[j]!=NULL) q1[j] = kNF(R,curr Quotient,q1[j]);1425 // if (q1[j]!=NULL) q1[j] = kNF(R,currRing->qideal,q1[j]); 1426 1426 //} 1427 1427 } … … 1463 1463 for (j=c-1;j>=0;j--) 1464 1464 { 1465 if (q1[j]!=NULL) q1[j] = kNF(R,curr Quotient,q1[j]);1465 if (q1[j]!=NULL) q1[j] = kNF(R,currRing->qideal,q1[j]); 1466 1466 } 1467 1467 } -
libpolys/polys/monomials/ring.cc
r8b5fff rac00e2f 4649 4649 { 4650 4650 new_r->qideal = idrCopyR(old_r->qideal, old_r, new_r); 4651 //currQuotient = new_r->qideal;4652 4651 } 4653 4652
Note: See TracChangeset
for help on using the changeset viewer.