My Project
Loading...
Searching...
No Matches
Functions
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 798 of file kstdfac.cc.

799{
800 ideal r;
801 BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
802 BOOLEAN delete_w=(w==NULL);
803 kStrategy strat=new skStrategy;
804 kStrategy orgstrat=strat;
805 ideal_list L=NULL;
806
808 strat->LazyPass=20;
809 else
810 strat->LazyPass=2;
811 strat->LazyDegree = 1;
812 strat->ak = id_RankFreeModule(F,currRing);
813 if (h==testHomog)
814 {
815 if (strat->ak==0)
816 {
817 h = (tHomog)idHomIdeal(F,Q);
818 w=NULL;
819 }
820 else
821 h = (tHomog)idHomModule(F,Q,w);
822 }
823 if (h==isHomog)
824 {
825 if ((w!=NULL) && (*w!=NULL))
826 {
827 kModW = *w;
828 strat->kModW = *w;
829 strat->pOrigFDeg = currRing->pFDeg;
830 strat->pOrigLDeg = currRing->pLDeg;
832 toReset = TRUE;
833 }
834 currRing->pLexOrder = TRUE;
835 strat->LazyPass*=2;
836 }
837 strat->homog=h;
838 initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
839 initBuchMoraPos(strat);
840 initBba(strat);
841 initBuchMora(F, Q,strat);
842 if (D!=NULL)
843 {
844 strat->D=idCopy(D);
845 }
846// Ende der Initalisierung
847 while (strat!=NULL)
848 {
849 if (TEST_OPT_DEBUG)
850 PrintS("====================================\n");
851 if (w!=NULL)
852 r=bbafac(F,Q,*w,strat,L);
853 else
854 r=bbafac(F,Q,NULL,strat,L);
855#ifdef KDEBUG
856 int i;
857 for (i=0; i<IDELEMS(r); i++) pTest(r->m[i]);
858#endif
859 idSkipZeroes(r);
860 // Testausgabe:
861 //if (!idIs0(r))
862 //{
863 // PrintS("===================================================\n");
864 // iiWriteMatrix((matrix)r,"S",1,currRing,0);
865 // PrintS("\n===================================================\n");
866 //}
867 //else
868 //{
869 // PrintS("=========empty============================\n");
870 //}
871 if(!idIs0(r))
872 {
873 ideal_list LL=(ideal_list)omAlloc(sizeof(*LL));
874 LL->d=r;
875#ifndef SING_NDEBUG
876 LL->nr=strat->nr;
877#endif
878 LL->next=L;
879 L=LL;
880 }
881 strat=strat->next;
882 }
883 /* check for empty sets */
884 if (L!=NULL)
885 {
886 ideal_list Lj=L->next;
887 ideal_list Lj_prev=L;
888 while (Lj!=NULL)
889 {
890 ideal_list Li=L;
891 while(Li!=Lj)
892 {
893 ideal r=kNF(Lj->d,NULL,Li->d,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
894 if (idIs0(r))
895 {
896#ifdef KDEBUG
897 if (TEST_OPT_DEBUG)
898 {
899 Print("empty set L[%p] because:L[%p]\n",(void*)Lj,(void*)Li);
900 }
901#endif
902 // delete L[j],
903 Li=L;
904 if (Lj_prev!=NULL)
905 {
906 Lj=Lj_prev;
907 if (Lj==L) Lj_prev=NULL;
908 else
909 {
910 Lj_prev=L;
911 while(Lj_prev->next!=Lj) Lj_prev=Lj_prev->next;
912 }
913 }
914 else Lj=NULL;
915 }
916 else
917 {
918 Li=Li->next;
919 }
920 idDelete (&r);
921 }
922 if (Lj!=NULL) Lj=Lj->next;
923 }
924 }
925// Ende: aufraeumen
926 if (toReset)
927 {
929 kModW = NULL;
930 }
931 currRing->pLexOrder = b;
932 delete(strat);
933 strat=orgstrat;
934 while (strat!=NULL)
935 {
936 orgstrat=strat->next;
937 delete(strat);
938 strat=orgstrat;
939 }
940 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
941 return L;
942}
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int i
Definition: cfEzgcd.cc:132
CanonicalForm b
Definition: cfModGcd.cc:4103
kStrategy next
Definition: kutil.h:277
intvec * kModW
Definition: kutil.h:335
ideal D
Definition: kutil.h:304
int ak
Definition: kutil.h:353
int nr
Definition: kutil.h:346
pFDegProc pOrigFDeg
Definition: kutil.h:296
int LazyPass
Definition: kutil.h:353
int LazyDegree
Definition: kutil.h:353
char homog
Definition: kutil.h:372
pLDegProc pOrigLDeg
Definition: kutil.h:297
#define Print
Definition: emacs.cc:80
const CanonicalForm & w
Definition: facAbsFact.cc:51
#define D(A)
Definition: gentable.cc:131
#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, ring r)
Definition: kstd1.cc:2424
void initBba(kStrategy strat)
Definition: kstd1.cc:1689
VAR intvec * kModW
Definition: kstd1.cc:2422
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:3182
#define KSTD_NF_LAZY
Definition: kstd1.h:17
#define KSTD_NF_NONORM
Definition: kstd1.h:21
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:9800
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:9627
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9476
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define NULL
Definition: omList.c:12
#define TEST_OPT_DEBUG
Definition: options.h:109
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3649
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3637
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:414
void PrintS(const char *s)
Definition: reporter.cc:284
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:548
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)
Definition: simpleideals.h:23
#define Q
Definition: sirandom.c:26
tHomog
Definition: structs.h:35
@ isHomog
Definition: structs.h:37
@ testHomog
Definition: structs.h:38