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

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

Definition at line 885 of file kstdfac.cc.

886 {
887  ideal r;
888  BOOLEAN b=currRing->pLexOrder,toReset=FALSE;
889  BOOLEAN delete_w=(w==NULL);
891  kStrategy orgstrat=strat;
892  ideal_list L=NULL;
893 
895  strat->LazyPass=20;
896  else
897  strat->LazyPass=2;
898  strat->LazyDegree = 1;
899  strat->ak = id_RankFreeModule(F,currRing);
900  if (h==testHomog)
901  {
902  if (strat->ak==0)
903  {
904  h = (tHomog)idHomIdeal(F,Q);
905  w=NULL;
906  }
907  else
908  h = (tHomog)idHomModule(F,Q,w);
909  }
910  if (h==isHomog)
911  {
912  if ((w!=NULL) && (*w!=NULL))
913  {
914  kModW = *w;
915  strat->kModW = *w;
916  strat->pOrigFDeg = currRing->pFDeg;
917  strat->pOrigLDeg = currRing->pLDeg;
919  toReset = TRUE;
920  }
921  currRing->pLexOrder = TRUE;
922  strat->LazyPass*=2;
923  }
924  strat->homog=h;
925  initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
926  initBuchMoraPos(strat);
927  initBba(F,strat);
928  initBuchMora(F, Q,strat);
929  if (D!=NULL)
930  {
931  strat->D=idCopy(D);
932  }
933 // Ende der Initalisierung
934  while (strat!=NULL)
935  {
936  if (TEST_OPT_DEBUG)
937  PrintS("====================================\n");
938  if (w!=NULL)
939  r=bbafac(F,Q,*w,strat,L);
940  else
941  r=bbafac(F,Q,NULL,strat,L);
942 #ifdef KDEBUG
943  int i;
944  for (i=0; i<IDELEMS(r); i++) pTest(r->m[i]);
945 #endif
946  idSkipZeroes(r);
947  // Testausgabe:
948  //if (!idIs0(r))
949  //{
950  // PrintS("===================================================\n");
951  // iiWriteMatrix((matrix)r,"S",1,currRing,0);
952  // PrintS("\n===================================================\n");
953  //}
954  //else
955  //{
956  // PrintS("=========empty============================\n");
957  //}
958  if(!idIs0(r))
959  {
960  ideal_list LL=(ideal_list)omAlloc(sizeof(*LL));
961  LL->d=r;
962 #ifndef SING_NDEBUG
963  LL->nr=strat->nr;
964 #endif
965  LL->next=L;
966  L=LL;
967  }
968  strat=strat->next;
969  }
970  /* check for empty sets */
971  if (L!=NULL)
972  {
973  ideal_list Lj=L->next;
974  ideal_list Lj_prev=L;
975  while (Lj!=NULL)
976  {
977  ideal_list Li=L;
978  while(Li!=Lj)
979  {
980  ideal r=kNF(Lj->d,NULL,Li->d,0,KSTD_NF_LAZY | KSTD_NF_NONORM);
981  if (idIs0(r))
982  {
983 #ifndef SING_NDEBUG
984  if(strat_fac_debug)
985  {
986  Print("empty set L(%d) because:L(%d)\n",Lj->nr,Li->nr);
987  }
988 #endif
989  if (TEST_OPT_DEBUG)
990  {
991  Print("empty set L[%p] because:L[%p]\n",(void*)Lj,(void*)Li);
992  }
993  // delete L[j],
994  Li=L;
995  if (Lj_prev!=NULL)
996  {
997  Lj=Lj_prev;
998  if (Lj==L) Lj_prev=NULL;
999  else
1000  {
1001  Lj_prev=L;
1002  while(Lj_prev->next!=Lj) Lj_prev=Lj_prev->next;
1003  }
1004  }
1005  else Lj=NULL;
1006  }
1007  else
1008  {
1009  Li=Li->next;
1010  }
1011  idDelete (&r);
1012  }
1013  if (Lj!=NULL) Lj=Lj->next;
1014  }
1015  }
1016 // Ende: aufraeumen
1017  if (toReset)
1018  {
1019  pRestoreDegProcs(currRing,strat->pOrigFDeg, strat->pOrigLDeg);
1020  kModW = NULL;
1021  }
1022  currRing->pLexOrder = b;
1023  delete(strat);
1024  strat=orgstrat;
1025  while (strat!=NULL)
1026  {
1027  orgstrat=strat->next;
1028  delete(strat);
1029  strat=orgstrat;
1030  }
1031  if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w;
1032  return L;
1033 }
BOOLEAN idHomIdeal(ideal id, ideal Q=NULL, const ring R=currRing)
Definition: ideals.h:109
int nr
Definition: kutil.h:347
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2598
#define Print
Definition: emacs.cc:83
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:7466
#define FALSE
Definition: auxiliary.h:140
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:7558
#define pTest(p)
Definition: polys.h:387
const ideal
Definition: gb_hack.h:42
#define TRUE
Definition: auxiliary.h:144
int ak
Definition: kutil.h:356
#define TEST_OPT_DEBUG
Definition: options.h:103
#define Q
Definition: sirandom.c:25
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w, const ring R=currRing)
Definition: ideals.h:114
#define omAlloc(size)
Definition: omAllocDecl.h:210
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:488
pFDegProc pOrigFDeg
Definition: kutil.h:295
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
pLDegProc pOrigLDeg
Definition: kutil.h:296
#define KSTD_NF_LAZY
Definition: kstd1.h:15
intvec * kModW
Definition: kstd1.cc:2042
BOOLEAN homog
Definition: kutil.h:366
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
tHomog
Definition: structs.h:37
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3452
void initBba(ideal, kStrategy strat)
Definition: kstd1.cc:1279
D(ideal gnc_gr_bba(const ideal, const ideal, const intvec *, const intvec *, kStrategy, const ring _currRing)) D(ideal gnc_gr_mora(const ideal
Modified Plural's Buchberger's algorithmus.
void idDelete(ideal *h, ring r=currRing)
delete an ideal
Definition: ideals.h:31
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:19
void idSkipZeroes(ideal ide)
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3464
kStrategy strat
Definition: myNF.cc:319
#define KSTD_NF_NONORM
Definition: kstd1.h:19
#define NULL
Definition: omList.c:10
ideal D
Definition: kutil.h:302
const CanonicalForm & w
Definition: facAbsFact.cc:55
intvec * kModW
Definition: kutil.h:335
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2044
ideal idCopy(ideal A, const ring R=currRing)
Definition: ideals.h:76
int strat_fac_debug
Definition: kstdfac.cc:29
int LazyPass
Definition: kutil.h:356
ideal bbafac(ideal, ideal Q, intvec *, kStrategy strat, ideal_list FL)
Definition: kstdfac.cc:541
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
kStrategy next
Definition: kutil.h:276
BOOLEAN idIs0(ideal h)
const poly b
Definition: syzextra.cc:213
int LazyDegree
Definition: kutil.h:356