Changeset b9642b1 in git
- Timestamp:
- Jan 6, 2009, 3:00:57 PM (14 years ago)
- Branches:
- (u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
- Children:
- 577c14692ef00b8a6d8470158473aeb6af6b08b3
- Parents:
- 939cb2de97b36ac54735806ce7150c37d0450106
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipshell.cc
r939cb2 rb9642b1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipshell.cc,v 1.19 7 2008-10-13 12:45:29Singular Exp $ */4 /* $Id: ipshell.cc,v 1.198 2009-01-06 14:00:57 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 1409 1409 if(!idIsZeroDim(I)) return NULL; // not zero-dim. 1410 1410 poly po=NULL; 1411 if ( currRing->OrdSgn== -1)1411 if (rHasLocalOrMixedOrdering(currRing)) 1412 1412 { 1413 1413 scComputeHC(I,currQuotient,ak,po); -
kernel/gring.h
r939cb2 rb9642b1 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: gring.h,v 1.2 5 2008-07-15 16:27:58 motsakExp $ */6 /* $Id: gring.h,v 1.26 2009-01-06 13:59:35 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT additional defines etc for --with-plural … … 231 231 232 232 /* 233 if ( pOrdSgn==-1)233 if (rHasLocalOrMixedOrder(currRing)) 234 234 { 235 235 assume(currRing->GetNC()->p_Procs.LocalGB!=NULL); -
kernel/ideals.cc
r939cb2 rb9642b1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ideals.cc,v 1.6 2 2008-11-12 16:06:50Singular Exp $ */4 /* $Id: ideals.cc,v 1.63 2009-01-06 13:59:35 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT - all basic methods to manipulate ideals … … 687 687 688 688 homog = idHomModule(h1,currQuotient,&wth); 689 if ( (currRing->OrdSgn == 1) && (!homog))690 { 691 Warn ("minbase applies only to the local or homogeneous case");689 if (rHasGlobalOrdering() && (!homog)) 690 { 691 WarnS("minbase applies only to the local or homogeneous case"); 692 692 e=idCopy(h1); 693 693 return e; -
kernel/ring.cc
r939cb2 rb9642b1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.10 5 2008-11-12 12:38:59Singular Exp $ */4 /* $Id: ring.cc,v 1.106 2009-01-06 13:59:35 Singular Exp $ */ 5 5 6 6 /* … … 1463 1463 int i,j; 1464 1464 ring res=(ring)omAllocBin(ip_sring_bin); 1465 res->idroot=NULL; /* local objects */ 1466 //int* order; /* array of orderings */ 1467 //int* block0; /* starting pos.*/ 1468 //int* block1; /* ending pos.*/ 1469 //char** parameter; /* names of parameters */ 1470 //number minpoly; 1471 //ideal minideal; 1472 //int** wvhdl; /* array of weight vectors */ 1473 //char ** names; /* array of variable names */ 1474 1475 res->options=r->options; /* ring dependent options */ 1476 1477 // what follows below here should be set by rComplete, _only_ 1478 //long *ordsgn; /* array of +/- 1 (or 0) for comparing monomials */ 1479 /* ExpL_Size entries*/ 1480 1481 // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */ 1482 //sro_ord* typ; /* array of orderings + sizes, OrdSize entries */ 1483 1484 //ideal qideal; /* extension to the ring structure: qring */ 1485 1486 1487 //int* VarOffset; 1488 //int* firstwv; 1489 1490 //struct omBin_s* PolyBin; /* Bin from where monoms are allocated */ 1491 res->ch=r->ch; /* characteristic */ 1492 #ifdef HAVE_RINGS 1493 res->ringtype=r->ringtype; /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */ 1494 //res->ringflaga=mpz_copy(r->ringflaga); 1495 res->ringflagb=r->ringflagb; 1496 #endif 1497 res->ref=0; /* reference counter to the ring */ 1498 1499 res->float_len=r->float_len; /* additional char-flags */ 1500 res->float_len2=r->float_len2; /* additional char-flags */ 1501 1502 res->N=r->N; /* number of vars */ 1503 1504 res->P=r->P; /* number of pars */ 1505 res->OrdSgn=r->OrdSgn; /* 1 for polynomial rings, -1 otherwise */ 1506 1507 res->firstBlockEnds=r->firstBlockEnds; 1508 #ifdef HAVE_PLURAL 1509 res->real_var_start=r->real_var_start; 1510 res->real_var_end=r->real_var_end; 1511 #endif 1512 1513 #ifdef HAVE_SHIFTBBA 1514 res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ 1515 #endif 1516 1517 res->VectorOut=r->VectorOut; 1518 res->ShortOut=r->ShortOut; 1519 res->CanShortOut=r->CanShortOut; 1520 res->LexOrder=r->LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks 1521 res->MixedOrder=r->MixedOrder; // ?? 1 for lex ordering (except ls), -1 otherwise 1522 res->ComponentOrder=r->ComponentOrder; 1523 1524 1525 // what follows below here should be set by rComplete, _only_ 1526 // contains component, but no weight fields in E */ 1527 //short ExpL_Size; // size of exponent vector in long 1528 //short CmpL_Size; // portions which need to be compared 1529 /* number of long vars in exp vector: 1530 long vars are those longs in the exponent vector which are 1531 occupied by variables, only */ 1532 //short VarL_Size; 1533 1534 //short BitsPerExp; /* number of bits per exponent */ 1535 //short ExpPerLong; /* maximal number of Exponents per long */ 1536 1537 //short pCompIndex; /* p->exp.e[pCompIndex] is the component */ 1538 //short pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */ 1539 1540 //short OrdSize; /* size of ord vector (in sro_ord) */ 1541 1542 1543 /* if >= 0, long vars in exp vector are consecutive and start there 1544 if < 0, long vars in exp vector are not consecutive */ 1545 //short VarL_LowIndex; 1546 // number of exponents in r->VarL_Offset[0] 1547 // is minimal number of exponents in a long var 1548 //short MinExpPerLong; 1549 1550 /* if this is > 0, then NegWeightL_Offset[0..size_1] is index of longs in 1551 ExpVector whose values need an offset due to negative weights */ 1552 //short NegWeightL_Size; 1553 /* array of NegWeigtL_Size indicies */ 1554 //int* NegWeightL_Offset; 1555 1556 /* array of size VarL_Size, 1557 VarL_Offset[i] gets i-th long var in exp vector */ 1558 //int* VarL_Offset; 1559 1560 /* mask for getting single exponents */ 1561 //unsigned long bitmask; 1562 /* mask used for divisiblity tests */ 1563 //unsigned long divmask; 1564 1565 //p_Procs_s* p_Procs; 1566 1567 /* FDeg and LDeg */ 1568 //pFDegProc pFDeg; 1569 //pLDegProc pLDeg; 1570 1571 /* as it was determined by rComplete */ 1572 //pFDegProc pFDegOrig; 1573 /* and as it was determined before rOptimizeLDeg */ 1574 //pLDegProc pLDegOrig; 1575 1576 //p_SetmProc p_Setm; 1577 //n_Procs_s* cf; 1578 //ring algring; 1579 #ifdef HAVE_PLURAL 1580 // nc_struct* _nc; // private 1581 #endif 1465 1582 1466 1583 memcpy4(res,r,sizeof(ip_sring)); … … 1744 1861 } 1745 1862 1746 BOOLEAN rHasSimpleOrder( ring r)1863 BOOLEAN rHasSimpleOrder(const ring r) 1747 1864 { 1748 1865 if (r->order[0] == ringorder_unspec) return TRUE; … … 1763 1880 1764 1881 // returns TRUE, if simple lp or ls ordering 1765 BOOLEAN rHasSimpleLexOrder( ring r)1882 BOOLEAN rHasSimpleLexOrder(const ring r) 1766 1883 { 1767 1884 return rHasSimpleOrder(r) && … … 1772 1889 } 1773 1890 1774 BOOLEAN rOrder_is_DegOrdering( rRingOrder_t order)1891 BOOLEAN rOrder_is_DegOrdering(const rRingOrder_t order) 1775 1892 { 1776 1893 switch(order) -
kernel/ring.h
r939cb2 rb9642b1 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1.3 3 2008-07-20 15:12:35Singular Exp $ */9 /* $Id: ring.h,v 1.34 2009-01-06 13:59:36 Singular Exp $ */ 10 10 11 11 /* includes */ … … 339 339 int rGetMaxSyzComp(int i); 340 340 341 BOOLEAN rHasSimpleOrder( ring r);341 BOOLEAN rHasSimpleOrder(const ring r); 342 342 // returns TRUE, if simple lp or ls ordering 343 BOOLEAN rHasSimpleLexOrder( ring r);343 BOOLEAN rHasSimpleLexOrder(const ring r); 344 344 // return TRUE if p->exp[r->pOrdIndex] holds total degree of p */ 345 inline BOOLEAN rHasGlobalOrdering(const ring r=currRing) 346 { return (r->OrdSgn==1); } 347 inline BOOLEAN rHasLocalOrMixedOrdering(const ring r=currRing) 348 { return (r->OrdSgn==-1); } 345 349 BOOLEAN rOrd_is_Totaldegree_Ordering(ring r =currRing); 346 350 // return TRUE if p_SetComp requires p_Setm -
kernel/walkProc.cc
r939cb2 rb9642b1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: walkProc.cc,v 1. 1 2005-05-04 15:41:27Singular Exp $ */4 /* $Id: walkProc.cc,v 1.2 2009-01-06 13:59:36 Singular Exp $ */ 5 5 6 6 #include "mod2.h" … … 66 66 state= WalkIncompatibleRings; 67 67 } 68 else if ( (sring->OrdSgn != 1) || (dring->OrdSgn != 1) ) 68 else if ( (rHasLocalOrMixedOrdering(sring)) 69 || (rHasLocalOrMixedOrdering(dring)) ) 69 70 { 70 71 WerrorS( "only works for global orderings" ); … … 86 87 // check if the names of the variables resp. parameters do agree: 87 88 88 int nvar = sring->N;89 int nvar = rVar(sring); 89 90 int npar = rPar(sring); 90 91 int * pperm; … … 99 100 100 101 for ( k= nvar; (k > 0) && (state == WalkOk); k-- ) 101 if ( vperm[k] <= 0 ) { 102 if ( vperm[k] <= 0 ) 103 { 102 104 WerrorS( "variable names do not agree" ); 103 105 state= WalkIncompatibleRings; … … 105 107 106 108 for ( k= npar-1; (k >= 0) && (state == WalkOk); k-- ) 107 if ( pperm[k] >= 0 ) { 109 if ( pperm[k] >= 0 ) 110 { 108 111 WerrorS( "paramater names do not agree" ); 109 112 state= WalkIncompatibleRings; … … 112 115 //remove this to if you want to allow permutations of variables 113 116 for ( k= nvar; (k > 0) && (state == WalkOk); k-- ) 114 if ( vperm[k] != (k) ) { 117 if ( vperm[k] != (k) ) 118 { 115 119 WerrorS( "orders of variables do not agree" ); 116 120 state= WalkIncompatibleRings; … … 119 123 //remove this to if you want to allow permutations of parameters 120 124 for ( k= npar; (k > 0) && (state == WalkOk); k-- ) 121 if ( pperm[k-1] != (-k) ) { 125 if ( pperm[k-1] != (-k) ) 126 { 122 127 WerrorS( "orders of parameters do not agree" ); 123 128 state= WalkIncompatibleRings; … … 130 135 131 136 // check if any of the rings are qrings or not 132 if ( (sring->qideal != NULL) || (dring->qideal != NULL) ){ 133 Werror( "rings are not allowed to be qrings"); 137 if ( (sring->qideal != NULL) || (dring->qideal != NULL) ) 138 { 139 WerrorS( "rings are not allowed to be qrings"); 134 140 return WalkIncompatibleRings; 135 141 } 136 142 137 143 int i=0; 138 while(dring->order[i]!=0){ 144 while(dring->order[i]!=0) 145 { 139 146 if( 140 147 !(dring->order[i]==ringorder_a) && … … 147 154 !(dring->order[i]==ringorder_C) && 148 155 !(dring->order[i]==ringorder_M) 149 ) {150 156 ) 157 { 151 158 state=WalkIncompatibleDestRing; 152 159 } … … 155 162 156 163 i=0; 157 while(sring->order[i]!=0){ 164 while(sring->order[i]!=0) 165 { 158 166 if( 159 167 !(sring->order[i]==ringorder_a) && … … 166 174 !(sring->order[i]==ringorder_C) && 167 175 !(sring->order[i]==ringorder_M) 168 ) { 176 ) 177 { 169 178 state=WalkIncompatibleSourceRing; 170 179 } … … 210 219 ring sring = IDRING( sringHdl ); 211 220 212 if ( rChar(sring) != rChar(dring) ) { 221 if ( rChar(sring) != rChar(dring) ) 222 { 213 223 WerrorS( "rings must have same characteristic" ); 214 224 state= WalkIncompatibleRings; 215 225 } 216 226 217 if ( (sring->OrdSgn != 1) || (dring->OrdSgn != 1) ) { 227 if ( (rHasLocalOrMixedOrdering(sring)) 228 || (rHasLocalOrMixedOrdering(dring)) ) 229 { 218 230 WerrorS( "only works for global orderings" ); 219 231 state= WalkIncompatibleRings; 220 232 } 221 233 222 if ( sring->N != dring->N)234 if ( rVar(sring) != rVar(dring) ) 223 235 { 224 236 WerrorS( "rings must have same number of variables" ); … … 250 262 251 263 for ( k= nvar; (k > 0) && (state == WalkOk); k-- ) 252 if ( vperm[k] <= 0 ) { 264 if ( vperm[k] <= 0 ) 265 { 253 266 WerrorS( "variable names do not agree" ); 254 267 state= WalkIncompatibleRings; … … 256 269 257 270 for ( k= npar; (k > 0) && (state == WalkOk); k-- ) 258 if ( pperm[k-1] >= 0 ){ 271 if ( pperm[k-1] >= 0 ) 272 { 259 273 WerrorS( "parameter names do not agree" ); 260 274 state= WalkIncompatibleRings; … … 264 278 //remove this to if you want to allow permutations of variables 265 279 for ( k= nvar; (k > 0) && (state == WalkOk); k-- ) 266 if ( vperm[k] != (k) ) { 280 if ( vperm[k] != (k) ) 281 { 267 282 WerrorS( "orders of variables do not agree" ); 268 283 state= WalkIncompatibleRings; … … 271 286 //remove this to if you want to allow permutations of parameters 272 287 for ( k= npar; (k > 0) && (state == WalkOk); k-- ) 273 if ( pperm[k-1] != (-k) ) { 288 if ( pperm[k-1] != (-k) ) 289 { 274 290 WerrorS( "orders of parameters do not agree" ); 275 291 state= WalkIncompatibleRings; … … 282 298 283 299 // check if any of the rings are qrings or not 284 if ( (sring->qideal != NULL) || (dring->qideal != NULL) ){ 285 Werror( "rings are not allowed to be qrings"); 300 if ( (sring->qideal != NULL) || (dring->qideal != NULL) ) 301 { 302 WerrorS( "rings are not allowed to be qrings"); 286 303 return WalkIncompatibleRings; 287 304 } … … 296 313 !(dring->order[i]==ringorder_C) && 297 314 !(dring->order[0]==ringorder_M) 298 ) { 315 ) 316 { 299 317 state=WalkIncompatibleDestRing; 300 318 } … … 303 321 304 322 i=0; 305 while(sring->order[i]!=0){ 323 while(sring->order[i]!=0) 324 { 306 325 if( !(sring->order[i]==ringorder_lp) && 307 326 !(sring->order[i]==ringorder_dp) && … … 311 330 !(sring->order[i]==ringorder_C) && 312 331 !(dring->order[0]==ringorder_M) 313 ) { 332 ) 333 { 314 334 state=WalkIncompatibleSourceRing; 315 335 } -
kernel/walkSupport.cc
r939cb2 rb9642b1 1110 1110 int n=rVar(r); 1111 1111 int64vec* res=new int64vec(n,n,(int64)0); 1112 if (r ->OrdSgn != 1) return res;1112 if (rHasLocalOrMixedOrdering(r)) return res; 1113 1113 int pos1=0; 1114 1114 int pos2=0; … … 1188 1188 int64vec* res=new int64vec(n); 1189 1189 1190 if (r ->OrdSgn != 1) return res;1190 if (rHasLocalOrMixedOrdering(r)) return res; 1191 1191 1192 1192 int length; -
kernel/weight.cc
r939cb2 rb9642b1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: weight.cc,v 1. 6 2008-07-08 11:26:50Singular Exp $ */4 /* $Id: weight.cc,v 1.7 2009-01-06 13:59:36 Singular Exp $ */ 5 5 6 6 /* … … 189 189 *eweight = 0; 190 190 n = pVariables; 191 if ( pOrdSgn == -1)191 if (rHasLocalOrMixedOrdering()) 192 192 wFunctional = wFunctionalMora; 193 193 else
Note: See TracChangeset
for help on using the changeset viewer.