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 808 of file kstdfac.cc.

809 {
810  ideal r;
811  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
812  BOOLEAN delete_w=(w==NULL);
814  kStrategy orgstrat=strat;
815  ideal_list L=NULL;
816 
818  strat->LazyPass=20;
819  else
820  strat->LazyPass=2;
821  strat->LazyDegree = 1;
823  if (h==testHomog)
824  {
825  if (strat->ak==0)
826  {
827  h = (tHomog)idHomIdeal(F,Q);
828  w=NULL;
829  }
830  else
831  h = (tHomog)idHomModule(F,Q,w);
832  }
833  if (h==isHomog)
834  {
835  if ((w!=NULL) && (*w!=NULL))
836  {
837  kModW = *w;
838  strat->kModW = *w;
839  strat->pOrigFDeg = currRing->pFDeg;
840  strat->pOrigLDeg = currRing->pLDeg;
842  toReset = TRUE;
843  }
844  currRing->pLexOrder = TRUE;
845  strat->LazyPass*=2;
846  }
847  strat->homog=h;
848  initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
850  initBba(strat);
851  initBuchMora(F, Q,strat);
852  if (D!=NULL)
853  {
854  strat->D=idCopy(D);
855  }
856 // Ende der Initalisierung
857  while (strat!=NULL)
858  {
859  if (TEST_OPT_DEBUG)
860  PrintS("====================================\n");
861  if (w!=NULL)
862  r=bbafac(F,Q,*w,strat,L);
863  else
864  r=bbafac(F,Q,NULL,strat,L);
865 #ifdef KDEBUG
866  int i;
867  for (i=0; i<IDELEMS(r); i++) pTest(r->m[i]);
868 #endif
869  idSkipZeroes(r);
870  // Testausgabe:
871  //if (!idIs0(r))
872  //{
873  // PrintS("===================================================\n");
874  // iiWriteMatrix((matrix)r,"S",1,currRing,0);
875  // PrintS("\n===================================================\n");
876  //}
877  //else
878  //{
879  // PrintS("=========empty============================\n");
880  //}
881  if(!idIs0(r))
882  {
883  ideal_list LL=(ideal_list)omAlloc(sizeof(*LL));
884  LL->d=r;
885 #ifndef SING_NDEBUG
886  LL->nr=strat->nr;
887 #endif
888  LL->next=L;
889  L=LL;
890  }
891  strat=strat->next;
892  }
893  /* check for empty sets */
894  if (L!=NULL)
895  {
896  ideal_list Lj=L->next;
897  ideal_list Lj_prev=L;
898  while (Lj!=NULL)
899  {
900  ideal_list Li=L;
901  while(Li!=Lj)
902  {
903  ideal r=kNF(Lj->d,NULL,Li->d,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
904  if (idIs0(r))
905  {
906 #ifdef KDEBUG
907  if (TEST_OPT_DEBUG)
908  {
909  Print("empty set L[%p] because:L[%p]\n",(void*)Lj,(void*)Li);
910  }
911 #endif
912  // delete L[j],
913  Li=L;
914  if (Lj_prev!=NULL)
915  {
916  Lj=Lj_prev;
917  if (Lj==L) Lj_prev=NULL;
918  else
919  {
920  Lj_prev=L;
921  while(Lj_prev->next!=Lj) Lj_prev=Lj_prev->next;
922  }
923  }
924  else Lj=NULL;
925  }
926  else
927  {
928  Li=Li->next;
929  }
930  idDelete (&r);
931  }
932  if (Lj!=NULL) Lj=Lj->next;
933  }
934  }
935 // Ende: aufraeumen
936  if (toReset)
937  {
939  kModW = NULL;
940  }
941  currRing->pLexOrder = b;
942  delete(strat);
943  strat=orgstrat;
944  while (strat!=NULL)
945  {
946  orgstrat=strat->next;
947  delete(strat);
948  strat=orgstrat;
949  }
950  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
951  return L;
952 }
int nr
Definition: kutil.h:334
#define D(A)
Definition: gentable.cc:123
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define Print
Definition: emacs.cc:83
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:9919
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
Definition: ideals.h:91
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:10092
#define pTest(p)
Definition: polys.h:398
#define TRUE
Definition: auxiliary.h:98
int ak
Definition: kutil.h:341
void initBba(kStrategy strat)
Definition: kstd1.cc:1426
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
#define omAlloc(size)
Definition: omAllocDecl.h:210
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:540
pFDegProc pOrigFDeg
Definition: kutil.h:282
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:283
#define KSTD_NF_LAZY
Definition: kstd1.h:17
intvec * kModW
Definition: kstd1.cc:2206
BOOLEAN homog
Definition: kutil.h:361
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
tHomog
Definition: structs.h:37
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3543
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9768
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal idCopy(ideal A)
Definition: ideals.h:60
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3555
int int kStrategy strat
Definition: myNF.cc:68
#define KSTD_NF_NONORM
Definition: kstd1.h:21
#define NULL
Definition: omList.c:10
ideal D
Definition: kutil.h:290
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:323
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2208
int LazyPass
Definition: kutil.h:341
ideal bbafac(ideal, ideal Q, intvec *, kStrategy strat, ideal_list FL)
Definition: kstdfac.cc:490
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
kStrategy next
Definition: kutil.h:263
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
const poly b
Definition: syzextra.cc:213
int LazyDegree
Definition: kutil.h:341