Modified modern Sinuglar Buchberger's algorithm.
369{
373
374#if MYTEST
375 PrintS(
"\n\n<sca_bba>\n\n");
376#endif
377
379
380#ifndef SING_NDEBUG
383#endif
384
385#if MYTEST
388#ifdef RDEBUG
389
390#endif
391
396
398#endif
399
400
403
405
407
410
411
412
413
414#if MYTEST
415
420#endif
421
423
426
427
428
431
432
434
436
439
440
441
442
444
445
446
448
449
450
452
453#define NO_BUCKETS
454
455#ifndef NO_BUCKETS
458#endif
459
460
463
464
466
467#undef HAVE_TAIL_RING
468
469#ifdef HAVE_TAIL_RING
472#endif
474 {
478 }
479
480
481
482
483
484
485
486
487
489 {
490
492 {
494
496 {
497
498
500
504 {
506
508
509#ifdef PDEBUG
511#endif
512
514
517
520 else
522
525
526 int pos = 0;
527
529 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
530
532 }
533 }
534 }
535 }
536
537
538 while (strat->
Ll >= 0)
539 {
540#ifdef KDEBUG
542#endif
543
545
549 {
550
551#ifdef KDEBUG
552
553#endif
554
555
556
557
558 while ((strat->
Ll >= 0)
562 )
563 {
564#ifdef KDEBUG
565
566#endif
568
569 }
570 if (strat->
Ll<0)
break;
572 }
573
574
575 strat->
P = strat->
L[strat->
Ll];
577
578
579
580
581 if(strat->
P.IsNull())
continue;
582
584 {
585
587
590 }
591
592
593 if(strat->
P.IsNull())
continue;
594
595 if (strat->
P.p1 ==
NULL)
596 {
597
598
599
600
601
603 }
604
606 message((strat->
honey ? strat->
P.ecart : 0) + strat->P.pFDeg(),
608
609
611
612
613
615 {
616
618
619
620 strat->
P.GetP(strat->
lmBin);
621
622 int pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
623
624
626 {
627 strat->
P.pCleardenom();
629 {
631 strat->
P.pCleardenom();
632 }
633 }
634 else
635 {
639 }
641
642#ifdef KDEBUG
644#endif
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669 {
672 }
673
674
676
677
678 strat->
enterS(strat->
P, pos, strat, strat->
tl);
679
680
681
682
684
685
686
687 const poly
pSave = strat->
P.p;
689
690
694 {
697
698#ifdef PDEBUG
700#endif
701
703
705
707
709 {
711 }
712 else
713 {
715 }
716
719
720 int pos = 0;
721
723 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
724
726
727
728
729
730#if 0
733
735
736
738
739
741
742
743 int pos =
posInS(strat,strat->
sl,
h.p,
h.ecart);
744
745
747 {
750 {
753 }
754 }
755 else
756 {
760 }
761
762#ifdef KDEBUG
764#endif
765
766
767
770
772 pos = 0;
773 else
774 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
775
777
778#endif
779
780 }
781 }
782
783
784
785
786
787
788#ifdef KDEBUG
789
790#endif
791
793
794
795
796 }
797
798#ifdef KDEBUG
800#endif
801
802
803
805 {
807 }
808
809
810
812
814
815
816
817
818
819
820
821
822
823
824
826
827
828
830
831
833 {
834
840 }
841
842#if MYTEST
843 PrintS(
"\n\n</sca_bba>\n\n");
844#endif
845
847
848 return (strat->
Shdl);
849}
int(* posInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
int(* posInT)(const TSet T, const int tl, LObject &h)
int(* red)(LObject *L, kStrategy strat)
static std::vector< std::vector< int > > p_new(ideal Xo, ideal Sigma)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void initBba(kStrategy strat)
void kDebugPrint(kStrategy strat)
ideal kInterRedOld(ideal F, const ideal Q)
VAR int(* test_PosInL)(const LSet set, const int length, LObject *L, const kStrategy strat)
VAR int(* test_PosInT)(const TSet T, const int tl, LObject &h)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
void enterT(LObject &p, kStrategy strat, int atT)
BOOLEAN kTest_TS(kStrategy strat)
void enterL(LSet *set, int *length, int *LSetmax, LObject p, int at)
void initBuchMoraPos(kStrategy strat)
void exitBuchMora(kStrategy strat)
void updateResult(ideal r, ideal Q, kStrategy strat)
void deleteInL(LSet set, int *length, int j, kStrategy strat)
void kStratInitChangeTailRing(kStrategy strat)
void initBuchMoraCrit(kStrategy strat)
void completeReduce(kStrategy strat, BOOLEAN withT)
void messageSets(kStrategy strat)
void messageStat(int hilbcount, kStrategy strat)
static bool rIsSCA(const ring r)
static poly nc_CreateSpoly(const poly p1, const poly p2, const ring r)
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
poly sca_pp_Mult_xi_pp(short i, const poly pPoly, const ring rRing)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define TEST_OPT_DEGBOUND
#define TEST_OPT_NOT_BUCKETS
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
void p_wrp(poly p, ring lmRing, ring tailRing)
void rChangeCurrRing(ring r)
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl....
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
void rWrite(ring r, BOOLEAN details)
#define rField_is_Ring(R)
ideal SCAQuotient(const ring r)
static short scaLastAltVar(ring r)
static short scaFirstAltVar(ring r)
static bool id_IsSCAHomogeneous(const ideal id, const intvec *wCx, const intvec *wCy, const ring r)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix