[9f7665] | 1 | |
---|
| 2 | |
---|
| 3 | |
---|
[83192d] | 4 | |
---|
[383b2c8] | 5 | #include <kernel/mod2.h> |
---|
[4f7d76] | 6 | |
---|
| 7 | #include <omalloc/omalloc.h> |
---|
| 8 | |
---|
[0917a96] | 9 | #include <misc/intvec.h> |
---|
[74afe1f] | 10 | #include <misc/options.h> |
---|
[0917a96] | 11 | |
---|
| 12 | #include <coeffs/coeffs.h> |
---|
| 13 | |
---|
[ff12c6] | 14 | #include <polys/PolyEnumerator.h> |
---|
| 15 | |
---|
[0917a96] | 16 | #include <polys/monomials/p_polys.h> |
---|
| 17 | #include <polys/monomials/ring.h> |
---|
| 18 | // #include <kernel/longrat.h> |
---|
[57fa2c4] | 19 | #include <kernel/GBEngine/kstd1.h> |
---|
[4f7d76] | 20 | |
---|
[f115489] | 21 | #include <kernel/polys.h> |
---|
| 22 | |
---|
[57fa2c4] | 23 | #include <kernel/GBEngine/syz.h> |
---|
[0917a96] | 24 | |
---|
[4f7d76] | 25 | #include <Singular/tok.h> |
---|
| 26 | #include <Singular/ipid.h> |
---|
| 27 | #include <Singular/lists.h> |
---|
| 28 | #include <Singular/attrib.h> |
---|
| 29 | |
---|
[0917a96] | 30 | #include <Singular/ipid.h> |
---|
[986225e] | 31 | #include <Singular/ipshell.h> // For iiAddCproc |
---|
| 32 | |
---|
[0917a96] | 33 | // extern coeffs coeffs_BIGINT |
---|
| 34 | |
---|
[4f7d76] | 35 | #include "singularxx_defs.h" |
---|
[204092] | 36 | |
---|
[4f7d76] | 37 | #include "DebugPrint.h" |
---|
| 38 | #include "myNF.h" |
---|
[ff7993] | 39 | #include "syzextra.h" |
---|
[4f7d76] | 40 | |
---|
[0c86ae] | 41 | |
---|
[83192d] | 42 | #include <Singular/mod_lib.h> |
---|
| 43 | |
---|
| 44 | |
---|
[0c86ae] | 45 | #if GOOGLE_PROFILE_ENABLED |
---|
[f63b13] | 46 | #include <google/profiler.h> |
---|
[0c86ae] | 47 | #endif // #if GOOGLE_PROFILE_ENABLED |
---|
[f63b13] | 48 | |
---|
| 49 | |
---|
| 50 | #include <stdio.h> |
---|
| 51 | #include <stdlib.h> |
---|
| 52 | #include <string.h> |
---|
| 53 | |
---|
| 54 | |
---|
[2407cb] | 55 | |
---|
| 56 | |
---|
[4f7d76] | 57 | extern void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r); |
---|
[0917a96] | 58 | // extern ring rCurrRingAssure_SyzComp(); |
---|
[4f7d76] | 59 | extern ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete, int sign); |
---|
| 60 | extern int rGetISPos(const int p, const ring r); |
---|
| 61 | |
---|
[204092] | 62 | // USING_NAMESPACE_SINGULARXX; |
---|
| 63 | |
---|
[4f7d76] | 64 | USING_NAMESPACE( SINGULARXXNAME :: DEBUG ) |
---|
| 65 | USING_NAMESPACE( SINGULARXXNAME :: NF ) |
---|
[ff7993] | 66 | USING_NAMESPACE( SINGULARXXNAME :: SYZEXTRA ) |
---|
[4f7d76] | 67 | |
---|
[5020a6] | 68 | |
---|
[4f7d76] | 69 | BEGIN_NAMESPACE_NONAME |
---|
[5020a6] | 70 | |
---|
| 71 | |
---|
[4f7d76] | 72 | static inline void NoReturn(leftv& res) |
---|
| 73 | { |
---|
| 74 | res->rtyp = NONE; |
---|
| 75 | res->data = NULL; |
---|
| 76 | } |
---|
| 77 | |
---|
[ff12c6] | 78 | /// wrapper around n_ClearContent |
---|
| 79 | static BOOLEAN _ClearContent(leftv res, leftv h) |
---|
| 80 | { |
---|
| 81 | NoReturn(res); |
---|
| 82 | |
---|
| 83 | const char *usage = "'ClearContent' needs a (non-zero!) poly or vector argument..."; |
---|
| 84 | |
---|
| 85 | if( h == NULL ) |
---|
| 86 | { |
---|
| 87 | WarnS(usage); |
---|
| 88 | return TRUE; |
---|
| 89 | } |
---|
| 90 | |
---|
| 91 | assume( h != NULL ); |
---|
| 92 | |
---|
| 93 | if( !( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) ) |
---|
| 94 | { |
---|
| 95 | WarnS(usage); |
---|
| 96 | return TRUE; |
---|
| 97 | } |
---|
| 98 | |
---|
| 99 | assume (h->Next() == NULL); |
---|
| 100 | |
---|
| 101 | poly ph = reinterpret_cast<poly>(h->Data()); |
---|
| 102 | |
---|
| 103 | if( ph == NULL ) |
---|
| 104 | { |
---|
| 105 | WarnS(usage); |
---|
| 106 | return TRUE; |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | const ring r = currRing; |
---|
| 110 | assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf; |
---|
| 111 | |
---|
| 112 | number n; |
---|
| 113 | |
---|
| 114 | // experimentall (recursive enumerator treatment) of alg. ext |
---|
| 115 | CPolyCoeffsEnumerator itr(ph); |
---|
| 116 | n_ClearContent(itr, n, C); |
---|
| 117 | |
---|
| 118 | res->data = n; |
---|
| 119 | res->rtyp = NUMBER_CMD; |
---|
| 120 | |
---|
| 121 | return FALSE; |
---|
| 122 | } |
---|
| 123 | |
---|
| 124 | /// wrapper around n_ClearDenominators |
---|
| 125 | static BOOLEAN _ClearDenominators(leftv res, leftv h) |
---|
| 126 | { |
---|
| 127 | NoReturn(res); |
---|
| 128 | |
---|
| 129 | const char *usage = "'ClearDenominators' needs a (non-zero!) poly or vector argument..."; |
---|
| 130 | |
---|
| 131 | if( h == NULL ) |
---|
| 132 | { |
---|
| 133 | WarnS(usage); |
---|
| 134 | return TRUE; |
---|
| 135 | } |
---|
| 136 | |
---|
| 137 | assume( h != NULL ); |
---|
| 138 | |
---|
| 139 | if( !( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) ) |
---|
| 140 | { |
---|
| 141 | WarnS(usage); |
---|
| 142 | return TRUE; |
---|
| 143 | } |
---|
| 144 | |
---|
| 145 | assume (h->Next() == NULL); |
---|
| 146 | |
---|
| 147 | poly ph = reinterpret_cast<poly>(h->Data()); |
---|
| 148 | |
---|
| 149 | if( ph == NULL ) |
---|
| 150 | { |
---|
| 151 | WarnS(usage); |
---|
| 152 | return TRUE; |
---|
| 153 | } |
---|
| 154 | |
---|
| 155 | const ring r = currRing; |
---|
| 156 | assume( r != NULL ); assume( r->cf != NULL ); const coeffs C = r->cf; |
---|
| 157 | |
---|
| 158 | number n; |
---|
| 159 | |
---|
| 160 | // experimentall (recursive enumerator treatment) of alg. ext. |
---|
| 161 | CPolyCoeffsEnumerator itr(ph); |
---|
| 162 | n_ClearDenominators(itr, n, C); |
---|
| 163 | |
---|
| 164 | res->data = n; |
---|
| 165 | res->rtyp = NUMBER_CMD; |
---|
| 166 | |
---|
| 167 | return FALSE; |
---|
| 168 | } |
---|
| 169 | |
---|
| 170 | |
---|
[4f7d76] | 171 | /// try to get an optional (simple) integer argument out of h |
---|
| 172 | /// or return the default value |
---|
| 173 | static int getOptionalInteger(const leftv& h, const int _n) |
---|
| 174 | { |
---|
| 175 | if( h!= NULL && h->Typ() == INT_CMD ) |
---|
| 176 | { |
---|
| 177 | int n = (int)(long)(h->Data()); |
---|
| 178 | |
---|
| 179 | if( n < 0 ) |
---|
| 180 | Warn("Negative (%d) optional integer argument", n); |
---|
| 181 | |
---|
| 182 | return (n); |
---|
| 183 | } |
---|
| 184 | |
---|
| 185 | return (_n); |
---|
| 186 | } |
---|
| 187 | |
---|
[f63b13] | 188 | static BOOLEAN noop(leftv __res, leftv /*__v*/) |
---|
[4f7d76] | 189 | { |
---|
| 190 | NoReturn(__res); |
---|
| 191 | return FALSE; |
---|
| 192 | } |
---|
| 193 | |
---|
[f63b13] | 194 | static BOOLEAN _ProfilerStart(leftv __res, leftv h) |
---|
| 195 | { |
---|
| 196 | NoReturn(__res); |
---|
[0c86ae] | 197 | #if GOOGLE_PROFILE_ENABLED |
---|
[f63b13] | 198 | if( h!= NULL && h->Typ() == STRING_CMD ) |
---|
| 199 | { |
---|
| 200 | const char* name = (char*)(h->Data()); |
---|
| 201 | assume( name != NULL ); |
---|
| 202 | ProfilerStart(name); |
---|
| 203 | } else |
---|
| 204 | WerrorS("ProfilerStart requires a string [name] argument"); |
---|
| 205 | #else |
---|
[0c86ae] | 206 | WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLE!=1)..."); |
---|
[f63b13] | 207 | // return TRUE; // ? |
---|
[0c86ae] | 208 | #endif // #if GOOGLE_PROFILE_ENABLED |
---|
[f63b13] | 209 | return FALSE; |
---|
| 210 | (void)h; |
---|
| 211 | } |
---|
| 212 | static BOOLEAN _ProfilerStop(leftv __res, leftv /*__v*/) |
---|
| 213 | { |
---|
| 214 | NoReturn(__res); |
---|
[0c86ae] | 215 | #if GOOGLE_PROFILE_ENABLED |
---|
[f63b13] | 216 | ProfilerStop(); |
---|
| 217 | #else |
---|
[0c86ae] | 218 | WarnS("Sorry no google profiler support (GOOGLE_PROFILE_ENABLED!=1)..."); |
---|
[f63b13] | 219 | // return TRUE; // ? |
---|
[0c86ae] | 220 | #endif // #if GOOGLE_PROFILE_ENABLED |
---|
[f63b13] | 221 | return FALSE; |
---|
| 222 | } |
---|
[4f7d76] | 223 | |
---|
| 224 | static inline number jjLONG2N(long d) |
---|
| 225 | { |
---|
[0917a96] | 226 | return n_Init(d, coeffs_BIGINT); |
---|
[4f7d76] | 227 | } |
---|
| 228 | |
---|
[19764c6] | 229 | static inline void view(const intvec* v) |
---|
| 230 | { |
---|
[7fe9e13] | 231 | #ifndef SING_NDEBUG |
---|
[19764c6] | 232 | v->view(); |
---|
| 233 | #else |
---|
[7fe9e13] | 234 | // This code duplication is only due to Hannes's #ifndef SING_NDEBUG! |
---|
[19764c6] | 235 | Print ("intvec: {rows: %d, cols: %d, length: %d, Values: \n", v->rows(), v->cols(), v->length()); |
---|
| 236 | |
---|
| 237 | for (int i = 0; i < v->rows(); i++) |
---|
| 238 | { |
---|
| 239 | Print ("Row[%3d]:", i); |
---|
| 240 | for (int j = 0; j < v->cols(); j++) |
---|
| 241 | Print (" %5d", (*v)[j + i * (v->cols())] ); |
---|
| 242 | PrintLn (); |
---|
| 243 | } |
---|
| 244 | PrintS ("}\n"); |
---|
| 245 | #endif |
---|
| 246 | |
---|
| 247 | } |
---|
| 248 | |
---|
| 249 | |
---|
| 250 | |
---|
[4f7d76] | 251 | static BOOLEAN DetailedPrint(leftv __res, leftv h) |
---|
| 252 | { |
---|
| 253 | NoReturn(__res); |
---|
| 254 | |
---|
| 255 | if( h == NULL ) |
---|
| 256 | { |
---|
| 257 | WarnS("DetailedPrint needs an argument..."); |
---|
| 258 | return TRUE; |
---|
| 259 | } |
---|
| 260 | |
---|
[084393] | 261 | if( h->Typ() == NUMBER_CMD) |
---|
| 262 | { |
---|
| 263 | number n = (number)h->Data(); |
---|
| 264 | |
---|
| 265 | const ring r = currRing; |
---|
| 266 | |
---|
| 267 | #ifdef LDEBUG |
---|
| 268 | r->cf->cfDBTest(n,__FILE__,__LINE__,r->cf); |
---|
| 269 | #endif |
---|
| 270 | |
---|
| 271 | StringSetS(""); |
---|
| 272 | n_Write(n, r->cf); |
---|
| 273 | PrintS(StringEndS()); |
---|
| 274 | PrintLn(); |
---|
| 275 | |
---|
| 276 | return FALSE; |
---|
| 277 | } |
---|
| 278 | |
---|
[4f7d76] | 279 | if( h->Typ() == RING_CMD) |
---|
| 280 | { |
---|
| 281 | const ring r = (const ring)h->Data(); |
---|
[5c0183] | 282 | rWrite(r, TRUE); |
---|
[4f7d76] | 283 | PrintLn(); |
---|
| 284 | #ifdef RDEBUG |
---|
| 285 | rDebugPrint(r); |
---|
| 286 | #endif |
---|
| 287 | return FALSE; |
---|
| 288 | } |
---|
| 289 | |
---|
| 290 | if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) |
---|
| 291 | { |
---|
| 292 | const poly p = (const poly)h->Data(); h = h->Next(); |
---|
| 293 | |
---|
| 294 | dPrint(p, currRing, currRing, getOptionalInteger(h, 3)); |
---|
| 295 | |
---|
| 296 | return FALSE; |
---|
| 297 | } |
---|
| 298 | |
---|
| 299 | if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) |
---|
| 300 | { |
---|
| 301 | const ideal id = (const ideal)h->Data(); h = h->Next(); |
---|
| 302 | |
---|
| 303 | dPrint(id, currRing, currRing, getOptionalInteger(h, 3)); |
---|
| 304 | |
---|
| 305 | return FALSE; |
---|
| 306 | } |
---|
| 307 | |
---|
| 308 | if( h->Typ() == RESOLUTION_CMD ) |
---|
| 309 | { |
---|
[636c28] | 310 | const syStrategy syzstr = reinterpret_cast<const syStrategy>(h->Data()); |
---|
[4f7d76] | 311 | |
---|
| 312 | h = h->Next(); |
---|
| 313 | |
---|
| 314 | int nTerms = getOptionalInteger(h, 1); |
---|
| 315 | |
---|
| 316 | |
---|
[636c28] | 317 | Print("RESOLUTION_CMD(%p): ", reinterpret_cast<const void*>(syzstr)); PrintLn(); |
---|
[4f7d76] | 318 | |
---|
| 319 | const ring save = currRing; |
---|
| 320 | const ring r = syzstr->syRing; |
---|
| 321 | const ring rr = (r != NULL) ? r: save; |
---|
| 322 | |
---|
| 323 | |
---|
| 324 | const int iLength = syzstr->length; |
---|
| 325 | |
---|
| 326 | Print("int 'length': %d", iLength); PrintLn(); |
---|
| 327 | Print("int 'regularity': %d", syzstr->regularity); PrintLn(); |
---|
| 328 | Print("short 'list_length': %hd", syzstr->list_length); PrintLn(); |
---|
| 329 | Print("short 'references': %hd", syzstr->references); PrintLn(); |
---|
| 330 | |
---|
| 331 | |
---|
[636c28] | 332 | #define PRINT_pINTVECTOR(s, v) Print("intvec '%10s'(%p)", #v, reinterpret_cast<const void*>((s)->v)); \ |
---|
[19764c6] | 333 | if( (s)->v != NULL ){ PrintS(": "); view((s)->v); }; \ |
---|
[4f7d76] | 334 | PrintLn(); |
---|
| 335 | |
---|
| 336 | PRINT_pINTVECTOR(syzstr, resolution); |
---|
| 337 | PRINT_pINTVECTOR(syzstr, betti); |
---|
| 338 | PRINT_pINTVECTOR(syzstr, Tl); |
---|
| 339 | PRINT_pINTVECTOR(syzstr, cw); |
---|
| 340 | #undef PRINT_pINTVECTOR |
---|
| 341 | |
---|
| 342 | if (r == NULL) |
---|
| 343 | Print("ring '%10s': NULL", "syRing"); |
---|
| 344 | else |
---|
| 345 | if (r == currRing) |
---|
| 346 | Print("ring '%10s': currRing", "syRing"); |
---|
| 347 | else |
---|
| 348 | if (r != NULL && r != save) |
---|
| 349 | { |
---|
| 350 | Print("ring '%10s': ", "syRing"); |
---|
| 351 | rWrite(r); |
---|
| 352 | #ifdef RDEBUG |
---|
| 353 | // rDebugPrint(r); |
---|
| 354 | #endif |
---|
| 355 | // rChangeCurrRing(r); |
---|
| 356 | } |
---|
| 357 | PrintLn(); |
---|
| 358 | |
---|
| 359 | const SRes rP = syzstr->resPairs; |
---|
[636c28] | 360 | Print("SRes 'resPairs': %p", reinterpret_cast<const void*>(rP)); PrintLn(); |
---|
[4f7d76] | 361 | |
---|
| 362 | if (rP != NULL) |
---|
| 363 | for (int iLevel = 0; (iLevel < iLength) && (rP[iLevel] != NULL) && ((*syzstr->Tl)[iLevel] >= 0); iLevel++) |
---|
| 364 | { |
---|
| 365 | int n = 0; |
---|
| 366 | const int iTl = (*syzstr->Tl)[iLevel]; |
---|
| 367 | for (int j = 0; (j < iTl) && ((rP[iLevel][j].lcm!=NULL) || (rP[iLevel][j].syz!=NULL)); j++) |
---|
| 368 | { |
---|
| 369 | if (rP[iLevel][j].isNotMinimal==NULL) |
---|
| 370 | n++; |
---|
| 371 | } |
---|
| 372 | Print("minimal-resPairs-Size[1+%d]: %d", iLevel, n); PrintLn(); |
---|
| 373 | } |
---|
| 374 | |
---|
| 375 | |
---|
| 376 | // const ring rrr = (iLevel > 0) ? rr : save; ? |
---|
[636c28] | 377 | #define PRINT_RESOLUTION(s, v) Print("resolution '%12s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn(); \ |
---|
[4f7d76] | 378 | if ((s)->v != NULL) \ |
---|
| 379 | for (int iLevel = 0; (iLevel < iLength) && ( ((s)->v)[iLevel] != NULL ); iLevel++) \ |
---|
| 380 | { \ |
---|
[636c28] | 381 | /* const ring rrr = (iLevel > 0) ? save : save; */ \ |
---|
[0917a96] | 382 | Print("id '%10s'[%d]: (%p) ncols = %d / size: %d; nrows = %d, rank = %ld / rk: %ld", #v, iLevel, reinterpret_cast<const void*>(((s)->v)[iLevel]), ((s)->v)[iLevel]->ncols, idSize(((s)->v)[iLevel]), ((s)->v)[iLevel]->nrows, ((s)->v)[iLevel]->rank, -1L/*id_RankFreeModule(((s)->v)[iLevel], rrr)*/ ); \ |
---|
[4f7d76] | 383 | PrintLn(); \ |
---|
| 384 | } \ |
---|
| 385 | PrintLn(); |
---|
| 386 | |
---|
| 387 | // resolvente: |
---|
| 388 | PRINT_RESOLUTION(syzstr, minres); |
---|
| 389 | PRINT_RESOLUTION(syzstr, fullres); |
---|
| 390 | |
---|
[0917a96] | 391 | assume (id_RankFreeModule (syzstr->res[1], rr) == syzstr->res[1]->rank); |
---|
[4f7d76] | 392 | |
---|
| 393 | PRINT_RESOLUTION(syzstr, res); |
---|
| 394 | PRINT_RESOLUTION(syzstr, orderedRes); |
---|
| 395 | #undef PRINT_RESOLUTION |
---|
| 396 | |
---|
[636c28] | 397 | #define PRINT_POINTER(s, v) Print("pointer '%17s': %p", #v, reinterpret_cast<const void*>((s)->v)); PrintLn(); |
---|
[4f7d76] | 398 | // 2d arrays: |
---|
| 399 | PRINT_POINTER(syzstr, truecomponents); |
---|
| 400 | PRINT_POINTER(syzstr, ShiftedComponents); |
---|
| 401 | PRINT_POINTER(syzstr, backcomponents); |
---|
| 402 | PRINT_POINTER(syzstr, Howmuch); |
---|
| 403 | PRINT_POINTER(syzstr, Firstelem); |
---|
| 404 | PRINT_POINTER(syzstr, elemLength); |
---|
| 405 | PRINT_POINTER(syzstr, sev); |
---|
| 406 | |
---|
| 407 | // arrays of intvects: |
---|
| 408 | PRINT_POINTER(syzstr, weights); |
---|
| 409 | PRINT_POINTER(syzstr, hilb_coeffs); |
---|
| 410 | #undef PRINT_POINTER |
---|
| 411 | |
---|
| 412 | |
---|
| 413 | if (syzstr->fullres==NULL) |
---|
| 414 | { |
---|
| 415 | PrintS("resolution 'fullres': (NULL) => resolution not computed yet"); |
---|
| 416 | PrintLn(); |
---|
| 417 | } else |
---|
| 418 | { |
---|
[636c28] | 419 | Print("resolution 'fullres': (%p) => resolution seems to be computed already", reinterpret_cast<const void*>(syzstr->fullres)); |
---|
[4f7d76] | 420 | PrintLn(); |
---|
| 421 | dPrint(*syzstr->fullres, save, save, nTerms); |
---|
| 422 | } |
---|
| 423 | |
---|
| 424 | |
---|
| 425 | |
---|
| 426 | |
---|
| 427 | if (syzstr->minres==NULL) |
---|
| 428 | { |
---|
| 429 | PrintS("resolution 'minres': (NULL) => resolution not minimized yet"); |
---|
| 430 | PrintLn(); |
---|
| 431 | } else |
---|
| 432 | { |
---|
[636c28] | 433 | Print("resolution 'minres': (%p) => resolution seems to be minimized already", reinterpret_cast<const void*>(syzstr->minres)); |
---|
[4f7d76] | 434 | PrintLn(); |
---|
| 435 | dPrint(*syzstr->minres, save, save, nTerms); |
---|
| 436 | } |
---|
| 437 | |
---|
| 438 | |
---|
| 439 | |
---|
| 440 | |
---|
| 441 | /* |
---|
| 442 | int ** truecomponents; |
---|
| 443 | long** ShiftedComponents; |
---|
| 444 | int ** backcomponents; |
---|
| 445 | int ** Howmuch; |
---|
| 446 | int ** Firstelem; |
---|
| 447 | int ** elemLength; |
---|
| 448 | unsigned long ** sev; |
---|
| 449 | |
---|
| 450 | intvec ** weights; |
---|
| 451 | intvec ** hilb_coeffs; |
---|
| 452 | |
---|
| 453 | SRes resPairs; //polynomial data for internal use only |
---|
| 454 | |
---|
| 455 | resolvente fullres; |
---|
| 456 | resolvente minres; |
---|
| 457 | resolvente res; //polynomial data for internal use only |
---|
| 458 | resolvente orderedRes; //polynomial data for internal use only |
---|
| 459 | */ |
---|
| 460 | |
---|
| 461 | // if( currRing != save ) rChangeCurrRing(save); |
---|
| 462 | } |
---|
| 463 | |
---|
| 464 | |
---|
| 465 | return FALSE; |
---|
| 466 | } |
---|
| 467 | |
---|
[cd5fefc] | 468 | /// wrapper around p_Tail and id_Tail |
---|
[e89ff5] | 469 | static BOOLEAN Tail(leftv res, leftv h) |
---|
| 470 | { |
---|
| 471 | NoReturn(res); |
---|
| 472 | |
---|
| 473 | if( h == NULL ) |
---|
| 474 | { |
---|
[cd5fefc] | 475 | WarnS("Tail needs a poly/vector/ideal/module argument..."); |
---|
[e89ff5] | 476 | return TRUE; |
---|
| 477 | } |
---|
| 478 | |
---|
| 479 | assume( h != NULL ); |
---|
| 480 | |
---|
[cd5fefc] | 481 | const ring r = currRing; |
---|
| 482 | |
---|
[e89ff5] | 483 | if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD) |
---|
| 484 | { |
---|
[cd5fefc] | 485 | res->data = p_Tail( (const poly)h->Data(), r ); |
---|
[e89ff5] | 486 | res->rtyp = h->Typ(); |
---|
| 487 | |
---|
| 488 | h = h->Next(); assume (h == NULL); |
---|
| 489 | |
---|
| 490 | return FALSE; |
---|
| 491 | } |
---|
| 492 | |
---|
| 493 | if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) |
---|
| 494 | { |
---|
[cd5fefc] | 495 | res->data = id_Tail( (const ideal)h->Data(), r ); |
---|
[e89ff5] | 496 | res->rtyp = h->Typ(); |
---|
| 497 | |
---|
| 498 | h = h->Next(); assume (h == NULL); |
---|
| 499 | |
---|
| 500 | return FALSE; |
---|
| 501 | } |
---|
| 502 | |
---|
| 503 | WarnS("Tail needs a single poly/vector/ideal/module argument..."); |
---|
| 504 | return TRUE; |
---|
| 505 | } |
---|
| 506 | |
---|
| 507 | |
---|
[4eba3ad] | 508 | |
---|
[204092] | 509 | static BOOLEAN _ComputeLeadingSyzygyTerms(leftv res, leftv h) |
---|
[7b7c2c] | 510 | { |
---|
[4eba3ad] | 511 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 512 | |
---|
| 513 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 514 | // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 515 | const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 516 | // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 517 | // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 518 | |
---|
[7b7c2c] | 519 | const ring r = currRing; |
---|
| 520 | NoReturn(res); |
---|
| 521 | |
---|
| 522 | if( h == NULL ) |
---|
| 523 | { |
---|
| 524 | WarnS("ComputeLeadingSyzygyTerms needs an argument..."); |
---|
| 525 | return TRUE; |
---|
| 526 | } |
---|
| 527 | |
---|
| 528 | assume( h != NULL ); |
---|
| 529 | |
---|
| 530 | if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) |
---|
| 531 | { |
---|
| 532 | const ideal id = (const ideal)h->Data(); |
---|
| 533 | |
---|
| 534 | assume(id != NULL); |
---|
| 535 | |
---|
| 536 | if( __DEBUG__ ) |
---|
| 537 | { |
---|
[4eba3ad] | 538 | PrintS("ComputeLeadingSyzygyTerms::Input: \n"); |
---|
[7b7c2c] | 539 | dPrint(id, r, r, 1); |
---|
| 540 | } |
---|
[4eba3ad] | 541 | |
---|
| 542 | assume( !__LEAD2SYZ__ ); |
---|
[7b7c2c] | 543 | |
---|
| 544 | h = h->Next(); assume (h == NULL); |
---|
| 545 | |
---|
[4eba3ad] | 546 | const ideal newid = ComputeLeadingSyzygyTerms(id, r, attributes); |
---|
[7b7c2c] | 547 | |
---|
[f12f9a] | 548 | res->data = newid; res->rtyp = MODUL_CMD; |
---|
[7b7c2c] | 549 | return FALSE; |
---|
| 550 | } |
---|
| 551 | |
---|
| 552 | WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument..."); |
---|
| 553 | return TRUE; |
---|
| 554 | } |
---|
| 555 | |
---|
[8b78ee] | 556 | /// sorting wrt <c,ds> & reversing... |
---|
| 557 | /// change the input inplace!!! |
---|
| 558 | // TODO: use a ring with >_{c, ds}!??? |
---|
[204092] | 559 | static BOOLEAN _Sort_c_ds(leftv res, leftv h) |
---|
[8b78ee] | 560 | { |
---|
[4eba3ad] | 561 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 562 | |
---|
| 563 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 564 | // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 565 | // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 566 | // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 567 | // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 568 | |
---|
[8b78ee] | 569 | NoReturn(res); |
---|
[7b7c2c] | 570 | |
---|
[8b78ee] | 571 | const ring r = currRing; |
---|
| 572 | NoReturn(res); |
---|
| 573 | |
---|
| 574 | if( h == NULL ) |
---|
| 575 | { |
---|
| 576 | WarnS("Sort_c_ds needs an argument..."); |
---|
| 577 | return TRUE; |
---|
| 578 | } |
---|
| 579 | |
---|
| 580 | assume( h != NULL ); |
---|
| 581 | |
---|
| 582 | if( (h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) |
---|
| 583 | && (h->rtyp == IDHDL) // must be a variable! |
---|
| 584 | && (h->e == NULL) // not a list element |
---|
| 585 | ) |
---|
| 586 | { |
---|
| 587 | const ideal id = (const ideal)h->Data(); |
---|
| 588 | |
---|
| 589 | assume(id != NULL); |
---|
| 590 | |
---|
| 591 | if( __DEBUG__ ) |
---|
| 592 | { |
---|
| 593 | PrintS("Sort_c_ds::Input: \n"); |
---|
| 594 | dPrint(id, r, r, 1); |
---|
| 595 | } |
---|
| 596 | |
---|
| 597 | assume (h->Next() == NULL); |
---|
| 598 | |
---|
| 599 | id_Test(id, r); |
---|
| 600 | |
---|
[204092] | 601 | Sort_c_ds(id, r); // NOT A COPY! inplace sorting!!! |
---|
[8b78ee] | 602 | |
---|
[204092] | 603 | // res->data = id; |
---|
[8b78ee] | 604 | // res->rtyp = h->Typ(); |
---|
| 605 | |
---|
| 606 | if( __DEBUG__ ) |
---|
| 607 | { |
---|
| 608 | PrintS("Sort_c_ds::Output: \n"); |
---|
[204092] | 609 | dPrint(id, r, r, 1); |
---|
[8b78ee] | 610 | } |
---|
| 611 | |
---|
[204092] | 612 | // NOTE: nothing is to be returned!!! |
---|
[8b78ee] | 613 | return FALSE; |
---|
| 614 | } |
---|
| 615 | |
---|
| 616 | WarnS("ComputeLeadingSyzygyTerms needs a single ideal/module argument (must be a variable!)..."); |
---|
| 617 | return TRUE; |
---|
| 618 | } |
---|
[7b7c2c] | 619 | |
---|
| 620 | |
---|
[204092] | 621 | static BOOLEAN _Compute2LeadingSyzygyTerms(leftv res, leftv h) |
---|
[f12f9a] | 622 | { |
---|
[4eba3ad] | 623 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 624 | |
---|
| 625 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 626 | // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 627 | const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 628 | // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 629 | // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 630 | |
---|
[f12f9a] | 631 | const ring r = currRing; |
---|
| 632 | NoReturn(res); |
---|
[74afe1f] | 633 | |
---|
[f12f9a] | 634 | if( h == NULL ) |
---|
| 635 | { |
---|
| 636 | WarnS("Compute2LeadingSyzygyTerms needs an argument..."); |
---|
| 637 | return TRUE; |
---|
| 638 | } |
---|
| 639 | |
---|
| 640 | assume( h != NULL ); |
---|
| 641 | |
---|
[4eba3ad] | 642 | assume( __LEAD2SYZ__ ); // ??? |
---|
[f12f9a] | 643 | |
---|
| 644 | if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD) |
---|
| 645 | { |
---|
| 646 | const ideal id = (const ideal)h->Data(); |
---|
| 647 | |
---|
| 648 | assume(id != NULL); |
---|
| 649 | |
---|
| 650 | if( __DEBUG__ ) |
---|
| 651 | { |
---|
| 652 | PrintS("Compute2LeadingSyzygyTerms::Input: \n"); |
---|
| 653 | dPrint(id, r, r, 0); |
---|
| 654 | } |
---|
| 655 | |
---|
| 656 | h = h->Next(); assume (h == NULL); |
---|
[74afe1f] | 657 | |
---|
[4eba3ad] | 658 | res->data = Compute2LeadingSyzygyTerms(id, r, attributes); |
---|
[74afe1f] | 659 | res->rtyp = MODUL_CMD; |
---|
| 660 | |
---|
| 661 | return FALSE; |
---|
| 662 | } |
---|
| 663 | |
---|
| 664 | WarnS("Compute2LeadingSyzygyTerms needs a single ideal/module argument..."); |
---|
| 665 | return TRUE; |
---|
| 666 | } |
---|
| 667 | |
---|
| 668 | |
---|
[fe35f2] | 669 | |
---|
[33161fd] | 670 | /// proc SSFindReducer(def product, def syzterm, def L, def T, list #) |
---|
[204092] | 671 | static BOOLEAN _FindReducer(leftv res, leftv h) |
---|
[4f7d76] | 672 | { |
---|
[4eba3ad] | 673 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 674 | |
---|
| 675 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 676 | // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 677 | // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 678 | // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 679 | const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 680 | |
---|
[f6c459] | 681 | const char* usage = "`FindReducer(<poly/vector>, <vector/0>, <ideal/module>[,<module>])` expected"; |
---|
[33161fd] | 682 | const ring r = currRing; |
---|
| 683 | |
---|
[4f7d76] | 684 | NoReturn(res); |
---|
| 685 | |
---|
[33161fd] | 686 | |
---|
| 687 | if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL)) |
---|
[4f7d76] | 688 | { |
---|
[f6c459] | 689 | WerrorS(usage); |
---|
[33161fd] | 690 | return TRUE; |
---|
| 691 | } |
---|
| 692 | |
---|
[f6c459] | 693 | const poly product = (poly) h->Data(); assume (product != NULL); |
---|
[33161fd] | 694 | |
---|
| 695 | |
---|
[f6c459] | 696 | h = h->Next(); |
---|
| 697 | if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) ) |
---|
[33161fd] | 698 | { |
---|
[f6c459] | 699 | WerrorS(usage); |
---|
[33161fd] | 700 | return TRUE; |
---|
| 701 | } |
---|
| 702 | |
---|
[fe35f2] | 703 | poly syzterm = NULL; |
---|
[33161fd] | 704 | |
---|
[fe35f2] | 705 | if(h->Typ()==VECTOR_CMD) |
---|
| 706 | syzterm = (poly) h->Data(); |
---|
| 707 | |
---|
| 708 | |
---|
| 709 | |
---|
| 710 | h = h->Next(); |
---|
[33161fd] | 711 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 712 | { |
---|
[f6c459] | 713 | WerrorS(usage); |
---|
[33161fd] | 714 | return TRUE; |
---|
| 715 | } |
---|
| 716 | |
---|
| 717 | const ideal L = (ideal) h->Data(); h = h->Next(); |
---|
[4f7d76] | 718 | |
---|
[33161fd] | 719 | assume( IDELEMS(L) > 0 ); |
---|
[4f7d76] | 720 | |
---|
[fe35f2] | 721 | ideal LS = NULL; |
---|
| 722 | |
---|
| 723 | if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL)) |
---|
| 724 | { |
---|
| 725 | LS = (ideal)h->Data(); |
---|
| 726 | h = h->Next(); |
---|
| 727 | } |
---|
| 728 | |
---|
| 729 | if( __TAILREDSYZ__ ) |
---|
| 730 | assume (LS != NULL); |
---|
| 731 | |
---|
| 732 | assume( h == NULL ); |
---|
| 733 | |
---|
| 734 | if( __DEBUG__ ) |
---|
| 735 | { |
---|
| 736 | PrintS("FindReducer(product, syzterm, L, T, #)::Input: \n"); |
---|
| 737 | |
---|
| 738 | PrintS("product: "); dPrint(product, r, r, 2); |
---|
| 739 | PrintS("syzterm: "); dPrint(syzterm, r, r, 2); |
---|
| 740 | PrintS("L: "); dPrint(L, r, r, 0); |
---|
| 741 | // PrintS("T: "); dPrint(T, r, r, 4); |
---|
| 742 | |
---|
| 743 | if( LS == NULL ) |
---|
| 744 | PrintS("LS: NULL\n"); |
---|
| 745 | else |
---|
| 746 | { |
---|
| 747 | PrintS("LS: "); dPrint(LS, r, r, 0); |
---|
| 748 | } |
---|
| 749 | } |
---|
| 750 | |
---|
| 751 | res->rtyp = VECTOR_CMD; |
---|
[4eba3ad] | 752 | res->data = FindReducer(product, syzterm, L, LS, r, attributes); |
---|
[fe35f2] | 753 | |
---|
| 754 | if( __DEBUG__ ) |
---|
| 755 | { |
---|
| 756 | PrintS("FindReducer::Output: \n"); |
---|
| 757 | dPrint((poly)res->data, r, r, 2); |
---|
| 758 | } |
---|
| 759 | |
---|
| 760 | return FALSE; |
---|
| 761 | |
---|
| 762 | } |
---|
| 763 | |
---|
| 764 | // proc SchreyerSyzygyNF(vector syz_lead, vector syz_2, def L, def T, list #) |
---|
[204092] | 765 | static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h) |
---|
[fe35f2] | 766 | { |
---|
[4eba3ad] | 767 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 768 | |
---|
| 769 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 770 | // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 771 | // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 772 | const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 773 | const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 774 | |
---|
[fe35f2] | 775 | const char* usage = "`SchreyerSyzygyNF(<vector>, <vector>, <ideal/module>, <ideal/module>[,<module>])` expected"; |
---|
| 776 | const ring r = currRing; |
---|
| 777 | |
---|
| 778 | NoReturn(res); |
---|
| 779 | |
---|
[4eba3ad] | 780 | assume( __HYBRIDNF__ ); // ??? |
---|
[2c16b8] | 781 | |
---|
[fe35f2] | 782 | if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL)) |
---|
| 783 | { |
---|
| 784 | WerrorS(usage); |
---|
| 785 | return TRUE; |
---|
| 786 | } |
---|
| 787 | |
---|
| 788 | const poly syz_lead = (poly) h->Data(); assume (syz_lead != NULL); |
---|
| 789 | |
---|
| 790 | |
---|
| 791 | h = h->Next(); |
---|
| 792 | if ((h==NULL) || (h->Typ() != VECTOR_CMD) || (h->Data() == NULL)) |
---|
| 793 | { |
---|
| 794 | WerrorS(usage); |
---|
| 795 | return TRUE; |
---|
| 796 | } |
---|
| 797 | |
---|
| 798 | const poly syz_2 = (poly) h->Data(); assume (syz_2 != NULL); |
---|
| 799 | |
---|
| 800 | h = h->Next(); |
---|
[33161fd] | 801 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 802 | { |
---|
[f6c459] | 803 | WerrorS(usage); |
---|
[33161fd] | 804 | return TRUE; |
---|
| 805 | } |
---|
| 806 | |
---|
[fe35f2] | 807 | const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 ); |
---|
| 808 | |
---|
| 809 | |
---|
| 810 | h = h->Next(); |
---|
| 811 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 812 | { |
---|
| 813 | WerrorS(usage); |
---|
| 814 | return TRUE; |
---|
| 815 | } |
---|
| 816 | |
---|
| 817 | const ideal T = (ideal) h->Data(); |
---|
| 818 | |
---|
| 819 | assume( IDELEMS(L) == IDELEMS(T) ); |
---|
[33161fd] | 820 | |
---|
| 821 | ideal LS = NULL; |
---|
| 822 | |
---|
[fe35f2] | 823 | h = h->Next(); |
---|
[33161fd] | 824 | if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL)) |
---|
| 825 | { |
---|
| 826 | LS = (ideal)h->Data(); |
---|
| 827 | h = h->Next(); |
---|
| 828 | } |
---|
| 829 | |
---|
| 830 | if( __TAILREDSYZ__ ) |
---|
| 831 | assume (LS != NULL); |
---|
| 832 | |
---|
| 833 | assume( h == NULL ); |
---|
| 834 | |
---|
| 835 | if( __DEBUG__ ) |
---|
| 836 | { |
---|
[fe35f2] | 837 | PrintS("SchreyerSyzygyNF(syz_lead, syz_2, L, T, #)::Input: \n"); |
---|
[33161fd] | 838 | |
---|
[fe35f2] | 839 | PrintS("syz_lead: "); dPrint(syz_lead, r, r, 2); |
---|
| 840 | PrintS("syz_2: "); dPrint(syz_2, r, r, 2); |
---|
| 841 | |
---|
| 842 | PrintS("L: "); dPrint(L, r, r, 0); |
---|
| 843 | PrintS("T: "); dPrint(T, r, r, 0); |
---|
[33161fd] | 844 | |
---|
| 845 | if( LS == NULL ) |
---|
| 846 | PrintS("LS: NULL\n"); |
---|
| 847 | else |
---|
[4f7d76] | 848 | { |
---|
[fe35f2] | 849 | PrintS("LS: "); dPrint(LS, r, r, 0); |
---|
[33161fd] | 850 | } |
---|
| 851 | } |
---|
[fe35f2] | 852 | |
---|
| 853 | res->rtyp = VECTOR_CMD; |
---|
[4eba3ad] | 854 | res->data = SchreyerSyzygyNF(syz_lead, syz_2, L, T, LS, r, attributes); |
---|
[33161fd] | 855 | |
---|
[fe35f2] | 856 | if( __DEBUG__ ) |
---|
| 857 | { |
---|
| 858 | PrintS("SchreyerSyzygyNF::Output: "); |
---|
[33161fd] | 859 | |
---|
[fe35f2] | 860 | dPrint((poly)res->data, r, r, 2); |
---|
| 861 | } |
---|
| 862 | |
---|
| 863 | |
---|
| 864 | return FALSE; |
---|
| 865 | } |
---|
| 866 | |
---|
| 867 | |
---|
| 868 | |
---|
| 869 | /// proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #) |
---|
[204092] | 870 | static BOOLEAN _ReduceTerm(leftv res, leftv h) |
---|
[fe35f2] | 871 | { |
---|
[4eba3ad] | 872 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 873 | |
---|
| 874 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 875 | const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 876 | // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 877 | // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 878 | const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 879 | |
---|
[fe35f2] | 880 | const char* usage = "`ReduceTerm(<poly>, <poly/vector>, <vector/0>, <ideal/module>, <ideal/module>[,<module>])` expected"; |
---|
| 881 | const ring r = currRing; |
---|
| 882 | |
---|
| 883 | NoReturn(res); |
---|
| 884 | |
---|
| 885 | if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL)) |
---|
[33161fd] | 886 | { |
---|
[fe35f2] | 887 | WerrorS(usage); |
---|
| 888 | return TRUE; |
---|
| 889 | } |
---|
[33161fd] | 890 | |
---|
[fe35f2] | 891 | const poly multiplier = (poly) h->Data(); assume (multiplier != NULL); |
---|
[33161fd] | 892 | |
---|
[fe35f2] | 893 | |
---|
| 894 | h = h->Next(); |
---|
| 895 | if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD) || (h->Data() == NULL)) |
---|
| 896 | { |
---|
| 897 | WerrorS(usage); |
---|
| 898 | return TRUE; |
---|
| 899 | } |
---|
[33161fd] | 900 | |
---|
[fe35f2] | 901 | const poly term4reduction = (poly) h->Data(); assume( term4reduction != NULL ); |
---|
[33161fd] | 902 | |
---|
[fe35f2] | 903 | |
---|
| 904 | poly syztermCheck = NULL; |
---|
| 905 | |
---|
| 906 | h = h->Next(); |
---|
| 907 | if ((h==NULL) || !((h->Typ()==VECTOR_CMD) || (h->Data() == NULL)) ) |
---|
| 908 | { |
---|
| 909 | WerrorS(usage); |
---|
| 910 | return TRUE; |
---|
[33161fd] | 911 | } |
---|
[4f7d76] | 912 | |
---|
[fe35f2] | 913 | if(h->Typ()==VECTOR_CMD) |
---|
| 914 | syztermCheck = (poly) h->Data(); |
---|
| 915 | |
---|
[33161fd] | 916 | |
---|
[fe35f2] | 917 | h = h->Next(); |
---|
| 918 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 919 | { |
---|
| 920 | WerrorS(usage); |
---|
| 921 | return TRUE; |
---|
| 922 | } |
---|
[33161fd] | 923 | |
---|
[fe35f2] | 924 | const ideal L = (ideal) h->Data(); assume( IDELEMS(L) > 0 ); |
---|
| 925 | |
---|
| 926 | |
---|
| 927 | h = h->Next(); |
---|
| 928 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
[33161fd] | 929 | { |
---|
[fe35f2] | 930 | WerrorS(usage); |
---|
| 931 | return TRUE; |
---|
| 932 | } |
---|
[33161fd] | 933 | |
---|
[fe35f2] | 934 | const ideal T = (ideal) h->Data(); |
---|
[4f7d76] | 935 | |
---|
[fe35f2] | 936 | assume( IDELEMS(L) == IDELEMS(T) ); |
---|
[4f7d76] | 937 | |
---|
[fe35f2] | 938 | ideal LS = NULL; |
---|
[33161fd] | 939 | |
---|
[fe35f2] | 940 | h = h->Next(); |
---|
| 941 | if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL)) |
---|
| 942 | { |
---|
| 943 | LS = (ideal)h->Data(); |
---|
| 944 | h = h->Next(); |
---|
| 945 | } |
---|
[33161fd] | 946 | |
---|
[fe35f2] | 947 | if( __TAILREDSYZ__ ) |
---|
| 948 | assume (LS != NULL); |
---|
[33161fd] | 949 | |
---|
[fe35f2] | 950 | assume( h == NULL ); |
---|
[33161fd] | 951 | |
---|
[fe35f2] | 952 | if( __DEBUG__ ) |
---|
| 953 | { |
---|
| 954 | PrintS("ReduceTerm(m, t, syzterm, L, T, #)::Input: \n"); |
---|
[4f7d76] | 955 | |
---|
[fe35f2] | 956 | PrintS("m: "); dPrint(multiplier, r, r, 2); |
---|
| 957 | PrintS("t: "); dPrint(term4reduction, r, r, 2); |
---|
| 958 | PrintS("syzterm: "); dPrint(syztermCheck, r, r, 2); |
---|
| 959 | |
---|
| 960 | PrintS("L: "); dPrint(L, r, r, 0); |
---|
| 961 | PrintS("T: "); dPrint(T, r, r, 0); |
---|
[33161fd] | 962 | |
---|
[fe35f2] | 963 | if( LS == NULL ) |
---|
| 964 | PrintS("LS: NULL\n"); |
---|
| 965 | else |
---|
[33161fd] | 966 | { |
---|
[fe35f2] | 967 | PrintS("LS: "); dPrint(LS, r, r, 0); |
---|
| 968 | } |
---|
| 969 | } |
---|
[33161fd] | 970 | |
---|
[fe35f2] | 971 | |
---|
| 972 | if (__SYZCHECK__ && syztermCheck != NULL) |
---|
| 973 | { |
---|
| 974 | const int c = p_GetComp(syztermCheck, r) - 1; |
---|
| 975 | assume( c >= 0 && c < IDELEMS(L) ); |
---|
| 976 | |
---|
| 977 | const poly p = L->m[c]; |
---|
| 978 | assume( p != NULL ); assume( pNext(p) == NULL ); |
---|
| 979 | |
---|
| 980 | assume( p_EqualPolys(term4reduction, p, r) ); // assume? TODO |
---|
| 981 | |
---|
| 982 | |
---|
| 983 | poly m = leadmonom(syztermCheck, r); |
---|
| 984 | assume( m != NULL ); assume( pNext(m) == NULL ); |
---|
| 985 | |
---|
| 986 | assume( p_EqualPolys(multiplier, m, r) ); // assume? TODO |
---|
| 987 | |
---|
| 988 | p_Delete(&m, r); |
---|
| 989 | |
---|
| 990 | // NOTE: leadmonomial(syzterm) == m && L[leadcomp(syzterm)] == t |
---|
[33161fd] | 991 | } |
---|
| 992 | |
---|
[fe35f2] | 993 | res->rtyp = VECTOR_CMD; |
---|
[4eba3ad] | 994 | res->data = ReduceTerm(multiplier, term4reduction, syztermCheck, L, T, LS, r, attributes); |
---|
[fe35f2] | 995 | |
---|
| 996 | |
---|
| 997 | if( __DEBUG__ ) |
---|
| 998 | { |
---|
| 999 | PrintS("ReduceTerm::Output: "); |
---|
| 1000 | |
---|
| 1001 | dPrint((poly)res->data, r, r, 2); |
---|
| 1002 | } |
---|
[33161fd] | 1003 | |
---|
[fe35f2] | 1004 | |
---|
| 1005 | return FALSE; |
---|
[33161fd] | 1006 | } |
---|
| 1007 | |
---|
| 1008 | |
---|
| 1009 | |
---|
[fe35f2] | 1010 | |
---|
| 1011 | // proc SSTraverseTail(poly m, def @tail, def L, def T, list #) |
---|
[204092] | 1012 | static BOOLEAN _TraverseTail(leftv res, leftv h) |
---|
[fe35f2] | 1013 | { |
---|
[4eba3ad] | 1014 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 1015 | |
---|
| 1016 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 1017 | // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 1018 | // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 1019 | // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 1020 | const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 1021 | |
---|
[fe35f2] | 1022 | const char* usage = "`TraverseTail(<poly>, <poly/vector>, <ideal/module>, <ideal/module>[,<module>])` expected"; |
---|
| 1023 | const ring r = currRing; |
---|
| 1024 | |
---|
| 1025 | NoReturn(res); |
---|
| 1026 | |
---|
| 1027 | if ((h==NULL) || (h->Typ() !=POLY_CMD) || (h->Data() == NULL)) |
---|
| 1028 | { |
---|
| 1029 | WerrorS(usage); |
---|
| 1030 | return TRUE; |
---|
| 1031 | } |
---|
| 1032 | |
---|
| 1033 | const poly multiplier = (poly) h->Data(); assume (multiplier != NULL); |
---|
| 1034 | |
---|
| 1035 | h = h->Next(); |
---|
| 1036 | if ((h==NULL) || (h->Typ()!=VECTOR_CMD && h->Typ() !=POLY_CMD)) |
---|
| 1037 | { |
---|
| 1038 | WerrorS(usage); |
---|
| 1039 | return TRUE; |
---|
| 1040 | } |
---|
| 1041 | |
---|
| 1042 | const poly tail = (poly) h->Data(); |
---|
| 1043 | |
---|
| 1044 | h = h->Next(); |
---|
| 1045 | |
---|
| 1046 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 1047 | { |
---|
| 1048 | WerrorS(usage); |
---|
| 1049 | return TRUE; |
---|
| 1050 | } |
---|
| 1051 | |
---|
| 1052 | const ideal L = (ideal) h->Data(); |
---|
| 1053 | |
---|
| 1054 | assume( IDELEMS(L) > 0 ); |
---|
| 1055 | |
---|
| 1056 | h = h->Next(); |
---|
| 1057 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 1058 | { |
---|
| 1059 | WerrorS(usage); |
---|
| 1060 | return TRUE; |
---|
| 1061 | } |
---|
| 1062 | |
---|
| 1063 | const ideal T = (ideal) h->Data(); |
---|
| 1064 | |
---|
| 1065 | assume( IDELEMS(L) == IDELEMS(T) ); |
---|
| 1066 | |
---|
| 1067 | h = h->Next(); |
---|
| 1068 | |
---|
| 1069 | ideal LS = NULL; |
---|
| 1070 | |
---|
| 1071 | if ((h != NULL) && (h->Typ() ==MODUL_CMD) && (h->Data() != NULL)) |
---|
| 1072 | { |
---|
| 1073 | LS = (ideal)h->Data(); |
---|
| 1074 | h = h->Next(); |
---|
| 1075 | } |
---|
| 1076 | |
---|
| 1077 | if( __TAILREDSYZ__ ) |
---|
| 1078 | assume (LS != NULL); |
---|
| 1079 | |
---|
| 1080 | assume( h == NULL ); |
---|
| 1081 | |
---|
| 1082 | if( __DEBUG__ ) |
---|
| 1083 | { |
---|
| 1084 | PrintS("TraverseTail(m, t, L, T, #)::Input: \n"); |
---|
| 1085 | |
---|
| 1086 | PrintS("m: "); dPrint(multiplier, r, r, 2); |
---|
| 1087 | PrintS("t: "); dPrint(tail, r, r, 10); |
---|
| 1088 | |
---|
| 1089 | PrintS("L: "); dPrint(L, r, r, 0); |
---|
| 1090 | PrintS("T: "); dPrint(T, r, r, 0); |
---|
| 1091 | |
---|
| 1092 | if( LS == NULL ) |
---|
| 1093 | PrintS("LS: NULL\n"); |
---|
| 1094 | else |
---|
| 1095 | { |
---|
| 1096 | PrintS("LS: "); dPrint(LS, r, r, 0); |
---|
| 1097 | } |
---|
| 1098 | } |
---|
| 1099 | |
---|
| 1100 | res->rtyp = VECTOR_CMD; |
---|
[4eba3ad] | 1101 | res->data = TraverseTail(multiplier, tail, L, T, LS, r, attributes); |
---|
[fe35f2] | 1102 | |
---|
| 1103 | |
---|
| 1104 | if( __DEBUG__ ) |
---|
| 1105 | { |
---|
| 1106 | PrintS("TraverseTail::Output: "); |
---|
| 1107 | dPrint((poly)res->data, r, r, 2); |
---|
| 1108 | } |
---|
| 1109 | |
---|
| 1110 | return FALSE; |
---|
| 1111 | } |
---|
| 1112 | |
---|
| 1113 | |
---|
[92992c] | 1114 | /// module (LL, TT) = SSComputeSyzygy(L, T); |
---|
| 1115 | /// Compute Syz(L ++ T) = N = LL ++ TT |
---|
[14e93b] | 1116 | // proc SSComputeSyzygy(def L, def T) |
---|
[204092] | 1117 | static BOOLEAN _ComputeSyzygy(leftv res, leftv h) |
---|
[14e93b] | 1118 | { |
---|
[4eba3ad] | 1119 | const SchreyerSyzygyComputationFlags attributes(currRingHdl); |
---|
| 1120 | |
---|
| 1121 | const BOOLEAN __DEBUG__ = attributes.__DEBUG__; |
---|
| 1122 | // const BOOLEAN __SYZCHECK__ = attributes.__SYZCHECK__; |
---|
| 1123 | // const BOOLEAN __LEAD2SYZ__ = attributes.__LEAD2SYZ__; |
---|
| 1124 | // const BOOLEAN __HYBRIDNF__ = attributes.__HYBRIDNF__; |
---|
| 1125 | // const BOOLEAN __TAILREDSYZ__ = attributes.__TAILREDSYZ__; |
---|
| 1126 | |
---|
[14e93b] | 1127 | const char* usage = "`ComputeSyzygy(<ideal/module>, <ideal/module>])` expected"; |
---|
| 1128 | const ring r = currRing; |
---|
| 1129 | |
---|
| 1130 | NoReturn(res); |
---|
| 1131 | |
---|
| 1132 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 1133 | { |
---|
| 1134 | WerrorS(usage); |
---|
| 1135 | return TRUE; |
---|
| 1136 | } |
---|
| 1137 | |
---|
| 1138 | const ideal L = (ideal) h->Data(); |
---|
| 1139 | |
---|
| 1140 | assume( IDELEMS(L) > 0 ); |
---|
| 1141 | |
---|
| 1142 | h = h->Next(); |
---|
| 1143 | if ((h==NULL) || (h->Typ()!=IDEAL_CMD && h->Typ() !=MODUL_CMD) || (h->Data() == NULL)) |
---|
| 1144 | { |
---|
| 1145 | WerrorS(usage); |
---|
| 1146 | return TRUE; |
---|
| 1147 | } |
---|
| 1148 | |
---|
| 1149 | const ideal T = (ideal) h->Data(); |
---|
| 1150 | assume( IDELEMS(L) == IDELEMS(T) ); |
---|
| 1151 | |
---|
| 1152 | |
---|
| 1153 | h = h->Next(); assume( h == NULL ); |
---|
| 1154 | |
---|
| 1155 | if( __DEBUG__ ) |
---|
| 1156 | { |
---|
| 1157 | PrintS("ComputeSyzygy(L, T)::Input: \n"); |
---|
| 1158 | |
---|
| 1159 | PrintS("L: "); dPrint(L, r, r, 0); |
---|
| 1160 | PrintS("T: "); dPrint(T, r, r, 0); |
---|
| 1161 | } |
---|
| 1162 | |
---|
| 1163 | ideal LL, TT; |
---|
| 1164 | |
---|
[4eba3ad] | 1165 | ComputeSyzygy(L, T, LL, TT, r, attributes); |
---|
[14e93b] | 1166 | |
---|
| 1167 | lists l = (lists)omAllocBin(slists_bin); l->Init(2); |
---|
| 1168 | |
---|
| 1169 | l->m[0].rtyp = MODUL_CMD; l->m[0].data = reinterpret_cast<void *>(LL); |
---|
| 1170 | |
---|
| 1171 | l->m[1].rtyp = MODUL_CMD; l->m[1].data = reinterpret_cast<void *>(TT); |
---|
| 1172 | |
---|
| 1173 | res->data = l; res->rtyp = LIST_CMD; |
---|
| 1174 | |
---|
| 1175 | if( __DEBUG__ ) |
---|
| 1176 | { |
---|
| 1177 | PrintS("ComputeSyzygy::Output: "); |
---|
| 1178 | dPrint(LL, r, r, 0); |
---|
| 1179 | dPrint(TT, r, r, 0); |
---|
| 1180 | } |
---|
| 1181 | |
---|
| 1182 | return FALSE; |
---|
| 1183 | |
---|
| 1184 | } |
---|
| 1185 | |
---|
[33161fd] | 1186 | /// Get leading term without a module component |
---|
[204092] | 1187 | static BOOLEAN _leadmonom(leftv res, leftv h) |
---|
[33161fd] | 1188 | { |
---|
| 1189 | NoReturn(res); |
---|
| 1190 | |
---|
| 1191 | if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) && (h->Data() != NULL)) |
---|
| 1192 | { |
---|
| 1193 | const ring r = currRing; |
---|
| 1194 | const poly p = (poly)(h->Data()); |
---|
| 1195 | |
---|
[204092] | 1196 | res->data = reinterpret_cast<void *>( leadmonom(p, r) ); |
---|
[4f7d76] | 1197 | res->rtyp = POLY_CMD; |
---|
| 1198 | |
---|
| 1199 | return FALSE; |
---|
| 1200 | } |
---|
| 1201 | |
---|
[227b7e] | 1202 | WerrorS("`leadmonom(<poly/vector>)` expected"); |
---|
[4f7d76] | 1203 | return TRUE; |
---|
| 1204 | } |
---|
| 1205 | |
---|
| 1206 | /// Get leading component |
---|
| 1207 | static BOOLEAN leadcomp(leftv res, leftv h) |
---|
| 1208 | { |
---|
| 1209 | NoReturn(res); |
---|
| 1210 | |
---|
[4b2e47] | 1211 | if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD)) |
---|
[4f7d76] | 1212 | { |
---|
| 1213 | const ring r = currRing; |
---|
| 1214 | |
---|
| 1215 | const poly p = (poly)(h->Data()); |
---|
| 1216 | |
---|
[4b2e47] | 1217 | if (p != NULL ) |
---|
| 1218 | { |
---|
| 1219 | assume( p != NULL ); |
---|
| 1220 | assume( p_LmTest(p, r) ); |
---|
[4f7d76] | 1221 | |
---|
[4b2e47] | 1222 | const unsigned long iComp = p_GetComp(p, r); |
---|
[4f7d76] | 1223 | |
---|
[4b2e47] | 1224 | // assume( iComp > 0 ); // p is a vector |
---|
[4f7d76] | 1225 | |
---|
[4b2e47] | 1226 | res->data = reinterpret_cast<void *>(jjLONG2N(iComp)); |
---|
| 1227 | } else |
---|
| 1228 | res->data = reinterpret_cast<void *>(jjLONG2N(0)); |
---|
| 1229 | |
---|
[4f7d76] | 1230 | |
---|
[4b2e47] | 1231 | res->rtyp = BIGINT_CMD; |
---|
[4f7d76] | 1232 | return FALSE; |
---|
| 1233 | } |
---|
| 1234 | |
---|
[227b7e] | 1235 | WerrorS("`leadcomp(<poly/vector>)` expected"); |
---|
[4f7d76] | 1236 | return TRUE; |
---|
| 1237 | } |
---|
| 1238 | |
---|
| 1239 | |
---|
| 1240 | |
---|
| 1241 | |
---|
| 1242 | /// Get raw leading exponent vector |
---|
| 1243 | static BOOLEAN leadrawexp(leftv res, leftv h) |
---|
| 1244 | { |
---|
| 1245 | NoReturn(res); |
---|
| 1246 | |
---|
| 1247 | if ((h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) && (h->Data() != NULL)) |
---|
| 1248 | { |
---|
| 1249 | const ring r = currRing; |
---|
| 1250 | const poly p = (poly)(h->Data()); |
---|
| 1251 | |
---|
| 1252 | assume( p != NULL ); |
---|
| 1253 | assume( p_LmTest(p, r) ); |
---|
| 1254 | |
---|
| 1255 | const int iExpSize = r->ExpL_Size; |
---|
| 1256 | |
---|
[636c28] | 1257 | // intvec *iv = new intvec(iExpSize); |
---|
[4f7d76] | 1258 | |
---|
| 1259 | lists l=(lists)omAllocBin(slists_bin); |
---|
| 1260 | l->Init(iExpSize); |
---|
| 1261 | |
---|
| 1262 | for(int i = iExpSize-1; i >= 0; i--) |
---|
| 1263 | { |
---|
| 1264 | l->m[i].rtyp = BIGINT_CMD; |
---|
| 1265 | l->m[i].data = reinterpret_cast<void *>(jjLONG2N(p->exp[i])); // longs... |
---|
| 1266 | } |
---|
| 1267 | |
---|
| 1268 | res->rtyp = LIST_CMD; // list of bigints |
---|
| 1269 | res->data = reinterpret_cast<void *>(l); |
---|
| 1270 | return FALSE; |
---|
| 1271 | } |
---|
| 1272 | |
---|
[227b7e] | 1273 | WerrorS("`leadrawexp(<poly/vector>)` expected"); |
---|
[4f7d76] | 1274 | return TRUE; |
---|
| 1275 | } |
---|
| 1276 | |
---|
| 1277 | |
---|
| 1278 | /// Endowe the current ring with additional (leading) Syz-component ordering |
---|
[636c28] | 1279 | static BOOLEAN MakeSyzCompOrdering(leftv res, leftv /*h*/) |
---|
[4f7d76] | 1280 | { |
---|
| 1281 | |
---|
| 1282 | NoReturn(res); |
---|
| 1283 | |
---|
| 1284 | // res->data = rCurrRingAssure_SyzComp(); // changes current ring! :( |
---|
[0917a96] | 1285 | res->data = reinterpret_cast<void *>(rAssure_SyzComp(currRing, TRUE)); |
---|
[4f7d76] | 1286 | res->rtyp = RING_CMD; // return new ring! |
---|
| 1287 | // QRING_CMD? |
---|
| 1288 | |
---|
| 1289 | return FALSE; |
---|
| 1290 | } |
---|
| 1291 | |
---|
| 1292 | |
---|
| 1293 | /// Same for Induced Schreyer ordering (ordering on components is defined by sign!) |
---|
| 1294 | static BOOLEAN MakeInducedSchreyerOrdering(leftv res, leftv h) |
---|
| 1295 | { |
---|
| 1296 | |
---|
| 1297 | NoReturn(res); |
---|
| 1298 | |
---|
| 1299 | int sign = 1; |
---|
| 1300 | if ((h!=NULL) && (h->Typ()==INT_CMD)) |
---|
| 1301 | { |
---|
| 1302 | const int s = (int)((long)(h->Data())); |
---|
| 1303 | |
---|
| 1304 | if( s != -1 && s != 1 ) |
---|
| 1305 | { |
---|
[227b7e] | 1306 | WerrorS("`MakeInducedSchreyerOrdering(<int>)` called with wrong integer argument (must be +-1)!"); |
---|
[4f7d76] | 1307 | return TRUE; |
---|
| 1308 | } |
---|
| 1309 | |
---|
| 1310 | sign = s; |
---|
| 1311 | } |
---|
| 1312 | |
---|
| 1313 | assume( sign == 1 || sign == -1 ); |
---|
| 1314 | res->data = reinterpret_cast<void *>(rAssure_InducedSchreyerOrdering(currRing, TRUE, sign)); |
---|
| 1315 | res->rtyp = RING_CMD; // return new ring! |
---|
| 1316 | // QRING_CMD? |
---|
| 1317 | return FALSE; |
---|
| 1318 | } |
---|
| 1319 | |
---|
| 1320 | |
---|
| 1321 | /// Returns old SyzCompLimit, can set new limit |
---|
| 1322 | static BOOLEAN SetSyzComp(leftv res, leftv h) |
---|
| 1323 | { |
---|
| 1324 | NoReturn(res); |
---|
| 1325 | |
---|
| 1326 | const ring r = currRing; |
---|
| 1327 | |
---|
| 1328 | if( !rIsSyzIndexRing(r) ) |
---|
| 1329 | { |
---|
[227b7e] | 1330 | WerrorS("`SetSyzComp(<int>)` called on incompatible ring (not created by 'MakeSyzCompOrdering'!)"); |
---|
[4f7d76] | 1331 | return TRUE; |
---|
| 1332 | } |
---|
| 1333 | |
---|
| 1334 | res->rtyp = INT_CMD; |
---|
| 1335 | res->data = reinterpret_cast<void *>(rGetCurrSyzLimit(r)); // return old syz limit |
---|
| 1336 | |
---|
| 1337 | if ((h!=NULL) && (h->Typ()==INT_CMD)) |
---|
| 1338 | { |
---|
| 1339 | const int iSyzComp = (int)reinterpret_cast<long>(h->Data()); |
---|
| 1340 | assume( iSyzComp > 0 ); |
---|
[0917a96] | 1341 | rSetSyzComp(iSyzComp, currRing); |
---|
[4f7d76] | 1342 | } |
---|
| 1343 | |
---|
| 1344 | return FALSE; |
---|
| 1345 | } |
---|
| 1346 | |
---|
| 1347 | /// ? |
---|
| 1348 | static BOOLEAN GetInducedData(leftv res, leftv h) |
---|
| 1349 | { |
---|
| 1350 | NoReturn(res); |
---|
| 1351 | |
---|
| 1352 | const ring r = currRing; |
---|
| 1353 | |
---|
| 1354 | int p = 0; // which IS-block? p^th! |
---|
| 1355 | |
---|
| 1356 | if ((h!=NULL) && (h->Typ()==INT_CMD)) |
---|
| 1357 | { |
---|
| 1358 | p = (int)((long)(h->Data())); h=h->next; |
---|
| 1359 | assume(p >= 0); |
---|
| 1360 | } |
---|
| 1361 | |
---|
| 1362 | const int pos = rGetISPos(p, r); |
---|
| 1363 | |
---|
[805db88] | 1364 | if( /*(*/ -1 == pos /*)*/ ) |
---|
[4f7d76] | 1365 | { |
---|
[227b7e] | 1366 | WerrorS("`GetInducedData([int])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)"); |
---|
[4f7d76] | 1367 | return TRUE; |
---|
| 1368 | } |
---|
| 1369 | |
---|
| 1370 | |
---|
| 1371 | const int iLimit = r->typ[pos].data.is.limit; |
---|
| 1372 | const ideal F = r->typ[pos].data.is.F; |
---|
| 1373 | ideal FF = id_Copy(F, r); |
---|
| 1374 | |
---|
[2c16b8] | 1375 | |
---|
| 1376 | |
---|
[4f7d76] | 1377 | lists l=(lists)omAllocBin(slists_bin); |
---|
[f3461d] | 1378 | l->Init(2); |
---|
[4f7d76] | 1379 | |
---|
| 1380 | l->m[0].rtyp = INT_CMD; |
---|
| 1381 | l->m[0].data = reinterpret_cast<void *>(iLimit); |
---|
| 1382 | |
---|
| 1383 | |
---|
| 1384 | // l->m[1].rtyp = MODUL_CMD; |
---|
| 1385 | |
---|
| 1386 | if( idIsModule(FF, r) ) |
---|
| 1387 | { |
---|
| 1388 | l->m[1].rtyp = MODUL_CMD; |
---|
| 1389 | |
---|
| 1390 | // Print("before: %d\n", FF->nrows); |
---|
[0917a96] | 1391 | // FF->nrows = id_RankFreeModule(FF, r); // ??? |
---|
[4f7d76] | 1392 | // Print("after: %d\n", FF->nrows); |
---|
| 1393 | } |
---|
| 1394 | else |
---|
| 1395 | l->m[1].rtyp = IDEAL_CMD; |
---|
| 1396 | |
---|
[98c972] | 1397 | l->m[1].data = reinterpret_cast<void *>(FF); |
---|
| 1398 | |
---|
[4f7d76] | 1399 | res->rtyp = LIST_CMD; // list of int/module |
---|
| 1400 | res->data = reinterpret_cast<void *>(l); |
---|
| 1401 | |
---|
| 1402 | return FALSE; |
---|
| 1403 | |
---|
| 1404 | } |
---|
| 1405 | |
---|
| 1406 | |
---|
[5020a6] | 1407 | /* // the following turned out to be unnecessary... |
---|
| 1408 | /// Finds p^th AM ordering, and returns its position in r->typ[] AND |
---|
| 1409 | /// corresponding &r->wvhdl[] |
---|
| 1410 | /// returns FALSE if something went wrong! |
---|
| 1411 | /// p - starts with 0! |
---|
| 1412 | BOOLEAN rGetAMPos(const ring r, const int p, int &typ_pos, int &wvhdl_pos, const BOOLEAN bSearchWvhdl = FALSE) |
---|
| 1413 | { |
---|
| 1414 | #if MYTEST |
---|
| 1415 | Print("rGetAMPos(p: %d...)\nF:", p); |
---|
| 1416 | PrintLn(); |
---|
| 1417 | #endif |
---|
| 1418 | typ_pos = -1; |
---|
| 1419 | wvhdl_pos = -1; |
---|
| 1420 | |
---|
| 1421 | if (r->typ==NULL) |
---|
| 1422 | return FALSE; |
---|
| 1423 | |
---|
| 1424 | |
---|
| 1425 | int j = p; // Which IS record to use... |
---|
| 1426 | for( int pos = 0; pos < r->OrdSize; pos++ ) |
---|
| 1427 | if( r->typ[pos].ord_typ == ro_am) |
---|
| 1428 | if( j-- == 0 ) |
---|
| 1429 | { |
---|
| 1430 | typ_pos = pos; |
---|
| 1431 | |
---|
| 1432 | if( bSearchWvhdl ) |
---|
| 1433 | { |
---|
| 1434 | const int nblocks = rBlocks(r) - 1; |
---|
| 1435 | const int* w = r->typ[pos].data.am.weights; // ? |
---|
| 1436 | |
---|
| 1437 | for( pos = 0; pos <= nblocks; pos ++ ) |
---|
| 1438 | if (r->order[pos] == ringorder_am) |
---|
| 1439 | if( r->wvhdl[pos] == w ) |
---|
| 1440 | { |
---|
| 1441 | wvhdl_pos = pos; |
---|
| 1442 | break; |
---|
| 1443 | } |
---|
| 1444 | if (wvhdl_pos < 0) |
---|
| 1445 | return FALSE; |
---|
| 1446 | |
---|
| 1447 | assume(wvhdl_pos >= 0); |
---|
| 1448 | } |
---|
| 1449 | assume(typ_pos >= 0); |
---|
| 1450 | return TRUE; |
---|
| 1451 | } |
---|
| 1452 | |
---|
| 1453 | return FALSE; |
---|
| 1454 | } |
---|
| 1455 | |
---|
| 1456 | // // ? |
---|
| 1457 | // static BOOLEAN GetAMData(leftv res, leftv h) |
---|
| 1458 | // { |
---|
| 1459 | // NoReturn(res); |
---|
| 1460 | // |
---|
| 1461 | // const ring r = currRing; |
---|
| 1462 | // |
---|
| 1463 | // int p = 0; // which IS-block? p^th! |
---|
| 1464 | // |
---|
| 1465 | // if ((h!=NULL) && (h->Typ()==INT_CMD)) |
---|
| 1466 | // p = (int)((long)(h->Data())); h=h->next; |
---|
| 1467 | // |
---|
| 1468 | // assume(p >= 0); |
---|
| 1469 | // |
---|
| 1470 | // int d, w; |
---|
| 1471 | // |
---|
| 1472 | // if( !rGetAMPos(r, p, d, w, TRUE) ) |
---|
| 1473 | // { |
---|
| 1474 | // Werror("`GetAMData([int])`: no %d^th _am block-ordering!", p); |
---|
| 1475 | // return TRUE; |
---|
| 1476 | // } |
---|
| 1477 | // |
---|
| 1478 | // assume( r->typ[d].ord_typ == ro_am ); |
---|
| 1479 | // assume( r->order[w] == ringorder_am ); |
---|
| 1480 | // |
---|
| 1481 | // |
---|
| 1482 | // const short start = r->typ[d].data.am.start; // bounds of ordering (in E) |
---|
| 1483 | // const short end = r->typ[d].data.am.end; |
---|
| 1484 | // const short len_gen = r->typ[d].data.am.len_gen; // i>len_gen: weight(gen(i)):=0 |
---|
| 1485 | // const int *weights = r->typ[d].data.am.weights; // pointers into wvhdl field of length (end-start+1) + len_gen |
---|
| 1486 | // // contents w_1,... w_n, len, mod_w_1, .. mod_w_len, 0 |
---|
| 1487 | // |
---|
| 1488 | // assume( weights == r->wvhdl[w] ); |
---|
| 1489 | // |
---|
| 1490 | // |
---|
| 1491 | // lists l=(lists)omAllocBin(slists_bin); |
---|
| 1492 | // l->Init(2); |
---|
| 1493 | // |
---|
| 1494 | // const short V = end-start+1; |
---|
| 1495 | // intvec* ww_vars = new intvec(V); |
---|
| 1496 | // intvec* ww_gens = new intvec(len_gen); |
---|
| 1497 | // |
---|
| 1498 | // for (int i = 0; i < V; i++ ) |
---|
| 1499 | // (*ww_vars)[i] = weights[i]; |
---|
| 1500 | // |
---|
| 1501 | // assume( weights[V] == len_gen ); |
---|
| 1502 | // |
---|
| 1503 | // for (int i = 0; i < len_gen; i++ ) |
---|
| 1504 | // (*ww_gens)[i] = weights[i - V - 1]; |
---|
| 1505 | // |
---|
| 1506 | // |
---|
| 1507 | // l->m[0].rtyp = INTVEC_CMD; |
---|
| 1508 | // l->m[0].data = reinterpret_cast<void *>(ww_vars); |
---|
| 1509 | // |
---|
| 1510 | // l->m[1].rtyp = INTVEC_CMD; |
---|
| 1511 | // l->m[1].data = reinterpret_cast<void *>(ww_gens); |
---|
| 1512 | // |
---|
| 1513 | // |
---|
| 1514 | // return FALSE; |
---|
| 1515 | // |
---|
| 1516 | // } |
---|
| 1517 | */ |
---|
| 1518 | |
---|
[4f7d76] | 1519 | /// Returns old SyzCompLimit, can set new limit |
---|
| 1520 | static BOOLEAN SetInducedReferrence(leftv res, leftv h) |
---|
| 1521 | { |
---|
| 1522 | NoReturn(res); |
---|
| 1523 | |
---|
| 1524 | const ring r = currRing; |
---|
| 1525 | |
---|
| 1526 | if( !( (h!=NULL) && ( (h->Typ()==IDEAL_CMD) || (h->Typ()==MODUL_CMD))) ) |
---|
| 1527 | { |
---|
[227b7e] | 1528 | WerrorS("`SetInducedReferrence(<ideal/module>, [int[, int]])` expected"); |
---|
[4f7d76] | 1529 | return TRUE; |
---|
| 1530 | } |
---|
| 1531 | |
---|
| 1532 | const ideal F = (ideal)h->Data(); ; // No copy! |
---|
| 1533 | h=h->next; |
---|
| 1534 | |
---|
| 1535 | int rank = 0; |
---|
| 1536 | |
---|
| 1537 | if ((h!=NULL) && (h->Typ()==INT_CMD)) |
---|
| 1538 | { |
---|
| 1539 | rank = (int)((long)(h->Data())); h=h->next; |
---|
| 1540 | assume(rank >= 0); |
---|
| 1541 | } else |
---|
[0917a96] | 1542 | rank = id_RankFreeModule(F, r); // Starting syz-comp (1st: i+1) |
---|
[4f7d76] | 1543 | |
---|
| 1544 | int p = 0; // which IS-block? p^th! |
---|
| 1545 | |
---|
| 1546 | if ((h!=NULL) && (h->Typ()==INT_CMD)) |
---|
| 1547 | { |
---|
| 1548 | p = (int)((long)(h->Data())); h=h->next; |
---|
| 1549 | assume(p >= 0); |
---|
| 1550 | } |
---|
| 1551 | |
---|
| 1552 | const int posIS = rGetISPos(p, r); |
---|
| 1553 | |
---|
[805db88] | 1554 | if( /*(*/ -1 == posIS /*)*/ ) |
---|
[4f7d76] | 1555 | { |
---|
[227b7e] | 1556 | WerrorS("`SetInducedReferrence(<ideal/module>, [int[, int]])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)"); |
---|
[4f7d76] | 1557 | return TRUE; |
---|
| 1558 | } |
---|
| 1559 | |
---|
| 1560 | |
---|
| 1561 | |
---|
| 1562 | // F & componentWeights belong to that ordering block of currRing now: |
---|
[f3461d] | 1563 | rSetISReference(r, F, rank, p); // F will be copied! |
---|
[4f7d76] | 1564 | return FALSE; |
---|
| 1565 | } |
---|
| 1566 | |
---|
| 1567 | |
---|
[227b7e] | 1568 | // F = ISUpdateComponents( F, V, MIN ); |
---|
[4f7d76] | 1569 | // // replace gen(i) -> gen(MIN + V[i-MIN]) for all i > MIN in all terms from F! |
---|
| 1570 | static BOOLEAN ISUpdateComponents(leftv res, leftv h) |
---|
| 1571 | { |
---|
| 1572 | NoReturn(res); |
---|
| 1573 | |
---|
| 1574 | PrintS("ISUpdateComponents:.... \n"); |
---|
| 1575 | |
---|
| 1576 | if ((h!=NULL) && (h->Typ()==MODUL_CMD)) |
---|
| 1577 | { |
---|
| 1578 | ideal F = (ideal)h->Data(); ; // No copy! |
---|
| 1579 | h=h->next; |
---|
| 1580 | |
---|
| 1581 | if ((h!=NULL) && (h->Typ()==INTVEC_CMD)) |
---|
| 1582 | { |
---|
| 1583 | const intvec* const V = (const intvec* const) h->Data(); |
---|
| 1584 | h=h->next; |
---|
| 1585 | |
---|
| 1586 | if ((h!=NULL) && (h->Typ()==INT_CMD)) |
---|
| 1587 | { |
---|
| 1588 | const int MIN = (int)((long)(h->Data())); |
---|
| 1589 | |
---|
| 1590 | pISUpdateComponents(F, V, MIN, currRing); |
---|
| 1591 | return FALSE; |
---|
| 1592 | } |
---|
| 1593 | } |
---|
| 1594 | } |
---|
| 1595 | |
---|
[227b7e] | 1596 | WerrorS("`ISUpdateComponents(<module>, intvec, int)` expected"); |
---|
[4f7d76] | 1597 | return TRUE; |
---|
| 1598 | } |
---|
| 1599 | |
---|
| 1600 | |
---|
| 1601 | /// NF using length |
---|
| 1602 | static BOOLEAN reduce_syz(leftv res, leftv h) |
---|
| 1603 | { |
---|
[6909cfb] | 1604 | // const ring r = currRing; |
---|
[4f7d76] | 1605 | |
---|
| 1606 | if ( !( (h!=NULL) && (h->Typ()==VECTOR_CMD || h->Typ()==POLY_CMD) ) ) |
---|
| 1607 | { |
---|
[227b7e] | 1608 | WerrorS("`reduce_syz(<poly/vector>!, <ideal/module>, <int>, [int])` expected"); |
---|
[4f7d76] | 1609 | return TRUE; |
---|
| 1610 | } |
---|
| 1611 | |
---|
| 1612 | res->rtyp = h->Typ(); |
---|
| 1613 | const poly v = reinterpret_cast<poly>(h->Data()); |
---|
| 1614 | h=h->next; |
---|
| 1615 | |
---|
| 1616 | if ( !( (h!=NULL) && (h->Typ()==MODUL_CMD || h->Typ()==IDEAL_CMD ) ) ) |
---|
| 1617 | { |
---|
[227b7e] | 1618 | WerrorS("`reduce_syz(<poly/vector>, <ideal/module>!, <int>, [int])` expected"); |
---|
[4f7d76] | 1619 | return TRUE; |
---|
| 1620 | } |
---|
| 1621 | |
---|
| 1622 | assumeStdFlag(h); |
---|
| 1623 | const ideal M = reinterpret_cast<ideal>(h->Data()); h=h->next; |
---|
| 1624 | |
---|
| 1625 | |
---|
| 1626 | if ( !( (h!=NULL) && (h->Typ()== INT_CMD) ) ) |
---|
| 1627 | { |
---|
[227b7e] | 1628 | WerrorS("`reduce_syz(<poly/vector>, <ideal/module>, <int>!, [int])` expected"); |
---|
[4f7d76] | 1629 | return TRUE; |
---|
| 1630 | } |
---|
| 1631 | |
---|
| 1632 | const int iSyzComp = (int)((long)(h->Data())); h=h->next; |
---|
| 1633 | |
---|
| 1634 | int iLazyReduce = 0; |
---|
| 1635 | |
---|
| 1636 | if ( ( (h!=NULL) && (h->Typ()== INT_CMD) ) ) |
---|
| 1637 | iLazyReduce = (int)((long)(h->Data())); |
---|
| 1638 | |
---|
[f6c459] | 1639 | res->data = (void *)kNFLength(M, currQuotient, v, iSyzComp, iLazyReduce); // NOTE: currRing :( |
---|
[4f7d76] | 1640 | return FALSE; |
---|
| 1641 | } |
---|
| 1642 | |
---|
| 1643 | |
---|
| 1644 | /// Get raw syzygies (idPrepare) |
---|
| 1645 | static BOOLEAN idPrepare(leftv res, leftv h) |
---|
| 1646 | { |
---|
| 1647 | // extern int rGetISPos(const int p, const ring r); |
---|
| 1648 | |
---|
| 1649 | const ring r = currRing; |
---|
| 1650 | |
---|
| 1651 | const bool isSyz = rIsSyzIndexRing(r); |
---|
| 1652 | const int posIS = rGetISPos(0, r); |
---|
| 1653 | |
---|
| 1654 | |
---|
| 1655 | if ( !( (h!=NULL) && (h->Typ()==MODUL_CMD) && (h->Data() != NULL) ) ) |
---|
| 1656 | { |
---|
[227b7e] | 1657 | WerrorS("`idPrepare(<module>)` expected"); |
---|
[4f7d76] | 1658 | return TRUE; |
---|
| 1659 | } |
---|
| 1660 | |
---|
| 1661 | const ideal I = reinterpret_cast<ideal>(h->Data()); |
---|
| 1662 | |
---|
| 1663 | assume( I != NULL ); |
---|
| 1664 | idTest(I); |
---|
| 1665 | |
---|
| 1666 | int iComp = -1; |
---|
| 1667 | |
---|
| 1668 | h=h->next; |
---|
| 1669 | if ( (h!=NULL) && (h->Typ()==INT_CMD) ) |
---|
| 1670 | { |
---|
| 1671 | iComp = (int)((long)(h->Data())); |
---|
| 1672 | } else |
---|
| 1673 | { |
---|
[5c0183] | 1674 | if( (!isSyz) && (-1 == posIS) ) |
---|
| 1675 | { |
---|
| 1676 | WerrorS("`idPrepare(<...>)` called on incompatible ring (not created by 'MakeSyzCompOrdering' or 'MakeInducedSchreyerOrdering'!)"); |
---|
| 1677 | return TRUE; |
---|
| 1678 | } |
---|
| 1679 | |
---|
[4f7d76] | 1680 | if( isSyz ) |
---|
| 1681 | iComp = rGetCurrSyzLimit(r); |
---|
| 1682 | else |
---|
[0917a96] | 1683 | iComp = id_RankFreeModule(r->typ[posIS].data.is.F, r); // ; |
---|
[4f7d76] | 1684 | } |
---|
[5c0183] | 1685 | |
---|
| 1686 | assume(iComp >= 0); |
---|
[4f7d76] | 1687 | |
---|
| 1688 | |
---|
[443b19] | 1689 | intvec* w = reinterpret_cast<intvec *>(atGet(h, "isHomog", INTVEC_CMD)); |
---|
| 1690 | tHomog hom = testHomog; |
---|
[4f7d76] | 1691 | |
---|
| 1692 | // int add_row_shift = 0; |
---|
| 1693 | // |
---|
[443b19] | 1694 | if (w!=NULL) |
---|
| 1695 | { |
---|
| 1696 | w = ivCopy(w); |
---|
[4f7d76] | 1697 | // add_row_shift = ww->min_in(); |
---|
| 1698 | // |
---|
| 1699 | // (*ww) -= add_row_shift; |
---|
| 1700 | // |
---|
| 1701 | // if (idTestHomModule(I, currQuotient, ww)) |
---|
| 1702 | // { |
---|
[443b19] | 1703 | hom = isHomog; |
---|
[4f7d76] | 1704 | // w = ww; |
---|
| 1705 | // } |
---|
| 1706 | // else |
---|
| 1707 | // { |
---|
| 1708 | // //WarnS("wrong weights"); |
---|
| 1709 | // delete ww; |
---|
| 1710 | // w = NULL; |
---|
| 1711 | // hom=testHomog; |
---|
| 1712 | // } |
---|
[443b19] | 1713 | } |
---|
[4f7d76] | 1714 | |
---|
| 1715 | |
---|
| 1716 | // computes syzygies of h1, |
---|
| 1717 | // works always in a ring with ringorder_s |
---|
| 1718 | // NOTE: rSetSyzComp(syzcomp) should better be called beforehand |
---|
| 1719 | // ideal idPrepare (ideal h1, tHomog hom, int syzcomp, intvec **w); |
---|
| 1720 | |
---|
| 1721 | ideal J = // idPrepare( I, hom, iComp, &w); |
---|
| 1722 | kStd(I, currQuotient, hom, &w, NULL, iComp); |
---|
| 1723 | |
---|
| 1724 | idTest(J); |
---|
| 1725 | |
---|
[443b19] | 1726 | if (w!=NULL) |
---|
| 1727 | atSet(res, omStrDup("isHomog"), w, INTVEC_CMD); |
---|
| 1728 | // if (w!=NULL) delete w; |
---|
[4f7d76] | 1729 | |
---|
| 1730 | res->rtyp = MODUL_CMD; |
---|
| 1731 | res->data = reinterpret_cast<void *>(J); |
---|
| 1732 | return FALSE; |
---|
| 1733 | } |
---|
[f115489] | 1734 | |
---|
| 1735 | /// Get raw syzygies (idPrepare) |
---|
| 1736 | static BOOLEAN _p_Content(leftv res, leftv h) |
---|
| 1737 | { |
---|
| 1738 | if ( !( (h!=NULL) && (h->Typ()==POLY_CMD) && (h->Data() != NULL) ) ) |
---|
| 1739 | { |
---|
[227b7e] | 1740 | WerrorS("`p_Content(<poly-var>)` expected"); |
---|
[f115489] | 1741 | return TRUE; |
---|
| 1742 | } |
---|
| 1743 | |
---|
| 1744 | |
---|
| 1745 | const poly p = reinterpret_cast<poly>(h->Data()); |
---|
| 1746 | |
---|
| 1747 | |
---|
| 1748 | pTest(p); pWrite(p); PrintLn(); |
---|
| 1749 | |
---|
| 1750 | |
---|
| 1751 | p_Content( p, currRing); |
---|
| 1752 | |
---|
| 1753 | pTest(p); |
---|
| 1754 | pWrite(p); PrintLn(); |
---|
| 1755 | |
---|
| 1756 | NoReturn(res); |
---|
[f6c459] | 1757 | return FALSE; |
---|
[f115489] | 1758 | } |
---|
| 1759 | |
---|
[643877c] | 1760 | static BOOLEAN _m2_end(leftv res, leftv h) |
---|
| 1761 | { |
---|
| 1762 | int ret = 0; |
---|
| 1763 | |
---|
| 1764 | if ( (h!=NULL) && (h->Typ()!=INT_CMD) ) |
---|
| 1765 | { |
---|
| 1766 | WerrorS("`m2_end([<int>])` expected"); |
---|
| 1767 | return TRUE; |
---|
| 1768 | } |
---|
| 1769 | ret = (int)(long)(h->Data()); |
---|
| 1770 | |
---|
| 1771 | m2_end( ret ); |
---|
| 1772 | |
---|
| 1773 | NoReturn(res); |
---|
| 1774 | return FALSE; |
---|
| 1775 | } |
---|
| 1776 | |
---|
| 1777 | |
---|
| 1778 | |
---|
[4f7d76] | 1779 | END_NAMESPACE |
---|
| 1780 | |
---|
| 1781 | |
---|
[83192d] | 1782 | int SI_MOD_INIT(syzextra)(SModulFunctions* psModulFunctions) |
---|
[4f7d76] | 1783 | { |
---|
[986225e] | 1784 | #define ADD0(A,B,C,D,E) A(B, (char*)C, D, E) |
---|
| 1785 | // #define ADD(A,B,C,D,E) ADD0(iiAddCproc, "", C, D, E) |
---|
| 1786 | #define ADD(A,B,C,D,E) ADD0(A->iiAddCproc, B, C, D, E) |
---|
[ff12c6] | 1787 | ADD(psModulFunctions, currPack->libname, "ClearContent", FALSE, _ClearContent); |
---|
| 1788 | ADD(psModulFunctions, currPack->libname, "ClearDenominators", FALSE, _ClearDenominators); |
---|
| 1789 | |
---|
[5020a6] | 1790 | ADD(psModulFunctions, currPack->libname, "m2_end", FALSE, _m2_end); |
---|
| 1791 | |
---|
[986225e] | 1792 | ADD(psModulFunctions, currPack->libname, "DetailedPrint", FALSE, DetailedPrint); |
---|
[204092] | 1793 | ADD(psModulFunctions, currPack->libname, "leadmonomial", FALSE, _leadmonom); |
---|
[986225e] | 1794 | ADD(psModulFunctions, currPack->libname, "leadcomp", FALSE, leadcomp); |
---|
| 1795 | ADD(psModulFunctions, currPack->libname, "leadrawexp", FALSE, leadrawexp); |
---|
| 1796 | |
---|
| 1797 | ADD(psModulFunctions, currPack->libname, "ISUpdateComponents", FALSE, ISUpdateComponents); |
---|
| 1798 | ADD(psModulFunctions, currPack->libname, "SetInducedReferrence", FALSE, SetInducedReferrence); |
---|
| 1799 | ADD(psModulFunctions, currPack->libname, "GetInducedData", FALSE, GetInducedData); |
---|
| 1800 | ADD(psModulFunctions, currPack->libname, "SetSyzComp", FALSE, SetSyzComp); |
---|
| 1801 | ADD(psModulFunctions, currPack->libname, "MakeInducedSchreyerOrdering", FALSE, MakeInducedSchreyerOrdering); |
---|
| 1802 | ADD(psModulFunctions, currPack->libname, "MakeSyzCompOrdering", FALSE, MakeSyzCompOrdering); |
---|
[f63b13] | 1803 | |
---|
| 1804 | ADD(psModulFunctions, currPack->libname, "ProfilerStart", FALSE, _ProfilerStart); ADD(psModulFunctions, currPack->libname, "ProfilerStop", FALSE, _ProfilerStop ); |
---|
[4f7d76] | 1805 | |
---|
[986225e] | 1806 | ADD(psModulFunctions, currPack->libname, "noop", FALSE, noop); |
---|
| 1807 | ADD(psModulFunctions, currPack->libname, "idPrepare", FALSE, idPrepare); |
---|
| 1808 | ADD(psModulFunctions, currPack->libname, "reduce_syz", FALSE, reduce_syz); |
---|
[4f7d76] | 1809 | |
---|
[986225e] | 1810 | ADD(psModulFunctions, currPack->libname, "p_Content", FALSE, _p_Content); |
---|
[f115489] | 1811 | |
---|
[7b7c2c] | 1812 | ADD(psModulFunctions, currPack->libname, "Tail", FALSE, Tail); |
---|
[74afe1f] | 1813 | |
---|
[204092] | 1814 | ADD(psModulFunctions, currPack->libname, "ComputeLeadingSyzygyTerms", FALSE, _ComputeLeadingSyzygyTerms); |
---|
| 1815 | ADD(psModulFunctions, currPack->libname, "Compute2LeadingSyzygyTerms", FALSE, _Compute2LeadingSyzygyTerms); |
---|
[74afe1f] | 1816 | |
---|
[204092] | 1817 | ADD(psModulFunctions, currPack->libname, "Sort_c_ds", FALSE, _Sort_c_ds); |
---|
| 1818 | ADD(psModulFunctions, currPack->libname, "FindReducer", FALSE, _FindReducer); |
---|
[fe35f2] | 1819 | |
---|
| 1820 | |
---|
[204092] | 1821 | ADD(psModulFunctions, currPack->libname, "ReduceTerm", FALSE, _ReduceTerm); |
---|
| 1822 | ADD(psModulFunctions, currPack->libname, "TraverseTail", FALSE, _TraverseTail); |
---|
[fe35f2] | 1823 | |
---|
| 1824 | |
---|
[204092] | 1825 | ADD(psModulFunctions, currPack->libname, "SchreyerSyzygyNF", FALSE, _SchreyerSyzygyNF); |
---|
| 1826 | ADD(psModulFunctions, currPack->libname, "ComputeSyzygy", FALSE, _ComputeSyzygy); |
---|
[7b7c2c] | 1827 | |
---|
[5020a6] | 1828 | // ADD(psModulFunctions, currPack->libname, "GetAMData", FALSE, GetAMData); |
---|
[7b7c2c] | 1829 | |
---|
[5020a6] | 1830 | // ADD(psModulFunctions, currPack->libname, "", FALSE, ); |
---|
[7b7c2c] | 1831 | |
---|
[986225e] | 1832 | #undef ADD |
---|
[4f7d76] | 1833 | return 0; |
---|
| 1834 | } |
---|
[83192d] | 1835 | |
---|
| 1836 | #ifndef EMBED_PYTHON |
---|
| 1837 | extern "C" { |
---|
| 1838 | int mod_init(SModulFunctions* psModulFunctions) |
---|
| 1839 | { |
---|
| 1840 | return SI_MOD_INIT(syzextra)(psModulFunctions); |
---|
| 1841 | } |
---|
[4f7d76] | 1842 | } |
---|
[83192d] | 1843 | #endif |
---|