My Project
Loading...
Searching...
No Matches
kstdfac.h File Reference
#include "kernel/structs.h"
#include "polys/simpleideals.h"

Go to the source code of this file.

Functions

ideal_list kStdfac (ideal F, ideal Q, tHomog h, intvec **w, ideal D=NULL)
 

Function Documentation

◆ kStdfac()

ideal_list kStdfac ( ideal F,
ideal Q,
tHomog h,
intvec ** w,
ideal D = NULL )

Definition at line 800 of file kstdfac.cc.

801{
802 ideal r;
803 BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
804 BOOLEAN delete_w=(w==NULL);
805 kStrategy strat=new skStrategy;
806 kStrategy orgstrat=strat;
807 ideal_list L=NULL;
808
810 strat->LazyPass=20;
811 else
812 strat->LazyPass=2;
813 strat->LazyDegree = 1;
814 strat->ak = id_RankFreeModule(F,currRing);
815 if (h==testHomog)
816 {
817 if (strat->ak==0)
818 {
819 h = (tHomog)idHomIdeal(F,Q);
820 w=NULL;
821 }
822 else
823 h = (tHomog)idHomModule(F,Q,w);
824 }
825 if (h==isHomog)
826 {
827 if ((w!=NULL) && (*w!=NULL))
828 {
829 kModW = *w;
830 strat->kModW = *w;
831 strat->pOrigFDeg = currRing->pFDeg;
832 strat->pOrigLDeg = currRing->pLDeg;
834 toReset = TRUE;
835 }
836 currRing->pLexOrder = TRUE;
837 strat->LazyPass*=2;
838 }
839 strat->homog=h;
840 initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
841 initBuchMoraPos(strat);
842 initBba(strat);
843 initBuchMora(F, Q,strat);
844 if (D!=NULL)
845 {
846 strat->D=idCopy(D);
847 }
848// Ende der Initalisierung
849 while (strat!=NULL)
850 {
851 if (TEST_OPT_DEBUG)
852 PrintS("====================================\n");
853 if (w!=NULL)
854 r=bbafac(F,Q,*w,strat,L);
855 else
856 r=bbafac(F,Q,NULL,strat,L);
857#ifdef KDEBUG
858 int i;
859 for (i=0; i<IDELEMS(r); i++) pTest(r->m[i]);
860#endif
861 idSkipZeroes(r);
862 // Testausgabe:
863 //if (!idIs0(r))
864 //{
865 // PrintS("===================================================\n");
866 // iiWriteMatrix((matrix)r,"S",1,currRing,0);
867 // PrintS("\n===================================================\n");
868 //}
869 //else
870 //{
871 // PrintS("=========empty============================\n");
872 //}
873 if(!idIs0(r))
874 {
875 ideal_list LL=(ideal_list)omAlloc(sizeof(*LL));
876 LL->d=r;
877#ifndef SING_NDEBUG
878 LL->nr=strat->nr;
879#endif
880 LL->next=L;
881 L=LL;
882 }
883 strat=strat->next;
884 }
885 /* check for empty sets */
886 if (L!=NULL)
887 {
888 ideal_list Lj=L->next;
889 ideal_list Lj_prev=L;
890 while (Lj!=NULL)
891 {
892 ideal_list Li=L;
893 while(Li!=Lj)
894 {
895 ideal r=kNF(Lj->d,NULL,Li->d,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
896 if (idIs0(r))
897 {
898#ifdef KDEBUG
899 if (TEST_OPT_DEBUG)
900 {
901 Print("empty set L[%p] because:L[%p]\n",(void*)Lj,(void*)Li);
902 }
903#endif
904 // delete L[j],
905 Li=L;
906 if (Lj_prev!=NULL)
907 {
908 Lj=Lj_prev;
909 if (Lj==L) Lj_prev=NULL;
910 else
911 {
912 Lj_prev=L;
913 while(Lj_prev->next!=Lj) Lj_prev=Lj_prev->next;
914 }
915 }
916 else Lj=NULL;
917 }
918 else
919 {
920 Li=Li->next;
921 }
922 idDelete (&r);
923 }
924 if (Lj!=NULL) Lj=Lj->next;
925 }
926 }
927// Ende: aufraeumen
928 if (toReset)
929 {
931 kModW = NULL;
932 }
933 currRing->pLexOrder = b;
934 delete(strat);
935 strat=orgstrat;
936 while (strat!=NULL)
937 {
938 orgstrat=strat->next;
939 delete(strat);
940 strat=orgstrat;
941 }
942 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
943 return L;
944}
int BOOLEAN
Definition auxiliary.h:88
#define TRUE
Definition auxiliary.h:101
#define FALSE
Definition auxiliary.h:97
int i
Definition cfEzgcd.cc:132
CanonicalForm b
Definition cfModGcd.cc:4111
kStrategy next
Definition kutil.h:278
intvec * kModW
Definition kutil.h:336
ideal D
Definition kutil.h:305
int ak
Definition kutil.h:354
int nr
Definition kutil.h:347
pFDegProc pOrigFDeg
Definition kutil.h:297
int LazyPass
Definition kutil.h:354
int LazyDegree
Definition kutil.h:354
char homog
Definition kutil.h:371
pLDegProc pOrigLDeg
Definition kutil.h:298
#define Print
Definition emacs.cc:80
const CanonicalForm & w
Definition facAbsFact.cc:51
#define D(A)
Definition gentable.cc:128
#define idDelete(H)
delete an ideal
Definition ideals.h:29
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition ideals.h:96
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition ideals.h:91
ideal idCopy(ideal A)
Definition ideals.h:60
STATIC_VAR Poly * h
Definition janet.cc:971
long kModDeg(poly p, const ring r)
Definition kstd1.cc:2407
void initBba(kStrategy strat)
Definition kstd1.cc:1681
VAR intvec * kModW
Definition kstd1.cc:2405
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3224
#define KSTD_NF_LAZY
Definition kstd1.h:18
#define KSTD_NF_NONORM
Definition kstd1.h:22
ideal bbafac(ideal, ideal Q, intvec *, kStrategy strat, ideal_list FL)
Definition kstdfac.cc:480
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition kutil.cc:9751
void initBuchMoraPos(kStrategy strat)
Definition kutil.cc:9580
void initBuchMoraCrit(kStrategy strat)
Definition kutil.cc:9435
#define omAlloc(size)
#define NULL
Definition omList.c:12
#define TEST_OPT_DEBUG
Definition options.h:110
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition p_polys.cc:3729
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition p_polys.cc:3717
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
#define pTest(p)
Definition polys.h:415
void PrintS(const char *s)
Definition reporter.cc:284
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition ring.h:554
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define IDELEMS(i)
#define Q
Definition sirandom.c:26
tHomog
Definition structs.h:31
@ isHomog
Definition structs.h:33
@ testHomog
Definition structs.h:34
skStrategy * kStrategy
Definition structs.h:54