Changeset e5fc4d4 in git
- Timestamp:
- Apr 22, 2005, 8:09:43 PM (18 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- d5bd816e7a2f244105274429818a7d2c90398eee
- Parents:
- a4240cfd934cce40503d1d44e30ef8a2d812ca97
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gring.cc
ra4240cf re5fc4d4 7 7 * Author: levandov (Viktor Levandovsky) 8 8 * Created: 8/00 - 11/00 9 * Version: $Id: gring.cc,v 1.2 4 2005-04-22 16:33:13 SingularExp $9 * Version: $Id: gring.cc,v 1.25 2005-04-22 18:09:42 levandov Exp $ 10 10 *******************************************************************/ 11 11 #include "mod2.h" … … 1617 1617 poly nc_p_CopyGet(poly a, const ring r) 1618 1618 /* for use in getting the mult. matrix elements*/ 1619 { 1619 /* ring r must be a currRing! */ 1620 /* for consistency, copies a poly from the comm. r->nc->basering */ 1621 /* to its image in NC ring */ 1622 { 1623 if (r != currRing) 1624 { 1625 #ifdef PDEBUF 1626 Werror("nc_p_CopyGet call not in currRing"); 1627 #endif 1628 return(NULL); 1629 } 1620 1630 if (!rIsPluralRing(r)) return(p_Copy(a,r)); 1621 1631 if (r==r->nc->basering) return(p_Copy(a,r)); … … 1628 1638 poly nc_p_CopyPut(poly a, const ring r) 1629 1639 /* for use in defining the mult. matrix elements*/ 1630 { 1640 /* ring r must be a currRing! */ 1641 /* for consistency, puts a polynomial from the NC ring */ 1642 /* to its presentation in the comm. r->nc->basering */ 1643 { 1644 if (r != currRing) 1645 { 1646 #ifdef PDEBUF 1647 Werror("nc_p_CopyGet call not in currRing"); 1648 #endif 1649 return(NULL); 1650 } 1631 1651 if (!rIsPluralRing(r)) return(p_Copy(a,r)); 1632 1652 if (r==r->nc->basering) return(p_Copy(a,r)); … … 1637 1657 } 1638 1658 1639 intnc_CheckSubalgebra(poly PolyVar, ring r)1659 BOOLEAN nc_CheckSubalgebra(poly PolyVar, ring r) 1640 1660 /* returns TRUE if there were errors */ 1641 1661 /* checks whether product of vars from PolyVar defines */ 1642 1662 /* an admissible subalgebra of r */ 1643 /* r is indeed currRing */1663 /* r is indeed currRing and assumed to be noncomm. */ 1644 1664 { 1645 1665 ring save = currRing; … … 1692 1712 } 1693 1713 1694 intnc_CheckOrdCondition(matrix D, ring r)1714 BOOLEAN nc_CheckOrdCondition(matrix D, ring r) 1695 1715 /* returns TRUE if there were errors */ 1696 1716 /* checks whether the current ordering */ … … 1702 1722 ring save = currRing; 1703 1723 int WeChangeRing = 0; 1704 if ( currRing != r)1724 if (r != currRing) 1705 1725 { 1706 1726 rChangeCurrRing(r); … … 1709 1729 poly p,q; 1710 1730 int i,j; 1711 int report = 1;1731 int report = 0; 1712 1732 for(i=1; i<r->N; i++) 1713 1733 { … … 1721 1741 p_SetExp(q,j,1,r); 1722 1742 p_Setm(q,r); 1723 if (p_LmCmp(q,p,r) != 1) /* i.e. lm(p) < lm(q)*/1743 if (p_LmCmp(q,p,r) != 1) /* i.e. lm(p)==xy < lm(q)==D_ij */ 1724 1744 { 1725 1745 Print("Bad ordering at %d,%d\n",i,j); … … 1728 1748 p_Write(q,r); 1729 1749 #endif 1730 report = 0;1750 report = 1; 1731 1751 } 1732 1752 p_Delete(&q,r); … … 1738 1758 if ( WeChangeRing ) 1739 1759 rChangeCurrRing(save); 1740 return( !report);1760 return(report); 1741 1761 } 1742 1762 -
kernel/gring.h
ra4240cf re5fc4d4 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: gring.h,v 1.1 0 2005-04-21 16:16:45levandov Exp $ */6 /* $Id: gring.h,v 1.11 2005-04-22 18:09:42 levandov Exp $ */ 7 7 /* 8 8 * ABSTRACT additional defines etc for --with-plural … … 18 18 /* the part, related to the interface */ 19 19 BOOLEAN nc_CallPlural(matrix CC, matrix DD, poly CN, poly DN, ring r); 20 intnc_CheckOrdCondition(matrix D, ring r);21 intnc_CheckSubalgebra(poly PolyVar, ring r);20 BOOLEAN nc_CheckOrdCondition(matrix D, ring r); 21 BOOLEAN nc_CheckSubalgebra(poly PolyVar, ring r); 22 22 BOOLEAN nc_InitMultiplication(ring r); 23 23 BOOLEAN rIsLikeOpposite(ring rBase, ring rCandidate); -
kernel/ideals.cc
ra4240cf re5fc4d4 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1. 9 2005-04-21 16:16:46levandov Exp $ */4 /* $Id: ideals.cc,v 1.10 2005-04-22 18:09:43 levandov Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 2374 2374 /* the subalgebra to be intersected with */ 2375 2375 { 2376 if (currRing->nc->type!=nc_skew) 2376 if (currRing->nc->type!=nc_skew) /* in (quasi)-commutative algebras every subalgebra is admissible */ 2377 2377 { 2378 2378 if (nc_CheckSubalgebra(delVar,currRing)) … … 2426 2426 2427 2427 #ifdef HAVE_PLURAL 2428 // update nc structure on tmpR 2429 // in particular, tests the admissibility of the ordering 2430 if (nc_rComplete(origR, &tmpR)) 2431 { 2432 WerrorS("no elimination is possible: subalgebra is not admissible"); 2433 // goto cleanup 2428 /* update nc structure on tmpR */ 2429 int BAD = 0; 2430 if ( nc_rComplete(origR, &tmpR) ) 2431 { 2432 Werror("error in nc_rComplete"); 2433 BAD = 1; 2434 } 2435 if (!BAD) 2436 { 2437 /* tests the admissibility of the new elim. ordering */ 2438 if ( nc_CheckOrdCondition( (&tmpR)->nc->D, &tmpR) ) 2439 { 2440 Werror("no elimination is possible: ordering condition is violated"); 2441 BAD = 1; 2442 } 2443 } 2444 if (BAD) 2445 { 2446 // cleanup 2434 2447 omFree((ADDRESS)wv[0]); 2435 2448 omFreeSize((ADDRESS)wv,ordersize*sizeof(int**)); … … 2438 2451 omFreeSize((ADDRESS)block1,ordersize*sizeof(int)); 2439 2452 rUnComplete(&tmpR); 2440 if (w!=NULL) 2453 if (w!=NULL) 2454 { 2441 2455 delete w; 2456 } 2442 2457 return idCopy(h1); 2443 2458 } -
kernel/ring.cc
ra4240cf re5fc4d4 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.3 2 2005-04-21 16:16:46levandov Exp $ */4 /* $Id: ring.cc,v 1.33 2005-04-22 18:09:42 levandov Exp $ */ 5 5 6 6 /* … … 3929 3929 if (src->N != N) 3930 3930 { 3931 /* should not happen */ 3931 3932 WarnS("wrong nc_rComplete call"); 3932 3933 return TRUE; 3933 3934 } 3934 // ncKill(dest); // in order to init new3935 // if (nc_CallPlural(src->nc->C, src->nc->D, NULL, NULL, dest))3936 // {3937 // return TRUE;3938 // }3939 // else3940 // return FALSE;3941 // if (dest->nc != NULL)3942 // ncKill(dest);3943 // dest->nc = (nc_struct *)omAlloc0(sizeof(nc_struct));3944 // dest->nc->ref = 1;3945 // dest->nc->basering = dest;3946 // dest->nc->type = src->nc->type;3947 3935 ring save = currRing; 3948 3936 int WeChangeRing = 0; … … 3962 3950 for (j= i+1; j<= N; j++) 3963 3951 { 3964 // n = p_GetCoeff(MATELEM(C0,i,j), src); 3965 // p = pOne(); 3966 // p_SetCoeff(p,n,dest); 3967 // MATELEM(C,i,j) = nc_p_CopyPut(p, dest); 3968 p = prCopyR(MATELEM(C0,i,j), src, dest); // like in nc_p_CopyGet 3969 MATELEM(C,i,j) = p; //nc_p_CopyPut(p, dest); 3970 // p_Delete(&p,dest); 3952 n = n_Copy(p_GetCoeff(MATELEM(C0,i,j), src),src); 3953 p = p_ISet(1,dest); 3954 p_SetCoeff(p,n,dest); 3955 MATELEM(C,i,j) = p; 3971 3956 p = NULL; 3972 3957 if (MATELEM(D0,i,j) != NULL) 3973 3958 { 3974 p = prCopyR(MATELEM(D0,i,j), src , dest); // like in nc_p_CopyGet3975 MATELEM(D,i,j) = p; //nc_p_CopyPut(p, dest);3976 // p_Delete(&p,dest);3959 p = prCopyR(MATELEM(D0,i,j), src->nc->basering, dest); 3960 MATELEM(D,i,j) = nc_p_CopyPut(p, dest); 3961 p_Delete(&p, dest); 3977 3962 p = NULL; 3978 3963 } 3979 3964 } 3980 3965 } 3981 idTest((ideal)C); 3982 idTest((ideal)D); 3966 /* One must test C and D _only_ in r->nc->basering!!! not in r!!! */ 3967 // idTest((ideal)C); 3968 // idTest((ideal)D); 3983 3969 id_Delete((ideal *)&(dest->nc->C),dest->nc->basering); 3984 3970 id_Delete((ideal *)&(dest->nc->D),dest->nc->basering);
Note: See TracChangeset
for help on using the changeset viewer.