My Project
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 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:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int i
Definition: cfEzgcd.cc:132
CanonicalForm b
Definition: cfModGcd.cc:4105
kStrategy next
Definition: kutil.h:274
intvec * kModW
Definition: kutil.h:334
ideal D
Definition: kutil.h:301
int ak
Definition: kutil.h:352
int nr
Definition: kutil.h:345
pFDegProc pOrigFDeg
Definition: kutil.h:293
int LazyPass
Definition: kutil.h:352
int LazyDegree
Definition: kutil.h:352
char homog
Definition: kutil.h:372
pLDegProc pOrigLDeg
Definition: kutil.h:294
#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
STATIC_VAR jList * Q
Definition: janet.cc:30
long kModDeg(poly p, ring r)
Definition: kstd1.cc:2396
void initBba(kStrategy strat)
Definition: kstd1.cc:1659
VAR intvec * kModW
Definition: kstd1.cc:2394
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:3158
#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:482
void initBuchMora(ideal F, ideal Q, kStrategy strat)
Definition: kutil.cc:10322
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:10149
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9997
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define NULL
Definition: omList.c:12
#define TEST_OPT_DEBUG
Definition: options.h:107
void pRestoreDegProcs(ring r, pFDegProc old_FDeg, pLDegProc old_lDeg)
Definition: p_polys.cc:3719
void pSetDegProcs(ring r, pFDegProc new_FDeg, pLDegProc new_lDeg)
Definition: p_polys.cc:3707
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:553
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
tHomog
Definition: structs.h:40
@ isHomog
Definition: structs.h:42
@ testHomog
Definition: structs.h:43