Changeset b1a5c1 in git for kernel/sca.cc
- Timestamp:
- Jun 20, 2008, 6:54:45 PM (16 years ago)
- Branches:
- (u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
- Children:
- f1b9c57f647835474f1c1a7163a27646f2de70b7
- Parents:
- 8049adb6c137bedd3c5725cd5d503326db71e40c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/sca.cc
r8049ad rb1a5c1 7 7 * Author: motsak (Oleksandr Motsak) 8 8 * Created: 2006/12/18 9 * Version: $Id: sca.cc,v 1.1 8 2008-06-20 12:28:17Singular Exp $9 * Version: $Id: sca.cc,v 1.19 2008-06-20 16:54:45 Singular Exp $ 10 10 *******************************************************************/ 11 11 … … 388 388 if(iComponentMonomM==0 ) 389 389 { 390 WarnS("sca_p_Mult_mm: Multiplication in the left module from the right");390 dReportError("sca_p_Mult_mm: Multiplication in the left module from the right"); 391 391 } 392 392 #endif … … 470 470 if(iComponentMonomM==0 ) 471 471 { 472 WarnS("sca_pp_Mult_mm: Multiplication in the left module from the right");472 dReportError("sca_pp_Mult_mm: Multiplication in the left module from the right"); 473 473 } 474 474 #endif … … 580 580 if(iComponent==0 ) 581 581 { 582 WarnS("sca_mm_Mult_pp: Multiplication in the left module from the right!");582 dReportError("sca_mm_Mult_pp: Multiplication in the left module from the right!"); 583 583 // PrintS("mm = "); p_Write(pMonom, rRing); 584 584 // PrintS("pp = "); p_Write(pPoly, rRing); 585 // assume(iComponent!=0); 585 // assume(iComponent!=0); 586 586 } 587 587 #endif … … 644 644 if( iComponentMonomM!=0 ) 645 645 { 646 if( iComponent!=0 ) 646 if( iComponent!=0 ) 647 647 { 648 648 // REPORT_ERROR … … 656 656 if(iComponent==0) 657 657 { 658 WarnS("sca_mm_Mult_p: Multiplication in the left module from the right!");658 dReportError("sca_mm_Mult_p: Multiplication in the left module from the right!"); 659 659 // PrintS("mm = "); p_Write(pMonom, rRing); 660 660 // PrintS("p = "); p_Write(pPoly, rRing); 661 // assume(iComponent!=0); 661 // assume(iComponent!=0); 662 662 } 663 663 #endif … … 725 725 { 726 726 #ifdef PDEBUG 727 Print("sca_SPoly: different non-zero components!\n");727 dReportError("sca_SPoly: different non-zero components!\n"); 728 728 #endif 729 729 return(NULL); … … 815 815 { 816 816 #ifdef PDEBUG 817 Print("sca_ReduceSpoly: different non-zero components!");817 dReportError("sca_ReduceSpoly: different non-zero components!"); 818 818 #endif 819 819 return(NULL); … … 921 921 } 922 922 923 #ifdef KDEBUG 923 924 if (TEST_OPT_DEBUG) 924 925 { … … 927 928 PrintLn(); 928 929 } 930 #endif 929 931 930 932 enterpairs(h.p, strat->sl, h.ecart, 0, strat); … … 978 980 979 981 PrintS("F: \n"); 980 idPrint(F); 981 PrintS("Q: \n"); 982 idPrint(F); 983 PrintS("Q: \n"); 982 984 idPrint(Q); 983 985 #endif 984 986 #endif 985 987 986 988 987 989 const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing); 988 990 const unsigned int m_iLastAltVar = scaLastAltVar(currRing); … … 1044 1046 if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/ 1045 1047 1048 #ifdef KDEBUG 1046 1049 if (TEST_OPT_DEBUG) messageSets(strat); 1050 #endif 1047 1051 1048 1052 if (strat->Ll== 0) strat->interpt=TRUE; … … 1071 1075 if(strat->P.IsNull()) continue; 1072 1076 1073 1077 1074 1078 if( pNext(strat->P.p) == strat->tail ) 1075 1079 { … … 1180 1184 1181 1185 1186 #ifdef KDEBUG 1182 1187 if (TEST_OPT_DEBUG) messageSets(strat); 1188 #endif 1183 1189 1184 1190 /* release temp data-------------------------------- */ … … 1239 1245 // checks... 1240 1246 ////////////////////////////////////////////////////////////////////////// 1241 if( rG == NULL ) 1247 if( rG == NULL ) 1242 1248 rG = rGR; 1243 1249 … … 1245 1251 assume(rG != NULL); 1246 1252 assume(rIsPluralRing(rG)); 1247 1253 1248 1254 1249 1255 #if MYTEST … … 1256 1262 return false; 1257 1263 1258 1264 1259 1265 // if( (ncRingType(rG) != nc_skew) || (ncRingType(rG) != nc_comm) ) 1260 1266 // return false; … … 1270 1276 PrintS("sca_SetupQuotient: qideal!!!\n"); 1271 1277 #endif 1272 1278 1273 1279 if((rG->qideal != NULL) && (rG != rGR) ) // we cannot change from factor to factor at the time, sorry! 1274 1280 return false; … … 1284 1290 PrintS("sca_SetupQuotient: AltVars?!\n"); 1285 1291 #endif 1286 1292 1287 1293 for(int i = 1; i < N; i++) 1288 1294 { … … 1319 1325 #endif 1320 1326 1321 1327 1322 1328 if( (iAltVarEnd == -1) || (iAltVarStart == (N+1)) ) 1323 1329 return false; // either no alternating varables, or a single one => we are in commutative case! 1324 1330 1325 1331 1326 1332 for(int i = 1; i < N; i++) 1327 1333 { … … 1384 1390 } 1385 1391 1386 1392 1387 1393 assume(rGR->qideal != NULL); 1388 1394 // assume(rG->qideal == NULL); // ? … … 1396 1402 #endif 1397 1403 1398 1404 1399 1405 // check for 1400 1406 // y_{iAltVarStart}^2, y_{iAltVarStart+1}^2, \ldots, y_{iAltVarEnd}^2 (iAltVarEnd > iAltVarStart) … … 1435 1441 #endif 1436 1442 #endif 1437 1443 1438 1444 1439 1445 ////////////////////////////////////////////////////////////////////////// … … 1466 1472 assume(rIsPluralRing(rGR)); 1467 1473 assume(!rIsSCA(rGR)); 1468 1474 1469 1475 const int N = rGR->N; 1470 1476 … … 1476 1482 const ideal idQuotient = rGR->qideal; 1477 1483 1478 1484 1479 1485 ideal tempQ = idQuotient; 1480 1486 1481 1487 if( b <= N && e >= 1 ) 1482 tempQ = id_KillSquares(idQuotient, b, e, rGR); 1488 tempQ = id_KillSquares(idQuotient, b, e, rGR); 1483 1489 1484 1490 idSkipZeroes( tempQ ); … … 1488 1494 else 1489 1495 rGR->GetNC()->SCAQuotient() = tempQ; 1490 1496 1491 1497 ncRingType( rGR, nc_exterior ); 1492 1498 … … 1499 1505 if(rSaveRing != rGR) 1500 1506 rChangeCurrRing(rSaveRing); 1501 1507 1502 1508 return true; 1503 1509 1504 1510 } 1505 1511 … … 1658 1664 1659 1665 strat->P.p = nc_CreateSpoly(strat->P.p1, strat->P.p2, currRing); 1666 if (strat->P.p!=NULL) strat->initEcart(&strat->P); 1660 1667 }// else 1661 1668 1662 1669 1663 1670 if(strat->P.IsNull()) continue; 1664 1671 1665 1672 if (strat->P.p1 == NULL) 1666 1673 { … … 1764 1771 { 1765 1772 assume(p_GetExp(pSave, i, currRing) == 1); 1766 1767 const poly pNew = sca_pp_Mult_xi_pp(i, pNext, currRing); 1768 1769 #ifdef PDEBUG 1770 p_Test(pNew, currRing); 1771 #endif 1772 1773 if( pNew == NULL) continue; 1774 1775 LObject h(pNew); // h = x_i * strat->P 1776 1777 if (TEST_OPT_INTSTRATEGY) 1773 if (pNext!=NULL) 1778 1774 { 1779 // h.pCleardenom(); // also does a pContent 1780 pContent(h.p); 1775 const poly pNew = sca_pp_Mult_xi_pp(i, pNext, currRing); 1776 1777 #ifdef PDEBUG 1778 p_Test(pNew, currRing); 1779 #endif 1780 1781 if( pNew == NULL) continue; 1782 1783 LObject h(pNew); // h = x_i * strat->P 1784 1785 if (TEST_OPT_INTSTRATEGY) 1786 { 1787 // h.pCleardenom(); // also does a pContent 1788 pContent(h.p); 1789 } 1790 else 1791 { 1792 h.pNorm(); 1793 } 1794 1795 strat->initEcart(&h); 1796 h.sev = pGetShortExpVector(h.p); 1797 1798 int pos; 1799 if (strat->Ll==-1) 1800 pos =0; 1801 else 1802 pos = strat->posInL(strat->L,strat->Ll,&h,strat); 1803 1804 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos); 1805 /* 1806 h.sev = pGetShortExpVector(h.p); 1807 strat->initEcart(&h); 1808 1809 h.PrepareRed(strat->use_buckets); 1810 1811 // reduction of the element choosen from L(?) 1812 red_result = strat->red(&h,strat); 1813 1814 // reduction to non-zero new poly 1815 if (red_result != 1) continue; 1816 1817 1818 int pos = posInS(strat,strat->sl,h.p,h.ecart); 1819 1820 // reduce the tail and normalize poly 1821 if (TEST_OPT_INTSTRATEGY) 1822 { 1823 h.pCleardenom(); 1824 if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL)) 1825 { 1826 h.p = redtailBba(&(h),pos-1,strat, withT); // !!! 1827 h.pCleardenom(); 1828 } 1829 } 1830 else 1831 { 1832 h.pNorm(); 1833 if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL)) 1834 h.p = redtailBba(&(h),pos-1,strat, withT); 1835 } 1836 1837 #ifdef KDEBUG 1838 if (TEST_OPT_DEBUG){PrintS(" N:");h.wrp();PrintLn();} 1839 #endif 1840 1841 // h.PrepareRed(strat->use_buckets); // ??? 1842 1843 h.sev = pGetShortExpVector(h.p); 1844 strat->initEcart(&h); 1845 1846 if (strat->Ll==-1) 1847 pos = 0; 1848 else 1849 pos = strat->posInL(strat->L,strat->Ll,&h,strat); 1850 1851 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);*/ 1852 1781 1853 } 1782 else1783 {1784 h.pNorm();1785 }1786 1787 strat->initEcart(&h);1788 h.sev = pGetShortExpVector(h.p);1789 1790 int pos;1791 1792 if (strat->Ll==-1)1793 pos =0;1794 else1795 pos = strat->posInL(strat->L,strat->Ll,&h,strat);1796 1797 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);1798 1799 1800 /*1801 h.sev = pGetShortExpVector(h.p);1802 strat->initEcart(&h);1803 1804 h.PrepareRed(strat->use_buckets);1805 1806 // reduction of the element choosen from L(?)1807 red_result = strat->red(&h,strat);1808 1809 // reduction to non-zero new poly1810 if (red_result != 1) continue;1811 1812 1813 int pos = posInS(strat,strat->sl,h.p,h.ecart);1814 1815 // reduce the tail and normalize poly1816 if (TEST_OPT_INTSTRATEGY)1817 {1818 h.pCleardenom();1819 if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL))1820 {1821 h.p = redtailBba(&(h),pos-1,strat, withT); // !!!1822 h.pCleardenom();1823 }1824 }1825 else1826 {1827 1828 h.pNorm();1829 if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL))1830 h.p = redtailBba(&(h),pos-1,strat, withT);1831 }1832 1833 1834 #ifdef KDEBUG1835 if (TEST_OPT_DEBUG){PrintS(" N:");h.wrp();PrintLn();}1836 #endif1837 1838 // h.PrepareRed(strat->use_buckets); // ???1839 1840 h.sev = pGetShortExpVector(h.p);1841 strat->initEcart(&h);1842 1843 if (strat->Ll==-1)1844 pos = 0;1845 else1846 pos = strat->posInL(strat->L,strat->Ll,&h,strat);1847 1848 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);*/1849 1850 1854 } // for all x_i \in Ann(lm(P)) 1851 1852 1853 1854 1855 1856 1855 } // if red(P) != NULL 1857 1856 … … 1896 1895 1897 1896 // if (Q!=NULL) updateResult(strat->Shdl,Q,strat); 1898 1899 1897 // PrintS("</sca>\n"); 1900 1898 … … 2031 2029 if (lrmax< strat->Ll) lrmax=strat->Ll; /*stat*/ 2032 2030 //test_int_std(strat->kIdeal); 2031 #ifdef KDEBUG 2033 2032 if (TEST_OPT_DEBUG) messageSets(strat); 2033 #endif 2034 2034 if (TEST_OPT_DEGBOUND 2035 2035 && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg)) … … 2070 2070 strat->P.p = nc_CreateSpoly(strat->P.p1, strat->P.p2, currRing); 2071 2071 } 2072 2073 2072 2073 2074 2074 2075 2075 if (strat->P.p1 == NULL) … … 2550 2550 2551 2551 assume( (iFirstAltVar >= 1) && (iLastAltVar <= r->N) && (iFirstAltVar <= iLastAltVar) ); 2552 2552 2553 2553 const int iSize = id->idelems(); 2554 2554
Note: See TracChangeset
for help on using the changeset viewer.