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
401 const unsigned int m_iFirstAltVar = scaFirstAltVar(
currRing);
402 const unsigned int m_iLastAltVar = scaLastAltVar(
currRing);
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
473
474
475
476
477
478
479
480
482 {
483
484 for (
int iNewElement = strat->
newIdeal; iNewElement <
IDELEMS(tempF); iNewElement++)
485 {
486 const poly pSave = tempF->m[iNewElement];
487
489 {
490
491
492 const poly p_next =
pNext(pSave);
493
495 for(
unsigned int i = m_iFirstAltVar;
i <= m_iLastAltVar;
i++ )
497 {
499
501
502#ifdef PDEBUG
504#endif
505
506 if( p_new ==
NULL)
continue;
507
510
513 else
515
518
519 int pos = 0;
520
522 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
523
525 }
526 }
527 }
528 }
529
530
531 while (strat->
Ll >= 0)
532 {
533#ifdef KDEBUG
535#endif
536
538
542 {
543
544#ifdef KDEBUG
545
546#endif
547
548
549
550
551 while ((strat->
Ll >= 0)
555 )
556 {
557#ifdef KDEBUG
558
559#endif
561
562 }
563 if (strat->
Ll<0)
break;
565 }
566
567
568 strat->
P = strat->
L[strat->
Ll];
570
571
572
573
574 if(strat->
P.IsNull())
continue;
575
577 {
578
580
581 strat->
P.p = nc_CreateSpoly(strat->
P.p1, strat->
P.p2,
currRing);
583 }
584
585
586 if(strat->
P.IsNull())
continue;
587
588 if (strat->
P.p1 ==
NULL)
589 {
590
591
592
593
594
596 }
597
600 &olddeg,&reduc,strat, red_result);
601
602
603 red_result = strat->
red(&strat->
P,strat);
604
605
606
607 if (red_result == 1)
608 {
609
611
612
613 strat->
P.GetP(strat->
lmBin);
614
615 int pos =
posInS(strat,strat->
sl,strat->
P.p,strat->
P.ecart);
616
617
619 {
620 strat->
P.pCleardenom();
622 {
623 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
624 strat->
P.pCleardenom();
625 }
626 }
627 else
628 {
631 strat->
P.p =
redtailBba(&(strat->
P),pos-1,strat, withT);
632 }
633 strat->
P.is_normalized=
nIsOne(pGetCoeff(strat->
P.p));
634
635#ifdef KDEBUG
637#endif
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662 {
665 }
666
667
669
670
671 strat->
enterS(&strat->
P, pos, strat, strat->
tl);
672
673
674
675
676 kDeleteLcm(&strat->
P);
677
678
679
680 const poly pSave = strat->
P.p;
681 const poly p_next =
pNext(pSave);
682
683
685 for(
unsigned int i = m_iFirstAltVar;
i <= m_iLastAltVar;
i++ )
687 {
690
691#ifdef PDEBUG
693#endif
694
695 if( p_new ==
NULL)
continue;
696
698
700
702 {
704 }
705 else
706 {
708 }
709
712
713 int pos = 0;
714
716 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
717
719
720
721
722
723#if 0
726
728
729
730 red_result = strat->
red(&
h,strat);
731
732
733 if (red_result != 1) continue;
734
735
736 int pos =
posInS(strat,strat->
sl,
h.p,
h.ecart);
737
738
740 {
743 {
746 }
747 }
748 else
749 {
753 }
754
755#ifdef KDEBUG
757#endif
758
759
760
763
765 pos = 0;
766 else
767 pos = strat->
posInL(strat->
L,strat->
Ll,&
h,strat);
768
770
771#endif
772
773 }
774 }
775
776
777
778
779
780
781#ifdef KDEBUG
782
783#endif
784
786
787
788
789 }
790
791#ifdef KDEBUG
793#endif
794
795
796
798 {
800 }
801
802
803
805
807
808
809
810
811
812
813
814
815
816
817
819
820
821
823
824
826 {
827
828 ideal I = strat->
Shdl;
833 }
834
835#if MYTEST
836 PrintS(
"\n\n</sca_bba>\n\n");
837#endif
838
840
841 return (strat->
Shdl);
842}
int(*) posInL(const LSet set, const int length, LObject *L, const kStrategy strat)
int(*) red(LObject *L, kStrategy strat)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void initBba(kStrategy strat)
ideal kInterRedOld(ideal F, const ideal Q)
void initBuchMora(ideal F, ideal Q, kStrategy strat)
void message(int i, int *olddeg, int *reduc, kStrategy strat, int red_result)
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 enterT(LObject *p, kStrategy strat, int atT)
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)
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)
#define TEST_OPT_DEGBOUND
#define TEST_OPT_NOT_BUCKETS
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....
void rWrite(ring r, BOOLEAN details)
#define rField_is_Ring(R)
ideal SCAQuotient(const ring r)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix