My Project  debian-1:4.1.1-p2+ds-4build3
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 807 of file kstdfac.cc.

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