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
429 int red_result = 1;
430 int olddeg, reduc;
431
432
433 int hilbcount = 0;
434
436
439
440
441
442
444
445
446
448
449
450
451 reduc = olddeg = 0;
452
453#define NO_BUCKETS
454
455#ifndef NO_BUCKETS
458#endif
459
460
462 withT = ! strat->
homog;
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
491 for (
int iNewElement = strat->
newIdeal; iNewElement <
IDELEMS(tempF); iNewElement++)
492 {
493 const poly pSave = tempF->m[iNewElement];
494
496 {
497
498
499 const poly p_next =
pNext(pSave);
500
502 for(
unsigned int i = m_iFirstAltVar;
i <= m_iLastAltVar;
i++ )
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
607 &olddeg,&reduc,strat, red_result);
608
609
610 red_result = strat->
red(&strat->
P,strat);
611
612
613
614 if (red_result == 1)
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 {
630 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
631 strat->
P.pCleardenom();
632 }
633 }
634 else
635 {
638 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
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;
688 const poly p_next =
pNext(pSave);
689
690
692 for(
unsigned int i = m_iFirstAltVar;
i <= m_iLastAltVar;
i++ )
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
737 red_result = strat->
red(&
h,strat);
738
739
740 if (red_result != 1) continue;
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
835 ideal I = strat->
Shdl;
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
ideal kInterRedOld(ideal F, ideal Q)
void initBba(kStrategy strat)
void kDebugPrint(kStrategy strat)
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