[35aab3] | 1 | #ifndef RING_H |
---|
| 2 | #define RING_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
| 6 | /* |
---|
| 7 | * ABSTRACT - the interpreter related ring operations |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | /* includes */ |
---|
[8a8c9e] | 11 | #include <omalloc/omalloc.h> |
---|
[13366d] | 12 | #include <misc/auxiliary.h> |
---|
| 13 | #include <coeffs/coeffs.h> |
---|
[20b794] | 14 | //#include <polys/monomials/polys-impl.h> |
---|
[8a8c9e] | 15 | // |
---|
| 16 | |
---|
| 17 | /* forward declaration of types */ |
---|
| 18 | class idrec; |
---|
[4d0cbc7] | 19 | typedef idrec * idhdl; // _only_ for idhdl ip_sring::idroot |
---|
[8a8c9e] | 20 | struct spolyrec; |
---|
| 21 | typedef struct spolyrec polyrec; |
---|
[cd9796] | 22 | typedef struct spolyrec * poly; |
---|
| 23 | typedef struct spolyrec const * const_poly; |
---|
[5679049] | 24 | struct ip_sring; |
---|
| 25 | typedef struct ip_sring * ring; |
---|
[cd9796] | 26 | typedef struct ip_sring const * const_ring; |
---|
[8a8c9e] | 27 | class intvec; |
---|
[1745e5] | 28 | class int64vec; |
---|
[8a8c9e] | 29 | struct p_Procs_s; |
---|
| 30 | typedef struct p_Procs_s p_Procs_s; |
---|
[6ed8c4] | 31 | //class slists; |
---|
| 32 | //typedef slists * lists; |
---|
[8a8c9e] | 33 | class kBucket; |
---|
| 34 | typedef kBucket* kBucket_pt; |
---|
| 35 | |
---|
[028192] | 36 | struct sip_sideal; |
---|
| 37 | typedef struct sip_sideal * ideal; |
---|
[cd9796] | 38 | typedef struct sip_sideal const * const_ideal; |
---|
[028192] | 39 | |
---|
| 40 | struct sip_smap; |
---|
| 41 | typedef struct sip_smap * map; |
---|
[cd9796] | 42 | typedef struct sip_smap const * const_map; |
---|
[028192] | 43 | |
---|
[8a8c9e] | 44 | /* the function pointer types */ |
---|
| 45 | |
---|
| 46 | typedef long (*pLDegProc)(poly p, int *length, ring r); |
---|
| 47 | typedef long (*pFDegProc)(poly p, ring r); |
---|
| 48 | typedef void (*p_SetmProc)(poly p, const ring r); |
---|
| 49 | |
---|
[c6a3eb2] | 50 | |
---|
[a3d94c] | 51 | /// returns a poly from dest_r which is a ShallowCopy of s_p from source_r |
---|
| 52 | /// assumes that source_r->N == dest_r->N and that orderings are the same |
---|
| 53 | typedef poly (*pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, |
---|
| 54 | omBin dest_bin); |
---|
| 55 | |
---|
[c6a3eb2] | 56 | |
---|
[8a8c9e] | 57 | typedef enum |
---|
| 58 | { |
---|
| 59 | ro_dp, // ordering is a degree ordering |
---|
| 60 | ro_wp, // ordering is a weighted degree ordering |
---|
[f93c5e9] | 61 | ro_am, // ordering is am: weights for vars + weights for gen |
---|
[8a8c9e] | 62 | ro_wp64, // ordering is a weighted64 degree ordering |
---|
| 63 | ro_wp_neg, // ordering is a weighted degree ordering |
---|
| 64 | // with possibly negative weights |
---|
| 65 | ro_cp, // ordering duplicates variables |
---|
| 66 | ro_syzcomp, // ordering indicates "subset" of component number (ringorder_S) |
---|
| 67 | ro_syz, // ordering with component number >syzcomp is lower (ringorder_s) |
---|
| 68 | ro_isTemp, ro_is, // Induced Syzygy (Schreyer) ordering (and prefix data placeholder dummy) (ringorder_IS) |
---|
| 69 | ro_none |
---|
| 70 | } |
---|
| 71 | ro_typ; |
---|
| 72 | |
---|
| 73 | // ordering is a degree ordering |
---|
| 74 | struct sro_dp |
---|
| 75 | { |
---|
| 76 | short place; // where degree is stored (in L): |
---|
| 77 | short start; // bounds of ordering (in E): |
---|
| 78 | short end; |
---|
| 79 | }; |
---|
| 80 | typedef struct sro_dp sro_dp; |
---|
| 81 | |
---|
| 82 | // ordering is a weighted degree ordering |
---|
| 83 | struct sro_wp |
---|
| 84 | { |
---|
| 85 | short place; // where weighted degree is stored (in L) |
---|
| 86 | short start; // bounds of ordering (in E) |
---|
| 87 | short end; |
---|
| 88 | int *weights; // pointers into wvhdl field |
---|
| 89 | }; |
---|
| 90 | typedef struct sro_wp sro_wp; |
---|
| 91 | |
---|
[f93c5e9] | 92 | // ordering is a weighted degree ordering |
---|
| 93 | struct sro_am |
---|
| 94 | { |
---|
| 95 | short place; // where weighted degree is stored (in L) |
---|
| 96 | short start; // bounds of ordering (in E) |
---|
| 97 | short end; |
---|
| 98 | short len_gen; // i>len_gen: weight(gen(i)):=0 |
---|
[3a8a0d9] | 99 | int *weights; // pointers into wvhdl field of length (end-start+1) + len_gen + 1 |
---|
| 100 | // contents w_{start},... w_{end}, len, mod_w_1, .. mod_w_len, 0 |
---|
| 101 | int *weights_m; // pointers into wvhdl field of length len_gen + 1 |
---|
| 102 | // len_gen, mod_w_1, .. mod_w_len, 0 |
---|
| 103 | |
---|
[f93c5e9] | 104 | }; |
---|
| 105 | typedef struct sro_am sro_am; |
---|
| 106 | |
---|
[8a8c9e] | 107 | // ordering is a weighted degree ordering |
---|
| 108 | struct sro_wp64 |
---|
| 109 | { |
---|
| 110 | short place; // where weighted degree is stored (in L) |
---|
| 111 | short start; // bounds of ordering (in E) |
---|
| 112 | short end; |
---|
| 113 | int64 *weights64; // pointers into wvhdl field |
---|
| 114 | }; |
---|
| 115 | typedef struct sro_wp64 sro_wp64; |
---|
| 116 | |
---|
| 117 | // ordering duplicates variables |
---|
| 118 | struct sro_cp |
---|
| 119 | { |
---|
| 120 | short place; // where start is copied to (in E) |
---|
| 121 | short start; // bounds of sources of copied variables (in E) |
---|
| 122 | short end; |
---|
| 123 | }; |
---|
| 124 | typedef struct sro_cp sro_cp; |
---|
| 125 | |
---|
| 126 | // ordering indicates "subset" of component number |
---|
| 127 | struct sro_syzcomp |
---|
| 128 | { |
---|
| 129 | short place; // where the index is stored (in L) |
---|
| 130 | long *ShiftedComponents; // pointer into index field |
---|
| 131 | int* Components; |
---|
| 132 | #ifdef PDEBUG |
---|
| 133 | long length; |
---|
| 134 | #endif |
---|
| 135 | }; |
---|
| 136 | typedef struct sro_syzcomp sro_syzcomp; |
---|
| 137 | |
---|
| 138 | // ordering with component number >syzcomp is lower |
---|
| 139 | struct sro_syz |
---|
| 140 | { |
---|
| 141 | short place; // where the index is stored (in L) |
---|
| 142 | int limit; // syzcomp |
---|
| 143 | int* syz_index; // mapping Component -> SyzIndex for Comp <= limit |
---|
| 144 | int curr_index; // SyzIndex for Component > limit |
---|
| 145 | }; |
---|
| 146 | |
---|
| 147 | typedef struct sro_syz sro_syz; |
---|
| 148 | // Induced Syzygy (Schreyer) ordering is built inductively as follows: |
---|
| 149 | // we look for changes made by ordering blocks which are between prefix/suffix markers: |
---|
| 150 | // that is: which variables where placed by them and where (judging by v) |
---|
| 151 | |
---|
| 152 | // due to prefix/suffix nature we need some placeholder: |
---|
| 153 | // prefix stores here initial state |
---|
| 154 | // suffix cleares this up |
---|
| 155 | struct sro_ISTemp |
---|
| 156 | { |
---|
| 157 | short start; // 1st member SHOULD be short "place" |
---|
| 158 | int suffixpos; |
---|
| 159 | int* pVarOffset; // copy! |
---|
| 160 | }; |
---|
| 161 | |
---|
| 162 | // So this is the actuall thing! |
---|
| 163 | // suffix uses last sro_ISTemp (cleares it up afterwards) and |
---|
| 164 | // creates this block |
---|
| 165 | struct sro_IS |
---|
| 166 | { |
---|
| 167 | short start, end; // which part of L we want to want to update... |
---|
| 168 | int* pVarOffset; // same as prefix! |
---|
| 169 | |
---|
| 170 | int limit; // first referenced component |
---|
| 171 | |
---|
| 172 | // reference poly set?? // Should it be owned by ring?!!! |
---|
| 173 | ideal F; // reference leading (module)-monomials set. owned by ring... |
---|
| 174 | }; |
---|
| 175 | |
---|
| 176 | typedef struct sro_IS sro_IS; |
---|
| 177 | typedef struct sro_ISTemp sro_ISTemp; |
---|
| 178 | |
---|
| 179 | struct sro_ord |
---|
| 180 | { |
---|
| 181 | ro_typ ord_typ; |
---|
| 182 | int order_index; // comes from r->order[order_index] |
---|
| 183 | union |
---|
| 184 | { |
---|
| 185 | sro_dp dp; |
---|
| 186 | sro_wp wp; |
---|
[f93c5e9] | 187 | sro_am am; |
---|
[8a8c9e] | 188 | sro_wp64 wp64; |
---|
| 189 | sro_cp cp; |
---|
| 190 | sro_syzcomp syzcomp; |
---|
| 191 | sro_syz syz; |
---|
| 192 | sro_IS is; |
---|
| 193 | sro_ISTemp isTemp; |
---|
| 194 | } data; |
---|
| 195 | }; |
---|
[59f768a] | 196 | |
---|
| 197 | #ifdef HAVE_PLURAL |
---|
| 198 | struct nc_struct; |
---|
| 199 | typedef struct nc_struct nc_struct; |
---|
| 200 | #endif |
---|
| 201 | |
---|
[8a8c9e] | 202 | struct ip_sring |
---|
| 203 | { |
---|
| 204 | // each entry must have a description and a procedure defining it, |
---|
| 205 | // general ordering: pointer/structs, long, int, short, BOOLEAN/char/enum |
---|
| 206 | // general defining procedures: rInit, rComplete, interpreter, ?? |
---|
| 207 | idhdl idroot; /* local objects , interpreter*/ |
---|
| 208 | int* order; /* array of orderings, rInit/rSleftvOrdering2Ordering */ |
---|
| 209 | int* block0; /* starting pos., rInit/rSleftvOrdering2Ordering*/ |
---|
| 210 | int* block1; /* ending pos., rInit/rSleftvOrdering2Ordering*/ |
---|
[01c1d0] | 211 | // char** parameter; /* names of parameters, rInit */ |
---|
[8a8c9e] | 212 | int** wvhdl; /* array of weight vectors, rInit/rSleftvOrdering2Ordering */ |
---|
| 213 | char ** names; /* array of variable names, rInit */ |
---|
| 214 | |
---|
| 215 | // what follows below here should be set by rComplete, _only_ |
---|
| 216 | long *ordsgn; /* array of +/- 1 (or 0) for comparing monomials */ |
---|
| 217 | /* ExpL_Size entries*/ |
---|
| 218 | |
---|
| 219 | // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */ |
---|
| 220 | sro_ord* typ; /* array of orderings + sizes, OrdSize entries */ |
---|
| 221 | /* if NegWeightL_Size > 0, then NegWeightL_Offset[0..size_1] is index of longs |
---|
| 222 | in ExpVector whose values need an offset due to negative weights */ |
---|
| 223 | /* array of NegWeigtL_Size indicies */ |
---|
| 224 | int* NegWeightL_Offset; |
---|
| 225 | |
---|
| 226 | int* VarOffset; |
---|
| 227 | |
---|
[dd668f] | 228 | // ideal minideal; |
---|
| 229 | // number minpoly; /* replaced by minideal->m[0] */ |
---|
| 230 | ideal qideal; /**< extension to the ring structure: qring, rInit, OR |
---|
| 231 | for Q_a/Zp_a, rInit (replaces minideal!); |
---|
| 232 | for a start, we assume that there is either no |
---|
| 233 | or exactly one generator in minideal, playing |
---|
| 234 | the role of the former minpoly; minideal may |
---|
| 235 | also be NULL which coincides with the |
---|
| 236 | no-generator-case **/ |
---|
[8a8c9e] | 237 | |
---|
| 238 | int* firstwv; |
---|
| 239 | |
---|
| 240 | omBin PolyBin; /* Bin from where monoms are allocated */ |
---|
[5679049] | 241 | intvec * pModW; /* std: module weights */ |
---|
| 242 | poly ppNoether; /* variables, set by procedures from hecke/kstd1: |
---|
[17e473] | 243 | |
---|
[5679049] | 244 | the highest monomial below pHEdge */ |
---|
[17e473] | 245 | // #ifdef HAVE_RINGS |
---|
[03bf55] | 246 | // unsigned int cf->ringtype; /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */ |
---|
| 247 | // int_number cf->modBase; /* Z/(ringflag^cf->modExponent)=Z/cf->modNumber*/ |
---|
| 248 | // unsigned long cf->modExponent; |
---|
| 249 | // unsigned long cf->modNumber; /* Z/cf->modNumber */ |
---|
| 250 | // int_number cf->modNumber; |
---|
[17e473] | 251 | // #endif |
---|
| 252 | |
---|
[8a8c9e] | 253 | unsigned long options; /* ring dependent options */ |
---|
| 254 | |
---|
[01c1d0] | 255 | // int ch; /* characteristic, rInit */ |
---|
[8a8c9e] | 256 | int ref; /* reference counter to the ring, interpreter */ |
---|
| 257 | |
---|
| 258 | short N; /* number of vars, rInit */ |
---|
| 259 | |
---|
| 260 | short OrdSgn; /* 1 for polynomial rings, -1 otherwise, rInit */ |
---|
| 261 | |
---|
| 262 | short firstBlockEnds; |
---|
| 263 | #ifdef HAVE_PLURAL |
---|
| 264 | short real_var_start, real_var_end; |
---|
| 265 | #endif |
---|
| 266 | |
---|
| 267 | #ifdef HAVE_SHIFTBBA |
---|
| 268 | short isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ |
---|
| 269 | #endif |
---|
| 270 | |
---|
| 271 | BOOLEAN VectorOut; |
---|
| 272 | BOOLEAN ShortOut; |
---|
| 273 | BOOLEAN CanShortOut; |
---|
| 274 | BOOLEAN LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks |
---|
| 275 | BOOLEAN MixedOrder; // TRUE for global/local mixed orderings, FALSE otherwise |
---|
[01c1d0] | 276 | BOOLEAN pLexOrder; /* TRUE if the monomial ordering is not compatible with pFDeg */ |
---|
[8a8c9e] | 277 | |
---|
| 278 | BOOLEAN ComponentOrder; // ??? |
---|
| 279 | |
---|
| 280 | // what follows below here should be set by rComplete, _only_ |
---|
| 281 | // contains component, but no weight fields in E */ |
---|
| 282 | short ExpL_Size; // size of exponent vector in long |
---|
| 283 | short CmpL_Size; // portions which need to be compared |
---|
| 284 | /* number of long vars in exp vector: |
---|
| 285 | long vars are those longs in the exponent vector which are |
---|
| 286 | occupied by variables, only */ |
---|
| 287 | short VarL_Size; |
---|
| 288 | short BitsPerExp; /* number of bits per exponent */ |
---|
| 289 | short ExpPerLong; /* maximal number of Exponents per long */ |
---|
| 290 | short pCompIndex; /* p->exp.e[pCompIndex] is the component */ |
---|
| 291 | short pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */ |
---|
| 292 | short OrdSize; /* size of ord vector (in sro_ord) */ |
---|
| 293 | |
---|
| 294 | /* if >= 0, long vars in exp vector are consecutive and start there |
---|
| 295 | if < 0, long vars in exp vector are not consecutive */ |
---|
| 296 | short VarL_LowIndex; |
---|
| 297 | // number of exponents in r->VarL_Offset[0] |
---|
| 298 | // is minimal number of exponents in a long var |
---|
| 299 | short MinExpPerLong; |
---|
| 300 | |
---|
| 301 | short NegWeightL_Size; |
---|
| 302 | /* array of size VarL_Size, |
---|
| 303 | VarL_Offset[i] gets i-th long var in exp vector */ |
---|
| 304 | int* VarL_Offset; |
---|
| 305 | |
---|
| 306 | /* mask for getting single exponents */ |
---|
| 307 | unsigned long bitmask; |
---|
| 308 | /* mask used for divisiblity tests */ |
---|
| 309 | unsigned long divmask; // rComplete |
---|
| 310 | |
---|
| 311 | p_Procs_s* p_Procs; // rComplete/p_ProcsSet |
---|
| 312 | |
---|
| 313 | /* FDeg and LDeg */ |
---|
| 314 | pFDegProc pFDeg; // rComplete/rSetDegStuff |
---|
| 315 | pLDegProc pLDeg; // rComplete/rSetDegStuff |
---|
| 316 | |
---|
| 317 | /* as it was determined by rComplete */ |
---|
| 318 | pFDegProc pFDegOrig; |
---|
| 319 | /* and as it was determined before rOptimizeLDeg */ |
---|
| 320 | pLDegProc pLDegOrig; |
---|
| 321 | |
---|
| 322 | p_SetmProc p_Setm; |
---|
| 323 | n_Procs_s* cf; |
---|
| 324 | #ifdef HAVE_PLURAL |
---|
| 325 | private: |
---|
| 326 | nc_struct* _nc; // private |
---|
| 327 | public: |
---|
| 328 | inline const nc_struct* GetNC() const { return _nc; }; // public!!! |
---|
| 329 | inline nc_struct*& GetNC() { return _nc; }; // public!!! |
---|
| 330 | #endif |
---|
[028192] | 331 | public: |
---|
| 332 | operator coeffs() const { return cf; } |
---|
[8a8c9e] | 333 | }; |
---|
[b07ba77] | 334 | |
---|
[b388be] | 335 | ////////// DEPRECATED |
---|
| 336 | /////// void rChangeCurrRing(ring r); |
---|
[2b7f4e] | 337 | |
---|
[35aab3] | 338 | ring rDefault(int ch, int N, char **n); |
---|
[17b0b05] | 339 | ring rDefault(const coeffs cf, int N, char **n); |
---|
[7ee1907] | 340 | ring rDefault(int ch, int N, char **n,int ord_size, int *ord, int *block0, int *block1, int **wvhdl=NULL); |
---|
| 341 | ring rDefault(const coeffs cf, int N, char **n,int ord_size, int *ord, int *block0, int *block1, int **wvhdl=NULL); |
---|
[301c033] | 342 | |
---|
[b388be] | 343 | // #define rIsRingVar(A) r_IsRingVar(A,currRing) |
---|
[8837a0] | 344 | int r_IsRingVar(const char *n, ring r); |
---|
[df34cff] | 345 | void rWrite(ring r, BOOLEAN details = FALSE); |
---|
[35aab3] | 346 | ring rCopy(ring r); |
---|
[645a19] | 347 | ring rCopy0(const ring r, BOOLEAN copy_qideal = TRUE, BOOLEAN copy_ordering = TRUE); |
---|
[1745e5] | 348 | ring rCopy0AndAddA(ring r, int64vec *wv64, BOOLEAN copy_qideal = TRUE, |
---|
| 349 | BOOLEAN copy_ordering = TRUE); |
---|
[6b5dd2] | 350 | ring rOpposite(ring r); |
---|
| 351 | ring rEnvelope(ring r); |
---|
[35aab3] | 352 | |
---|
[645a19] | 353 | /// we must always have this test! |
---|
[24cece] | 354 | static inline bool rIsPluralRing(const ring r) |
---|
[d312f6] | 355 | { |
---|
[eb5c46] | 356 | assume(r != NULL); assume(r->cf != NULL); |
---|
[86016d] | 357 | #ifdef HAVE_PLURAL |
---|
[7ff04a] | 358 | nc_struct *n; |
---|
[8a8c9e] | 359 | return (r != NULL) && ((n=r->GetNC()) != NULL) /*&& (n->type != nc_error)*/; |
---|
[d312f6] | 360 | #else |
---|
[86016d] | 361 | return false; |
---|
[d312f6] | 362 | #endif |
---|
[86016d] | 363 | } |
---|
[d312f6] | 364 | |
---|
[24cece] | 365 | static inline bool rIsRatGRing(const ring r) |
---|
[454cb0] | 366 | { |
---|
[17e473] | 367 | assume(r != NULL); |
---|
[454cb0] | 368 | #ifdef HAVE_PLURAL |
---|
[9be65c] | 369 | /* nc_struct *n; */ |
---|
[0b4ec2] | 370 | return (r != NULL) /* && ((n=r->GetNC()) != NULL) */ |
---|
[8a8c9e] | 371 | && (r->real_var_start>1); |
---|
[454cb0] | 372 | #else |
---|
| 373 | return false; |
---|
| 374 | #endif |
---|
| 375 | } |
---|
| 376 | |
---|
[35aab3] | 377 | |
---|
| 378 | |
---|
[4c7d73] | 379 | |
---|
[1ed346] | 380 | // The following are for LaScala3 only! |
---|
[af66d6] | 381 | void rChangeSComps(int* currComponents, long* currShiftedComponents, int length, ring r); |
---|
| 382 | void rGetSComps(int** currComponents, long** currShiftedComponents, int *length, ring r); |
---|
| 383 | |
---|
[35aab3] | 384 | |
---|
| 385 | |
---|
| 386 | const char * rSimpleOrdStr(int ord); |
---|
| 387 | int rOrderName(char * ordername); |
---|
| 388 | char * rOrdStr(ring r); |
---|
| 389 | char * rVarStr(ring r); |
---|
| 390 | char * rCharStr(ring r); |
---|
| 391 | char * rString(ring r); |
---|
[ec96d7] | 392 | int rChar(ring r); |
---|
[4c6e420] | 393 | |
---|
[35aab3] | 394 | char * rParStr(ring r); |
---|
[4c6e420] | 395 | |
---|
[35aab3] | 396 | int rSum(ring r1, ring r2, ring &sum); |
---|
[83bde7] | 397 | int rSumInternal(ring r1, ring r2, ring &sum, BOOLEAN vartest, BOOLEAN dp_dp); |
---|
[35aab3] | 398 | |
---|
[90934a] | 399 | /// returns TRUE, if r1 equals r2 FALSE, otherwise Equality is |
---|
| 400 | /// determined componentwise, if qr == 1, then qrideal equality is |
---|
| 401 | /// tested, as well |
---|
| 402 | BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr = TRUE); |
---|
| 403 | |
---|
| 404 | /// returns TRUE, if r1 and r2 represents the monomials in the same way |
---|
| 405 | /// FALSE, otherwise |
---|
| 406 | /// this is an analogue to rEqual but not so strict |
---|
[f62996] | 407 | BOOLEAN rSamePolyRep(ring r1, ring r2); |
---|
[90934a] | 408 | |
---|
[35aab3] | 409 | void rUnComplete(ring r); |
---|
| 410 | |
---|
[ec96d7] | 411 | BOOLEAN rRing_is_Homog(ring r); |
---|
| 412 | BOOLEAN rRing_has_CompLastBlock(ring r); |
---|
[35aab3] | 413 | |
---|
[c90b43] | 414 | #ifdef HAVE_RINGS |
---|
[17e473] | 415 | static inline BOOLEAN rField_is_Ring_2toM(const ring r) |
---|
[eb5c46] | 416 | { assume(r != NULL); assume(r->cf != NULL); return ( getCoeffType(r->cf) == n_Z2m && nCoeff_is_Ring_2toM(r->cf) ); } |
---|
[994445] | 417 | |
---|
[17e473] | 418 | static inline BOOLEAN rField_is_Ring_ModN(const ring r) |
---|
[eb5c46] | 419 | { assume(r != NULL); assume(r->cf != NULL); return ( getCoeffType(r->cf) == n_Zn && nCoeff_is_Ring_ModN(r->cf) ); } |
---|
[585bbcb] | 420 | |
---|
[17e473] | 421 | static inline BOOLEAN rField_is_Ring_PtoM(const ring r) |
---|
[eb5c46] | 422 | { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Zpn && nCoeff_is_Ring_PtoM(r->cf) ); } |
---|
[1e579c6] | 423 | |
---|
[17e473] | 424 | static inline BOOLEAN rField_is_Ring_Z(const ring r) |
---|
[eb5c46] | 425 | { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Z && nCoeff_is_Ring_Z(r->cf) ); } |
---|
[1e579c6] | 426 | |
---|
[17e473] | 427 | static inline BOOLEAN rField_is_Ring(const ring r) |
---|
[eb5c46] | 428 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Ring(r->cf); } |
---|
[206e158] | 429 | |
---|
[17e473] | 430 | static inline BOOLEAN rField_is_Domain(const ring r) |
---|
[eb5c46] | 431 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Domain(r->cf); } |
---|
[1e579c6] | 432 | |
---|
[17e473] | 433 | static inline BOOLEAN rField_has_Units(const ring r) |
---|
[eb5c46] | 434 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_Units(r->cf); } |
---|
[9d249b] | 435 | #else |
---|
| 436 | #define rField_is_Ring(A) (0) |
---|
[9dd6a25] | 437 | #define rField_is_Ring_2toM(A) (0) |
---|
| 438 | #define rField_is_Ring_ModN(A) (0) |
---|
| 439 | #define rField_is_Ring_PtoM(A) (0) |
---|
| 440 | #define rField_is_Ring_Z(A) (0) |
---|
| 441 | #define rField_is_Domain(A) (1) |
---|
| 442 | #define rField_has_Units(A) (1) |
---|
[009d80] | 443 | #endif |
---|
| 444 | |
---|
[17e473] | 445 | static inline BOOLEAN rField_is_Zp(const ring r) |
---|
[eb5c46] | 446 | { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Zp); } |
---|
[585bbcb] | 447 | |
---|
[17e473] | 448 | static inline BOOLEAN rField_is_Zp(const ring r, int p) |
---|
[eb5c46] | 449 | { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Zp) && (r->cf->ch == p); } |
---|
[585bbcb] | 450 | |
---|
[17e473] | 451 | static inline BOOLEAN rField_is_Q(const ring r) |
---|
[eb5c46] | 452 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Q(r->cf); } |
---|
[585bbcb] | 453 | |
---|
[17e473] | 454 | static inline BOOLEAN rField_is_numeric(const ring r) /* R, long R, long C */ |
---|
[eb5c46] | 455 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_numeric(r->cf); } |
---|
[585bbcb] | 456 | |
---|
[17e473] | 457 | static inline BOOLEAN rField_is_R(const ring r) |
---|
[eb5c46] | 458 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_R(r->cf); } |
---|
[585bbcb] | 459 | |
---|
[17e473] | 460 | static inline BOOLEAN rField_is_GF(const ring r) |
---|
[eb5c46] | 461 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_GF(r->cf); } |
---|
[585bbcb] | 462 | |
---|
[17e473] | 463 | static inline BOOLEAN rField_is_GF(const ring r, int q) |
---|
[eb5c46] | 464 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_GF(r->cf, q); } |
---|
[585bbcb] | 465 | |
---|
[488808e] | 466 | /* DO NOT USE; just here for compatibility reasons towards |
---|
| 467 | the SINGULAR svn trunk */ |
---|
[17e473] | 468 | static inline BOOLEAN rField_is_Zp_a(const ring r) |
---|
[eb5c46] | 469 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Zp_a(r->cf); } |
---|
[585bbcb] | 470 | |
---|
[488808e] | 471 | /* DO NOT USE; just here for compatibility reasons towards |
---|
| 472 | the SINGULAR svn trunk */ |
---|
[17e473] | 473 | static inline BOOLEAN rField_is_Zp_a(const ring r, int p) |
---|
[eb5c46] | 474 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Zp_a(r->cf, p); } |
---|
[585bbcb] | 475 | |
---|
[488808e] | 476 | /* DO NOT USE; just here for compatibility reasons towards |
---|
| 477 | the SINGULAR svn trunk */ |
---|
[17e473] | 478 | static inline BOOLEAN rField_is_Q_a(const ring r) |
---|
[eb5c46] | 479 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Q_a(r->cf); } |
---|
[17e473] | 480 | |
---|
| 481 | static inline BOOLEAN rField_is_long_R(const ring r) |
---|
[eb5c46] | 482 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_long_R(r->cf); } |
---|
[585bbcb] | 483 | |
---|
[17e473] | 484 | static inline BOOLEAN rField_is_long_C(const ring r) |
---|
[eb5c46] | 485 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_long_C(r->cf); } |
---|
[35aab3] | 486 | |
---|
[17e473] | 487 | static inline BOOLEAN rField_has_simple_inverse(const ring r) |
---|
[eb5c46] | 488 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_inverse(r->cf); } |
---|
[35aab3] | 489 | |
---|
[5d18675] | 490 | /// Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies |
---|
[17e473] | 491 | static inline BOOLEAN rField_has_simple_Alloc(const ring r) |
---|
[eb5c46] | 492 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_Alloc(r->cf); } |
---|
[35aab3] | 493 | |
---|
[5d18675] | 494 | /// Alg. or trans. ext. |
---|
[17e473] | 495 | static inline BOOLEAN rField_is_Extension(const ring r) |
---|
[eb5c46] | 496 | { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Extension(r->cf); } /* Z/p(a) and Q(a)*/ |
---|
[35aab3] | 497 | |
---|
[17e473] | 498 | n_coeffType rFieldType(const ring r); |
---|
[35aab3] | 499 | |
---|
[645a19] | 500 | /// this needs to be called whenever a new ring is created: new fields |
---|
| 501 | /// in ring are created (like VarOffset), unless they already exist |
---|
| 502 | /// with force == 1, new fields are _always_ created (overwritten), |
---|
| 503 | /// even if they exist |
---|
[35aab3] | 504 | BOOLEAN rComplete(ring r, int force = 0); |
---|
[645a19] | 505 | // use this to free fields created by rComplete //? |
---|
[ea68ed] | 506 | |
---|
[5fb90e] | 507 | /// set all properties of a new ring - also called by rComplete |
---|
| 508 | void p_SetGlobals(const ring r, BOOLEAN complete = TRUE); |
---|
| 509 | |
---|
[24cece] | 510 | static inline int rBlocks(ring r) |
---|
[35aab3] | 511 | { |
---|
[17e473] | 512 | assume(r != NULL); |
---|
[35aab3] | 513 | int i=0; |
---|
| 514 | while (r->order[i]!=0) i++; |
---|
| 515 | return i+1; |
---|
| 516 | } |
---|
| 517 | |
---|
| 518 | // misc things |
---|
[8a8c9e] | 519 | static inline char* rRingVar(short i, const ring r) |
---|
[35aab3] | 520 | { |
---|
[eb5c46] | 521 | assume(r != NULL); assume(r->cf != NULL); return r->names[i]; |
---|
[35aab3] | 522 | } |
---|
[8a8c9e] | 523 | static inline BOOLEAN rShortOut(const ring r) |
---|
[35aab3] | 524 | { |
---|
[ce1f78] | 525 | assume(r != NULL); return (r->ShortOut); |
---|
| 526 | } |
---|
| 527 | |
---|
| 528 | static inline BOOLEAN rCanShortOut(const ring r) |
---|
| 529 | { |
---|
| 530 | assume(r != NULL); return (r->CanShortOut); |
---|
[35aab3] | 531 | } |
---|
| 532 | |
---|
[4c6e420] | 533 | /// #define rVar(r) (r->N) |
---|
| 534 | static inline short rVar(const ring r) |
---|
| 535 | { |
---|
| 536 | assume(r != NULL); |
---|
| 537 | return r->N; |
---|
| 538 | } |
---|
| 539 | |
---|
| 540 | /// (r->cf->P) |
---|
[7fee876] | 541 | static inline int rPar(const ring r) |
---|
[4c6e420] | 542 | { |
---|
| 543 | assume(r != NULL); |
---|
| 544 | const coeffs C = r->cf; |
---|
| 545 | assume(C != NULL); |
---|
| 546 | |
---|
[7fee876] | 547 | return n_NumberOfParameters(C); |
---|
| 548 | // if( nCoeff_is_Extension(C) ) |
---|
| 549 | // { |
---|
| 550 | // const ring R = C->extRing; |
---|
| 551 | // assume( R != NULL ); |
---|
| 552 | // return rVar( R ); |
---|
| 553 | // } |
---|
| 554 | // else if (nCoeff_is_GF(C)) |
---|
| 555 | // { |
---|
| 556 | // return 1; |
---|
| 557 | // } |
---|
| 558 | // else if (nCoeff_is_long_C(C)) |
---|
| 559 | // { |
---|
| 560 | // return 1; |
---|
| 561 | // } |
---|
| 562 | // return 0; |
---|
[4c6e420] | 563 | } |
---|
| 564 | |
---|
| 565 | |
---|
| 566 | /// (r->cf->parameter) |
---|
[7fee876] | 567 | static inline char const * const * rParameter(const ring r) |
---|
[4c6e420] | 568 | { |
---|
| 569 | assume(r != NULL); |
---|
| 570 | const coeffs C = r->cf; |
---|
| 571 | assume(C != NULL); |
---|
| 572 | |
---|
[7fee876] | 573 | return n_ParameterNames(C); |
---|
| 574 | // if( nCoeff_is_Extension(C) ) // only alg / trans. exts... |
---|
| 575 | // { |
---|
| 576 | // const ring R = C->extRing; |
---|
| 577 | // assume( R != NULL ); |
---|
| 578 | // return R->names; |
---|
| 579 | // } |
---|
| 580 | // else if (nCoeff_is_GF(C)) |
---|
| 581 | // { |
---|
| 582 | // return &(C->m_nfParameter); |
---|
| 583 | // } |
---|
| 584 | // else if (nCoeff_is_long_C(C)) |
---|
| 585 | // { |
---|
| 586 | // return &(C->complex_parameter); |
---|
| 587 | // } |
---|
| 588 | // return NULL; |
---|
[4c6e420] | 589 | } |
---|
[6637ee] | 590 | |
---|
| 591 | /// return the specified parameter as a (new!) number in the given |
---|
[e82417] | 592 | /// polynomial ring, or NULL if invalid |
---|
| 593 | /// parameters (as variables) begin with 1! |
---|
[7fee876] | 594 | static inline number n_Param(const short iParameter, const ring r) |
---|
| 595 | { |
---|
| 596 | assume(r != NULL); |
---|
| 597 | const coeffs C = r->cf; |
---|
| 598 | assume(C != NULL); |
---|
| 599 | return n_Param(iParameter, C); |
---|
| 600 | // const n_coeffType _filed_type = getCoeffType(C); |
---|
| 601 | // |
---|
| 602 | // if ( iParameter <= 0 || iParameter > rPar(r) ) |
---|
| 603 | // // Wrong parameter |
---|
| 604 | // return NULL; |
---|
| 605 | // |
---|
| 606 | // if( _filed_type == n_algExt ) |
---|
| 607 | // return naParameter(iParameter, C); |
---|
| 608 | // |
---|
| 609 | // if( _filed_type == n_transExt ) |
---|
| 610 | // return ntParameter(iParameter, C); |
---|
| 611 | // |
---|
| 612 | // if (_filed_type == n_GF)// if (nCoeff_is_GF(C)) |
---|
| 613 | // { |
---|
| 614 | // number nfPar (int i, const coeffs); |
---|
| 615 | // return nfPar(iParameter, C); |
---|
| 616 | // } |
---|
| 617 | // |
---|
| 618 | // if (_filed_type == n_long_C) // if (nCoeff_is_long_C(C)) |
---|
| 619 | // { |
---|
| 620 | // number ngcPar(int i, const coeffs r); |
---|
| 621 | // return ngcPar(iParameter, C); |
---|
| 622 | // } |
---|
| 623 | // |
---|
| 624 | // return NULL; |
---|
| 625 | } |
---|
[6637ee] | 626 | |
---|
[e82417] | 627 | /// if m == var(i)/1 => return i, |
---|
| 628 | int n_IsParam(number m, const ring r); |
---|
[6cc7f5] | 629 | |
---|
| 630 | //#define rInternalChar(r) ((r)->cf->ch) |
---|
| 631 | static inline int rInternalChar(const ring r) |
---|
| 632 | { |
---|
| 633 | assume(r != NULL); |
---|
| 634 | const coeffs C = r->cf; |
---|
| 635 | assume(C != NULL); |
---|
| 636 | return C->ch; |
---|
| 637 | } |
---|
| 638 | |
---|
[4c6e420] | 639 | |
---|
| 640 | /* R, Q, Fp: FALSE */ |
---|
| 641 | static inline BOOLEAN rIsExtension(const ring r) |
---|
| 642 | { |
---|
[7fee876] | 643 | assume(r != NULL); |
---|
| 644 | const coeffs C = r->cf; |
---|
| 645 | assume(C != NULL); |
---|
[5d18675] | 646 | // assume( (rParameter(r)!=NULL) == rField_is_Extension(r) ); // ? |
---|
[7fee876] | 647 | return nCoeff_is_Extension(C) || nCoeff_is_GF(C) || nCoeff_is_long_C(C); |
---|
[4c6e420] | 648 | } |
---|
| 649 | |
---|
| 650 | /// Tests whether '(r->cf->minpoly) == NULL' |
---|
[bcfd11a] | 651 | static inline BOOLEAN rMinpolyIsNULL(const ring r) |
---|
| 652 | { |
---|
| 653 | assume(r != NULL); |
---|
| 654 | const coeffs C = r->cf; |
---|
| 655 | assume(C != NULL); |
---|
| 656 | |
---|
| 657 | const BOOLEAN ret = nCoeff_is_algExt(C); // || nCoeff_is_GF(C) || nCoeff_is_long_C(C); |
---|
| 658 | |
---|
| 659 | if( ret ) |
---|
| 660 | { |
---|
| 661 | const ring R = C->extRing; |
---|
| 662 | assume( R != NULL ); |
---|
| 663 | BOOLEAN idIs0 (ideal h); |
---|
| 664 | assume( !idIs0(R->qideal) ); |
---|
| 665 | } |
---|
| 666 | |
---|
| 667 | // TODO: this leads to test fails (due to rDecompose?) |
---|
| 668 | return !ret; |
---|
| 669 | } |
---|
| 670 | |
---|
[4c6e420] | 671 | |
---|
| 672 | |
---|
[645a19] | 673 | /// order stuff |
---|
[35aab3] | 674 | typedef enum rRingOrder_t |
---|
| 675 | { |
---|
| 676 | ringorder_no = 0, |
---|
| 677 | ringorder_a, |
---|
[645a19] | 678 | ringorder_a64, ///< for int64 weights |
---|
[35aab3] | 679 | ringorder_c, |
---|
| 680 | ringorder_C, |
---|
| 681 | ringorder_M, |
---|
[645a19] | 682 | ringorder_S, ///< S? |
---|
| 683 | ringorder_s, ///< s? |
---|
[35aab3] | 684 | ringorder_lp, |
---|
| 685 | ringorder_dp, |
---|
| 686 | ringorder_rp, |
---|
| 687 | ringorder_Dp, |
---|
| 688 | ringorder_wp, |
---|
| 689 | ringorder_Wp, |
---|
| 690 | ringorder_ls, |
---|
| 691 | ringorder_ds, |
---|
| 692 | ringorder_Ds, |
---|
| 693 | ringorder_ws, |
---|
| 694 | ringorder_Ws, |
---|
[f93c5e9] | 695 | ringorder_am, |
---|
[35aab3] | 696 | ringorder_L, |
---|
| 697 | // the following are only used internally |
---|
[645a19] | 698 | ringorder_aa, ///< for idElimination, like a, except pFDeg, pWeigths ignore it |
---|
[7ee1907] | 699 | ringorder_rs, ///< opposite of ls |
---|
[645a19] | 700 | ringorder_IS, ///< Induced (Schreyer) ordering |
---|
[35aab3] | 701 | ringorder_unspec |
---|
| 702 | } rRingOrder_t; |
---|
| 703 | |
---|
| 704 | typedef enum rOrderType_t |
---|
| 705 | { |
---|
[645a19] | 706 | rOrderType_General = 0, ///< non-simple ordering as specified by currRing |
---|
| 707 | rOrderType_CompExp, ///< simple ordering, component has priority |
---|
| 708 | rOrderType_ExpComp, ///< simple ordering, exponent vector has priority |
---|
| 709 | ///< component not compatible with exp-vector order |
---|
| 710 | rOrderType_Exp, ///< simple ordering, exponent vector has priority |
---|
| 711 | ///< component is compatible with exp-vector order |
---|
| 712 | rOrderType_Syz, ///< syzygy ordering |
---|
| 713 | rOrderType_Schreyer, ///< Schreyer ordering |
---|
| 714 | rOrderType_Syz2dpc, ///< syzcomp2dpc |
---|
| 715 | rOrderType_ExpNoComp ///< simple ordering, differences in component are |
---|
| 716 | ///< not considered |
---|
[35aab3] | 717 | } rOrderType_t; |
---|
| 718 | |
---|
[24cece] | 719 | static inline BOOLEAN rIsSyzIndexRing(const ring r) |
---|
[eb5c46] | 720 | { assume(r != NULL); assume(r->cf != NULL); return r->order[0] == ringorder_s;} |
---|
[35aab3] | 721 | |
---|
[8a8c9e] | 722 | static inline int rGetCurrSyzLimit(const ring r) |
---|
[eb5c46] | 723 | { assume(r != NULL); assume(r->cf != NULL); return (rIsSyzIndexRing(r)? r->typ[0].data.syz.limit : 0);} |
---|
[35aab3] | 724 | |
---|
[7e53d9] | 725 | void rSetSyzComp(int k, const ring r); |
---|
| 726 | |
---|
[35aab3] | 727 | // Ring Manipulations |
---|
[1da2a13] | 728 | ring rAssure_HasComp(const ring r); |
---|
[7eb7b5] | 729 | ring rAssure_SyzComp(const ring r, BOOLEAN complete = TRUE); |
---|
[1da2a13] | 730 | |
---|
| 731 | ring rAssure_dp_S(const ring r); |
---|
| 732 | ring rAssure_dp_C(const ring r); |
---|
| 733 | ring rAssure_C_dp(const ring r); |
---|
| 734 | |
---|
[645a19] | 735 | /// makes sure that c/C ordering is last ordering |
---|
[7e53d9] | 736 | ring rAssure_CompLastBlock(const ring r, BOOLEAN complete = TRUE); |
---|
[645a19] | 737 | |
---|
| 738 | /// makes sure that c/C ordering is last ordering and SyzIndex is first |
---|
[7e53d9] | 739 | ring rAssure_SyzComp_CompLastBlock(const ring r, BOOLEAN complete = TRUE); |
---|
[2c52441] | 740 | ring rAssure_TDeg(const ring r, int start_var, int end_var, int &pos); |
---|
[35aab3] | 741 | |
---|
[645a19] | 742 | /// return the max-comonent wchich has syzIndex i |
---|
| 743 | /// Assume: i<= syzIndex_limit |
---|
[1389a4] | 744 | int rGetMaxSyzComp(int i, const ring r); |
---|
[35aab3] | 745 | |
---|
[b9642b1] | 746 | BOOLEAN rHasSimpleOrder(const ring r); |
---|
[645a19] | 747 | |
---|
| 748 | /// returns TRUE, if simple lp or ls ordering |
---|
[b9642b1] | 749 | BOOLEAN rHasSimpleLexOrder(const ring r); |
---|
[645a19] | 750 | |
---|
[0a1755] | 751 | //???? return TRUE if p->exp[r->pOrdIndex] holds total degree of p ??? |
---|
| 752 | |
---|
| 753 | |
---|
| 754 | inline BOOLEAN rHasGlobalOrdering(const ring r){ return (r->OrdSgn==1); } |
---|
| 755 | inline BOOLEAN rHasLocalOrMixedOrdering(const ring r){ return (r->OrdSgn==-1); } |
---|
| 756 | |
---|
| 757 | // #define rHasGlobalOrdering(R) ((R)->OrdSgn==1) |
---|
| 758 | // #define rHasLocalOrMixedOrdering(R) ((R)->OrdSgn==-1) |
---|
| 759 | |
---|
| 760 | #define rHasGlobalOrdering_currRing() rHasGlobalOrdering(currRing) |
---|
| 761 | #define rHasLocalOrMixedOrdering_currRing() rHasLocalOrMixedOrdering(currRing) |
---|
| 762 | |
---|
[ec96d7] | 763 | BOOLEAN rOrd_is_Totaldegree_Ordering(ring r ); |
---|
[645a19] | 764 | |
---|
| 765 | /// return TRUE if p_SetComp requires p_Setm |
---|
[35aab3] | 766 | BOOLEAN rOrd_SetCompRequiresSetm(ring r); |
---|
| 767 | rOrderType_t rGetOrderType(ring r); |
---|
[645a19] | 768 | |
---|
| 769 | /// returns TRUE if var(i) belongs to p-block |
---|
[8a8c9e] | 770 | BOOLEAN rIsPolyVar(int i, ring r); |
---|
[35aab3] | 771 | |
---|
[24cece] | 772 | static inline BOOLEAN rOrd_is_Comp_dp(ring r) |
---|
[35aab3] | 773 | { |
---|
[17e473] | 774 | assume(r != NULL); |
---|
[eb5c46] | 775 | assume(r->cf != NULL); |
---|
[35aab3] | 776 | return ((r->order[0] == ringorder_c || r->order[0] == ringorder_C) && |
---|
| 777 | r->order[1] == ringorder_dp && |
---|
| 778 | r->order[2] == 0); |
---|
| 779 | } |
---|
| 780 | |
---|
| 781 | #ifdef RDEBUG |
---|
| 782 | #define rTest(r) rDBTest(r, __FILE__, __LINE__) |
---|
[85e68dd] | 783 | extern BOOLEAN rDBTest(ring r, const char* fn, const int l); |
---|
[35aab3] | 784 | #else |
---|
| 785 | #define rTest(r) |
---|
| 786 | #endif |
---|
| 787 | |
---|
| 788 | ring rModifyRing(ring r, BOOLEAN omit_degree, |
---|
| 789 | BOOLEAN omit_comp, |
---|
| 790 | unsigned long exp_limit); |
---|
[645a19] | 791 | |
---|
| 792 | /// construct Wp, C ring |
---|
[35aab3] | 793 | ring rModifyRing_Wp(ring r, int* weights); |
---|
[4c7d73] | 794 | void rModify_a_to_A(ring r); |
---|
[35aab3] | 795 | |
---|
| 796 | void rKillModifiedRing(ring r); |
---|
| 797 | // also frees weights |
---|
| 798 | void rKillModified_Wp_Ring(ring r); |
---|
| 799 | |
---|
| 800 | ring rModifyRing_Simple(ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit, BOOLEAN &simple); |
---|
| 801 | void rKillModifiedRing_Simple(ring r); |
---|
| 802 | |
---|
[645a19] | 803 | #ifdef RDEBUG |
---|
[35aab3] | 804 | void rDebugPrint(ring r); |
---|
[f29ab6] | 805 | // void pDebugPrint(poly p); |
---|
[3664c9a] | 806 | void p_DebugPrint(poly p, const ring r); |
---|
[645a19] | 807 | #endif |
---|
| 808 | |
---|
[af3d2a] | 809 | #ifndef NDEBUG |
---|
[645a19] | 810 | /// debug-print at most nTerms (2 by default) terms from poly/vector p, |
---|
| 811 | /// assuming that lt(p) lives in lmRing and tail(p) lives in tailRing. |
---|
| 812 | void p_DebugPrint(const poly p, const ring lmRing, const ring tailRing, const int nTerms = 2); |
---|
[af3d2a] | 813 | #endif |
---|
[35aab3] | 814 | |
---|
[4c7d73] | 815 | int64 * rGetWeightVec(ring r); |
---|
| 816 | void rSetWeightVec(ring r, int64 *wv); |
---|
[35aab3] | 817 | |
---|
[a830d2b] | 818 | ///////////////////////////// |
---|
| 819 | // Auxillary functions |
---|
| 820 | // |
---|
| 821 | |
---|
[0afa07] | 822 | /* return the varIndex-th ring variable as a poly; |
---|
| 823 | varIndex starts at index 1 */ |
---|
| 824 | poly rGetVar(const int varIndex, const ring r); |
---|
| 825 | |
---|
[f3461d] | 826 | BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0); |
---|
[13366d] | 827 | |
---|
[74f51f] | 828 | /// return the position of the p^th IS block order block in r->typ[]... |
---|
| 829 | int rGetISPos(const int p, const ring r); |
---|
| 830 | |
---|
[a830d2b] | 831 | BOOLEAN rCheckIV(intvec *iv); |
---|
| 832 | int rTypeOfMatrixOrder(intvec * order); |
---|
[5fe834] | 833 | |
---|
| 834 | void rDelete(ring r); // To be used instead of rKill! |
---|
[a830d2b] | 835 | |
---|
[c5e0e1] | 836 | extern omBin sip_sring_bin; |
---|
[35aab3] | 837 | #endif |
---|