Changeset 52e2f6 in git for kernel/ideals.cc
- Timestamp:
- Jun 10, 2008, 12:17:33 PM (15 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- 28325ab307b0d45f178c4ce869547de7d3f3faa7
- Parents:
- f2b58394b7c0b28984794adfcef85f56f72e35bf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ideals.cc
rf2b5839 r52e2f6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.5 5 2008-04-04 09:51:37 SingularExp $ */4 /* $Id: ideals.cc,v 1.56 2008-06-10 10:17:31 motsak Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 26 26 27 27 28 #define MYTEST 0 29 30 28 31 /* #define WITH_OLD_MINOR */ 29 32 #define pCopy_noCheck(p) pCopy(p) … … 65 68 void idShow(ideal id) 66 69 { 67 Print("Module of rank %d,real rank %d and %d generators.\n", 68 id->rank,idRankFreeModule(id),IDELEMS(id)); 69 for (int i=0;i<id->ncols*id->nrows;i++) 70 { 71 if (id->m[i]!=NULL) 72 { 73 Print("generator %d: ",i);pWrite(id->m[i]); 70 if( id == NULL ) 71 Print("(NULL)"); 72 else 73 { 74 Print("Module of rank %d,real rank %d and %d generators.\n", 75 id->rank,idRankFreeModule(id),IDELEMS(id)); 76 for (int i=0;i<id->ncols*id->nrows;i++) 77 { 78 if (id->m[i]!=NULL) 79 { 80 Print("generator %d: ",i);pWrite(id->m[i]); 81 } 74 82 } 75 83 } … … 1299 1307 } 1300 1308 h2->rank = syzcomp+i+1; 1309 1310 #if MYTEST 1311 #ifdef RDEBUG 1312 Print("Prepare::h2: "); 1313 idPrint(h2); 1314 #endif 1315 #endif 1316 1301 1317 for (j=0; j<=i; j++) 1302 1318 { … … 1316 1332 #ifdef PDEBUG 1317 1333 for(j=0;j<IDELEMS(h2);j++) pTest(h2->m[j]); 1334 1335 #if MYTEST 1336 #ifdef RDEBUG 1337 Print("Prepare::Input: "); 1338 idPrint(h2); 1339 1340 Print("Prepare::currQuotient: "); 1341 idPrint(currQuotient); 1342 #endif 1318 1343 #endif 1319 h3=kStd(h2,currQuotient,h,w,NULL,syzcomp); 1344 1345 #endif 1346 1347 1348 h3 = kStd(h2,currQuotient,h,w,NULL,syzcomp); 1320 1349 idDelete(&h2); 1321 1350 return h3; … … 1528 1557 if (k==1) verbose |=Sy_bit(V_IDLIFT); 1529 1558 1530 ring orig_ring =currRing;1531 ring syz_ring =rCurrRingAssure_SyzComp();1559 ring orig_ring = currRing; 1560 ring syz_ring = rCurrRingAssure_SyzComp(); 1532 1561 rSetSyzComp(k); 1533 1562 1563 1564 #if MYTEST 1565 #ifdef RDEBUG 1566 rWrite(syz_ring); 1567 rDebugPrint(syz_ring); 1568 #endif 1569 #endif 1570 1534 1571 ideal s_h1=h1; 1535 1572 … … 1539 1576 s_h1 = h1; 1540 1577 1578 #if MYTEST 1579 #ifdef RDEBUG 1580 Print("Input: "); 1581 idPrint(s_h1); 1582 #endif 1583 #endif 1584 1585 1541 1586 ideal s_h3=idPrepare(s_h1,h,k,&w); 1587 1588 #if MYTEST 1589 #ifdef RDEBUG 1590 Print("Prepare: "); 1591 idPrint(s_h3); 1592 #endif 1593 #endif 1594 1542 1595 ideal s_h2 = idInit(IDELEMS(s_h3), s_h3->rank); 1543 1596 1597 #if MYTEST 1598 #ifdef RDEBUG 1599 Print("Temp: "); 1600 idPrint(s_h2); 1601 #endif 1602 #endif 1603 1544 1604 if (w!=NULL) delete w; 1545 1605 i = 0; 1606 1546 1607 for (j=0; j<IDELEMS(s_h3); j++) 1547 1608 { … … 1571 1632 1572 1633 idSkipZeroes(s_h3); 1634 1635 #if MYTEST 1636 #ifdef RDEBUG 1637 Print("Input'': "); 1638 idPrint(s_h3); 1639 #endif 1640 #endif 1641 1573 1642 j = IDELEMS(s_h1); 1574 1643 1644 1645 #if MYTEST 1646 #ifdef RDEBUG 1647 Print("Temp Result: "); 1648 idPrint(s_h2); 1649 #endif 1650 #endif 1651 1652 1575 1653 if (syz_ring!=orig_ring) 1576 1654 { … … 1609 1687 s_h3->m[i] = prMoveR_NoSort(s_h3->m[i], syz_ring); 1610 1688 } 1689 1690 #if MYTEST 1691 #ifdef RDEBUG 1692 Print("Output STD Ideal: "); 1693 idPrint(s_h3); 1694 1695 Print("Output Matrix: "); 1696 iiWriteMatrix(*ma, "ma", 2, 4); 1697 #endif 1698 #endif 1699 1611 1700 1612 1701 if (syz_ring!=orig_ring) rKill(syz_ring); … … 2328 2417 if (idIs0(h1)) return idInit(1,h1->rank); 2329 2418 #ifdef HAVE_PLURAL 2330 if (rIsPluralRing( currRing))2419 if (rIsPluralRing(origR)) 2331 2420 /* in the NC case, we have to check the admissibility of */ 2332 2421 /* the subalgebra to be intersected with */ 2333 2422 { 2334 if ( ncRingType(currRing)!=nc_skew) /* in (quasi)-commutative algebras every subalgebra is admissible */2335 { 2336 if (nc_CheckSubalgebra(delVar, currRing))2423 if ((ncRingType(origR) != nc_skew) && (ncRingType(origR) != nc_exterior)) /* in (quasi)-commutative algebras every subalgebra is admissible */ 2424 { 2425 if (nc_CheckSubalgebra(delVar,origR)) 2337 2426 { 2338 2427 WerrorS("no elimination is possible: subalgebra is not admissible"); … … 2362 2451 block0[0] = 1; 2363 2452 block1[0] = rVar(origR); 2364 wv[0]=(int*)omAlloc(( pVariables+1)*sizeof(int));2365 memset(wv[0],0,( pVariables+1)*sizeof(int));2453 wv[0]=(int*)omAlloc((rVar(origR) + 1)*sizeof(int)); 2454 memset(wv[0],0,(rVar(origR) + 1)*sizeof(int)); 2366 2455 for (j=0;j<rVar(origR);j++) 2367 2456 if (pGetExp(delVar,j+1)!=0) wv[0][j]=1; … … 2376 2465 tmpR->block1 = block1; 2377 2466 tmpR->wvhdl = wv; 2467 2378 2468 rComplete(tmpR, 1); 2379 2469 2380 2470 #ifdef HAVE_PLURAL 2381 2471 /* update nc structure on tmpR */ 2382 if (rIsPluralRing(currRing)) 2383 { 2384 BOOLEAN bBAD = FALSE; 2385 if ( nc_rComplete(origR, tmpR) ) 2472 if (rIsPluralRing(origR)) 2473 { 2474 if ( nc_rComplete(origR, tmpR, false) ) // no quotient ideal! 2386 2475 { 2387 2476 Werror("error in nc_rComplete"); 2388 bBAD = TRUE;2389 }2390 if (!bBAD)2391 {2392 /* tests the admissibility of the new elim. ordering */2393 if ( nc_CheckOrdCondition( tmpR->nc->D, tmpR) )2394 {2395 Werror("no elimination is possible: ordering condition is violated");2396 bBAD = TRUE;2397 }2398 }2399 if (bBAD)2400 {2401 2477 // cleanup 2402 2478 rDelete(tmpR); 2403 2479 if (w!=NULL) 2404 {2405 2480 delete w; 2406 }2407 2481 return idCopy(h1); 2408 2482 }
Note: See TracChangeset
for help on using the changeset viewer.