Data Structures | Macros | Typedefs | Functions | Variables
syz.h File Reference
#include <misc/mylimits.h>
#include <kernel/structs.h>
#include <polys/monomials/ring.h>
#include <kernel/ideals.h>

Go to the source code of this file.

Data Structures

struct  SObject
 
class  ssyStrategy
 

Macros

#define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE   8
 
#define SYZ_SHIFT_BASE_LOG   (BIT_SIZEOF_LONG - 1 - SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE)
 
#define SYZ_SHIFT_BASE   (1L << SYZ_SHIFT_BASE_LOG)
 

Typedefs

typedef SObject * SSet
 
typedef SSetSRes
 
typedef ssyStrategysyStrategy
 

Functions

void sySchreyersSyzygiesM (polyset F, int Fmax, polyset *Shdl, int *Smax, BOOLEAN noSort)
 
void sySchreyersSyzygiesB (polyset F, int Fmax, polyset *Shdl, int *Smax, BOOLEAN noSort)
 
resolvente sySchreyerResolvente (ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
 
syStrategy sySchreyer (ideal arg, int maxlength)
 
resolvente syResolvente (ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
 
syStrategy syResolution (ideal arg, int maxlength, intvec *w, BOOLEAN minim)
 
void syMinimizeResolvente (resolvente res, int length, int first)
 
intvecsyBetti (resolvente res, int length, int *regularity, intvec *weights=NULL, BOOLEAN tomin=TRUE, int *row_shift=NULL)
 
ideal syMinBase (ideal arg)
 
BOOLEAN syTestOrder (ideal i)
 
void syReOrderResolventFB (resolvente res, int length, int initial=1)
 
resolvente syLaScala1 (ideal arg, int *length)
 
syStrategy syLaScala3 (ideal arg, int *length)
 
syStrategy syLaScala (ideal arg, int &maxlength, intvec *weights=NULL)
 
syStrategy syHilb (ideal arg, int *length)
 
syStrategy syKosz (ideal arg, int *length)
 
void syKillComputation (syStrategy syzstr, ring r=currRing)
 
intvecsyBettiOfComputation (syStrategy syzstr, BOOLEAN minim=TRUE, int *row_shift=NULL, intvec *weights=NULL)
 
int sySize (syStrategy syzstr)
 
int syDim (syStrategy syzstr)
 
syStrategy syCopy (syStrategy syzstr)
 
void syPrint (syStrategy syzstr, const char *currRingName)
 
syStrategy syMinimize (syStrategy syzstr)
 
void syKillEmptyEntres (resolvente res, int length)
 
void syDeletePair (SObject *so)
 
void syInitializePair (SObject *so)
 
void syCopyPair (SObject *argso, SObject *imso)
 
void syCompactifyPairSet (SSet sPairs, int sPlength, int first)
 
void syCompactify1 (SSet sPairs, int *sPlength, int first)
 
SRes syInitRes (ideal arg, int *length, intvec *Tl, intvec *cw=NULL)
 
void syResetShiftedComponents (syStrategy syzstr, int index, int hilb=0)
 
void syEnlargeFields (syStrategy syzstr, int index)
 
void syEnterPair (syStrategy syzstr, SObject *so, int *sPlength, int index)
 
SSet syChosePairs (syStrategy syzstr, int *index, int *howmuch, int *actdeg)
 
int syInitSyzMod (syStrategy syzstr, int index, int init=17)
 
long syReorderShiftedComponents (long *sc, int n)
 
void syGaussForOne (ideal arg, int gen, int ModComp, int from=-1, int till=0)
 
void syEnterPair (SSet sPairs, SObject *so, int *sPlength, int index)
 
resolvente syReorder (resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy=TRUE, resolvente totake=NULL)
 

Variables

int * currcomponents
 
long * currShiftedComponents
 

Data Structure Documentation

struct sSObject

Definition at line 19 of file syz.h.

Data Fields
int ind1
int ind2
poly isNotMinimal
poly lcm
int length
int order
poly p
poly p1
poly p2
int reference
poly syz
int syzind
class ssyStrategy

Definition at line 37 of file syz.h.

Data Fields
int ** backcomponents
intvec * betti
kBucket_pt bucket
intvec * cw
int ** elemLength
int ** Firstelem
resolvente fullres
intvec ** hilb_coeffs
int ** Howmuch
int length
short list_length
resolvente minres
resolvente orderedRes
short references
int regularity
resolvente res
intvec * resolution
SRes resPairs
unsigned long ** sev
long ** ShiftedComponents
ring syRing
kBucket_pt syz_bucket
intvec * Tl
int ** truecomponents
intvec ** weights

Macro Definition Documentation

#define SYZ_SHIFT_BASE   (1L << SYZ_SHIFT_BASE_LOG)

Definition at line 18 of file syz.h.

#define SYZ_SHIFT_BASE_LOG   (BIT_SIZEOF_LONG - 1 - SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE)

Definition at line 17 of file syz.h.

#define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE   8

Definition at line 15 of file syz.h.

Typedef Documentation

typedef SSet* SRes

Definition at line 33 of file syz.h.

typedef SObject* SSet

Definition at line 32 of file syz.h.

Definition at line 35 of file syz.h.

Function Documentation

intvec* syBetti ( resolvente  res,
int  length,
int *  regularity,
intvec weights = NULL,
BOOLEAN  tomin = TRUE,
int *  row_shift = NULL 
)

Definition at line 793 of file syz.cc.

795 {
796 //#define BETTI_WITH_ZEROS
797  //tomin = FALSE;
798  int i,j=0,k=0,l,rows,cols,mr;
799  int *temp1,*temp2,*temp3;/*used to compute degrees*/
800  int *tocancel; /*(BOOLEAN)tocancel[i]=element is superfluous*/
801  int r0_len;
802 
803  /*------ compute size --------------*/
804  *regularity = -1;
805  cols = length;
806  while ((cols>0)
807  && ((res[cols-1]==NULL)
808  || (idIs0(res[cols-1]))))
809  {
810  cols--;
811  }
812  intvec * result;
813  if (idIs0(res[0]))
814  {
815  if (res[0]==NULL)
816  result = new intvec(1,1,1);
817  else
818  result = new intvec(1,1,res[0]->rank);
819  return result;
820  }
821  intvec *w=NULL;
822  if (weights!=NULL)
823  {
824  if (!idTestHomModule(res[0],currRing->qideal,weights))
825  {
826  WarnS("wrong weights given(3):");weights->show();PrintLn();
827  idHomModule(res[0],currRing->qideal,&w);
828  if (w!=NULL) { w->show();PrintLn();}
829  weights=NULL;
830  }
831  }
832 #if 0
833  if (idHomModule(res[0],currRing->qideal,&w)!=isHomog)
834  {
835  Warn("betti-command: Input is not homogeneous!");
836  weights=NULL;
837  }
838 #endif
839  if (weights==NULL) weights=w;
840  else delete w;
841  r0_len=IDELEMS(res[0]);
842  while ((r0_len>0) && (res[0]->m[r0_len-1]==NULL)) r0_len--;
843  #ifdef SHOW_W
844  PrintS("weights:");if (weights!=NULL) weights->show(); else Print("NULL"); PrintLn();
845  #endif
846  int rkl=l = si_max(id_RankFreeModule(res[0],currRing),res[0]->rank);
847  i = 0;
848  while ((i<length) && (res[i]!=NULL))
849  {
850  if (IDELEMS(res[i])>l) l = IDELEMS(res[i]);
851  i++;
852  }
853  temp1 = (int*)omAlloc0((l+1)*sizeof(int));
854  temp2 = (int*)omAlloc((l+1)*sizeof(int));
855  rows = 1;
856  mr = 1;
857  cols++;
858  for (i=0;i<cols-1;i++)
859  {
860  if ((i==0) && (weights!=NULL)) p_SetModDeg(weights, currRing);
861  memset(temp2,0,(l+1)*sizeof(int));
862  for (j=0;j<IDELEMS(res[i]);j++)
863  {
864  if (res[i]->m[j]!=NULL)
865  {
866  if ((pGetComp(res[i]->m[j])>l)
867  || ((i>1) && (res[i-1]->m[pGetComp(res[i]->m[j])-1]==NULL)))
868  {
869  WerrorS("input not a resolvent");
870  omFreeSize((ADDRESS)temp1,(l+1)*sizeof(int));
871  omFreeSize((ADDRESS)temp2,(l+1)*sizeof(int));
872  return NULL;
873  }
874  temp2[j+1] = p_FDeg(res[i]->m[j],currRing)+temp1[pGetComp(res[i]->m[j])];
875  if (temp2[j+1]-i>rows) rows = temp2[j+1]-i;
876  if (temp2[j+1]-i<mr) mr = temp2[j+1]-i;
877  }
878  }
879  if ((i==0) && (weights!=NULL)) p_SetModDeg(NULL, currRing);
880  temp3 = temp1;
881  temp1 = temp2;
882  temp2 = temp3;
883  }
884  mr--;
885  if (weights!=NULL)
886  {
887  for(j=0;j<weights->length();j++)
888  {
889  if (rows <(*weights)[j]+1) rows=(-mr)+(*weights)[j]+1;
890  }
891  }
892  /*------ computation betti numbers --------------*/
893  rows -= mr;
894  result = new intvec(rows+1,cols,0);
895  if (weights!=NULL)
896  {
897  for(j=0;j<weights->length();j++)
898  {
899  IMATELEM((*result),(-mr)+(*weights)[j]+1,1) ++;
900  //Print("imat(%d,%d)++ -> %d\n",(-mr)+(*weights)[j]+1, 1, IMATELEM((*result),(-mr)+(*weights)[j]+1,1));
901  }
902  }
903  else
904  {
905  (*result)[(-mr)*cols] = /*idRankFreeModule(res[0])*/ rkl;
906  if ((!idIs0(res[0])) && ((*result)[(-mr)*cols]==0))
907  (*result)[(-mr)*cols] = 1;
908  }
909  tocancel = (int*)omAlloc0((rows+1)*sizeof(int));
910  memset(temp1,0,(l+1)*sizeof(int));
911  if (weights!=NULL)
912  {
913  memset(temp2,0,l*sizeof(int));
914  p_SetModDeg(weights, currRing);
915  }
916  else
917  memset(temp2,0,l*sizeof(int));
918  syDetect(res[0],0,TRUE,temp2,tocancel);
919  if (weights!=NULL) p_SetModDeg(NULL, currRing);
920  if (tomin)
921  {
922  //(*result)[(-mr)*cols] -= dummy;
923  for(j=0;j<=rows+mr;j++)
924  {
925  //Print("tocancel[%d]=%d imat(%d,%d)=%d\n",j,tocancel[j],(-mr)+j+1,1,IMATELEM((*result),(-mr)+j+1,1));
926  IMATELEM((*result),(-mr)+j+1,1) -= tocancel[j];
927  }
928  }
929  for (i=0;i<cols-1;i++)
930  {
931  if ((i==0) && (weights!=NULL)) p_SetModDeg(weights, currRing);
932  memset(temp2,0,l*sizeof(int));
933  for (j=0;j<IDELEMS(res[i]);j++)
934  {
935  if (res[i]->m[j]!=NULL)
936  {
937  temp2[j+1] = p_FDeg(res[i]->m[j],currRing)+temp1[pGetComp(res[i]->m[j])];
938  //(*result)[i+1+(temp2[j+1]-i-1)*cols]++;
939  //if (temp2[j+1]>i) IMATELEM((*result),temp2[j+1]-i-mr,i+2)++;
940  IMATELEM((*result),temp2[j+1]-i-mr,i+2)++;
941  }
942  else if (i==0)
943  {
944  if (j<r0_len) IMATELEM((*result),-mr,2)++;
945  }
946  }
947  /*------ computation betti numbers, if res not minimal --------------*/
948  if (tomin)
949  {
950  for (j=mr;j<rows+mr;j++)
951  {
952  //(*result)[i+1+j*cols] -= tocancel[j+1];
953  IMATELEM((*result),j+1-mr,i+2) -= tocancel[j+1];
954  }
955  if ((i<length-1) && (res[i+1]!=NULL))
956  {
957  memset(tocancel,0,(rows+1)*sizeof(int));
958  syDetect(res[i+1],i+1,TRUE,temp2,tocancel);
959  for (j=0;j<rows;j++)
960  {
961  //(*result)[i+1+j*cols] -= tocancel[j];
962  IMATELEM((*result),j+1,i+2) -= tocancel[j];
963  }
964  }
965  }
966  temp3 = temp1;
967  temp1 = temp2;
968  temp2 = temp3;
969  for (j=0;j<=rows;j++)
970  {
971  // if (((*result)[i+1+j*cols]!=0) && (j>*regularity)) *regularity = j;
972  if ((IMATELEM((*result),j+1,i+2)!=0) && (j>*regularity)) *regularity = j;
973  }
974  if ((i==0) && (weights!=NULL)) p_SetModDeg(NULL, currRing);
975  }
976  // Print("nach minim:\n"); result->show(); PrintLn();
977  /*------ clean up --------------*/
978  omFreeSize((ADDRESS)tocancel,(rows+1)*sizeof(int));
979  omFreeSize((ADDRESS)temp1,(l+1)*sizeof(int));
980  omFreeSize((ADDRESS)temp2,(l+1)*sizeof(int));
981  if ((tomin) && (mr<0)) // deletes the first (zero) line
982  {
983  for (j=1;j<=rows+mr+1;j++)
984  {
985  for (k=1;k<=cols;k++)
986  {
987  IMATELEM((*result),j,k) = IMATELEM((*result),j-mr,k);
988  }
989  }
990  for (j=rows+mr+1;j<=rows+1;j++)
991  {
992  for (k=1;k<=cols;k++)
993  {
994  IMATELEM((*result),j,k) = 0;
995  }
996  }
997  }
998  j = 0;
999  k = 0;
1000  for (i=1;i<=result->rows();i++)
1001  {
1002  for(l=1;l<=result->cols();l++)
1003  if (IMATELEM((*result),i,l) != 0)
1004  {
1005  j = si_max(j, i-1);
1006  k = si_max(k, l-1);
1007  }
1008  }
1009  intvec * exactresult=new intvec(j+1,k+1,0);
1010  for (i=0;i<exactresult->rows();i++)
1011  {
1012  for (j=0;j<exactresult->cols();j++)
1013  {
1014  IMATELEM(*exactresult,i+1,j+1) = IMATELEM(*result,i+1,j+1);
1015  }
1016  }
1017  if (row_shift!=NULL) *row_shift = mr;
1018  delete result;
1019  return exactresult;
1020 }
void p_SetModDeg(intvec *w, ring r)
Definition: p_polys.cc:3528
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1881
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define TRUE
Definition: auxiliary.h:144
int length() const
Definition: intvec.h:86
void * ADDRESS
Definition: auxiliary.h:161
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
#define WarnS
Definition: emacs.cc:81
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define pGetComp(p)
Component.
Definition: polys.h:37
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
static long p_FDeg(const poly p, const ring r)
Definition: p_polys.h:375
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
int cols() const
Definition: intvec.h:87
int rows() const
Definition: intvec.h:88
const CanonicalForm & w
Definition: facAbsFact.cc:55
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
int syDetect(ideal id, int index, BOOLEAN homog, int *degrees, int *tocancel)
Definition: syz.cc:724
#define IMATELEM(M, I, J)
Definition: intvec.h:77
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
#define omAlloc0(size)
Definition: omAllocDecl.h:211
return result
Definition: facAbsBiFact.cc:76
int l
Definition: cfEzgcd.cc:94
#define Warn
Definition: emacs.cc:80
intvec* syBettiOfComputation ( syStrategy  syzstr,
BOOLEAN  minim = TRUE,
int *  row_shift = NULL,
intvec weights = NULL 
)

Don't change the syzstr???

Definition at line 1767 of file syz1.cc.

1769 {
1770  int dummy;
1771  BOOLEAN std_weights=TRUE;
1772  if ((weights!=NULL)
1773  && (syzstr->betti!=NULL)
1774  && (syzstr->weights!=NULL) && (syzstr->weights[0]!=NULL))
1775  {
1776  int i;
1777  for(i=weights->length()-1; i>=0; i--)
1778  {
1779  //Print("test %d: %d - %d\n",i,(*weights)[i], (*(syzstr->weights[0]))[i]);
1780  if ((*weights)[i]!=(*(syzstr->weights[0]))[i])
1781  {
1782  std_weights=FALSE;
1783  break;
1784  }
1785  }
1786  }
1787  if ((syzstr->betti!=NULL)
1788  && (std_weights))
1789  {
1790  if (minim || (syzstr->resPairs!=NULL))
1791  return ivCopy(syzstr->betti);
1792  }
1793 
1794  resolvente fullres = syzstr->fullres;
1795  resolvente minres = syzstr->minres;
1796  const int length = syzstr->length;
1797 
1798  if ((fullres==NULL) && (minres==NULL))
1799  {
1800  if (syzstr->hilb_coeffs==NULL)
1801  { // LA SCALA
1802  fullres = syReorder(syzstr->res, length, syzstr);
1803  }
1804  else
1805  { // HRES
1806  minres = syReorder(syzstr->orderedRes, length, syzstr);
1807  syKillEmptyEntres(minres, length);
1808  }
1809  }
1810 
1811  intvec *result=NULL;
1812 
1813  if (fullres!=NULL)
1814  result = syBetti(fullres,length,&dummy,weights,minim,row_shift);
1815  else
1816  result = syBetti(minres,length,&dummy,weights,minim,row_shift);
1817 
1818 
1819  return result; /// Don't change the syzstr???
1820 
1821  // TODO: cleanup thses!
1822  if( fullres != NULL && syzstr->fullres == NULL )
1823  syzstr->fullres = fullres;
1824  if( minres != NULL && syzstr->minres == NULL )
1825  syzstr->minres = minres;
1826 
1827  if ((result!=NULL)
1828  && ((minim) || (syzstr->resPairs!=NULL))
1829  && std_weights)
1830  {
1831  syzstr->betti = ivCopy(result); // cache the result...
1832  }
1833 
1834  return result;
1835 }
int length
Definition: syz.h:60
intvec ** weights
Definition: syz.h:45
void syKillEmptyEntres(resolvente res, int length)
Definition: syz1.cc:2209
#define FALSE
Definition: auxiliary.h:140
intvec * betti
Definition: syz.h:53
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1653
resolvente res
Definition: syz.h:47
#define TRUE
Definition: auxiliary.h:144
int length() const
Definition: intvec.h:86
intvec ** hilb_coeffs
Definition: syz.h:46
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
ideal * resolvente
Definition: ideals.h:20
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition: syz.cc:793
int BOOLEAN
Definition: auxiliary.h:131
return result
Definition: facAbsBiFact.cc:76
SSet syChosePairs ( syStrategy  syzstr,
int *  index,
int *  howmuch,
int *  actdeg 
)

Definition at line 1293 of file syz1.cc.

1294 {
1295  return syChosePairsPutIn(syzstr,index,howmuch,actdeg,0,syzstr->length);
1296 }
int length
Definition: syz.h:60
static SSet syChosePairsPutIn(syStrategy syzstr, int *index, int *howmuch, int *actdeg, int an, int en)
Definition: syz1.cc:1186
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void syCompactify1 ( SSet  sPairs,
int *  sPlength,
int  first 
)

Definition at line 140 of file syz1.cc.

141 {
142  int k=first,kk=0;
143 
144  while (k+kk<*sPlength)
145  {
146  if (sPairs[k+kk].lcm!=NULL)
147  {
148  if (kk>0) syCopyPair(&sPairs[k+kk],&sPairs[k]);
149  k++;
150  }
151  else
152  {
153  kk++;
154  }
155  }
156  while (k<*sPlength)
157  {
158  syInitializePair(&sPairs[k]);
159  k++;
160  }
161  *sPlength -= kk;
162 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
void syInitializePair(SObject *so)
Definition: syz1.cc:71
int k
Definition: cfEzgcd.cc:93
void syCopyPair(SObject *argso, SObject *imso)
Definition: syz1.cc:90
#define NULL
Definition: omList.c:10
void syCompactifyPairSet ( SSet  sPairs,
int  sPlength,
int  first 
)

Definition at line 112 of file syz1.cc.

113 {
114  int k=first,kk=0;
115 
116  while (k+kk<sPlength)
117  {
118  if (sPairs[k+kk].lcm!=NULL)
119  {
120  if (kk>0) syCopyPair(&sPairs[k+kk],&sPairs[k]);
121  k++;
122  }
123  else
124  {
125  kk++;
126  }
127  }
128  while (k<sPlength)
129  {
130  syInitializePair(&sPairs[k]);
131  k++;
132  }
133 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
void syInitializePair(SObject *so)
Definition: syz1.cc:71
int k
Definition: cfEzgcd.cc:93
void syCopyPair(SObject *argso, SObject *imso)
Definition: syz1.cc:90
#define NULL
Definition: omList.c:10
syStrategy syCopy ( syStrategy  syzstr)

Definition at line 1895 of file syz1.cc.

1896 {
1897  syStrategy result=syzstr;
1898  (result->references)++;
1899  return result;
1900 }
short references
Definition: syz.h:63
return result
Definition: facAbsBiFact.cc:76
void syCopyPair ( SObject *  argso,
SObject *  imso 
)

Definition at line 90 of file syz1.cc.

91 {
92  *imso=*argso;
93  (*argso).p = NULL;
94  (*argso).p1 = NULL;
95  (*argso).p2 = NULL;
96  (*argso).lcm = NULL;
97  (*argso).syz = NULL;
98  (*argso).ind1 = 0;
99  (*argso).ind2 = 0;
100  (*argso).syzind = -1;
101  (*argso).order = 0;
102  (*argso).isNotMinimal = NULL;
103  (*argso).length = -1;
104  (*argso).reference = -1;
105 }
#define NULL
Definition: omList.c:10
void syDeletePair ( SObject *  so)

Definition at line 52 of file syz1.cc.

53 {
54  pDelete(&(*so).p);
55  pDelete(&(*so).lcm);
56  pDelete(&(*so).syz);
57  (*so).p1 = NULL;
58  (*so).p2 = NULL;
59  (*so).ind1 = 0;
60  (*so).ind2 = 0;
61  (*so).syzind = -1;
62  (*so).order = 0;
63  (*so).isNotMinimal = NULL;
64  (*so).length = -1;
65  (*so).reference = -1;
66 }
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:157
int syDim ( syStrategy  syzstr)

Definition at line 1860 of file syz1.cc.

1861 {
1862  int i,l;
1863  if (syzstr->resPairs!=NULL)
1864  {
1865  SRes rP=syzstr->resPairs;
1866 
1867  l = syzstr->length;
1868  while ((l>0) && (rP[l-1]==NULL)) l--;
1869  if (l==0) return -1;
1870  l--;
1871  while (l>=0)
1872  {
1873  i = 0;
1874  while ((i<(*syzstr->Tl)[l]) &&
1875  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1876  (rP[l][i].isNotMinimal!=NULL))
1877  {
1878  i++;
1879  }
1880  if ((i<(*syzstr->Tl)[l]) &&
1881  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1882  (rP[l][i].isNotMinimal==NULL))
1883  return l;
1884  l--;
1885  }
1886  return l;
1887  }
1888  else
1889  return sySize(syzstr);
1890 }
int length
Definition: syz.h:60
intvec * Tl
Definition: syz.h:50
int sySize(syStrategy syzstr)
Definition: syz1.cc:1840
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
SSet * SRes
Definition: syz.h:33
int l
Definition: cfEzgcd.cc:94
void syEnlargeFields ( syStrategy  syzstr,
int  index 
)

Definition at line 739 of file syz1.cc.

740 {
741  pEnlargeSet(&(syzstr->res[index]->m),IDELEMS(syzstr->res[index]),16);
743  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
744  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
745  syzstr->ShiftedComponents[index]
746  =(long*)omRealloc0Size((ADDRESS)syzstr->ShiftedComponents[index],
747  (IDELEMS(syzstr->res[index])+1)*sizeof(long),
748  (IDELEMS(syzstr->res[index])+17)*sizeof(long));
750  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
751  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
752  syzstr->Howmuch[index]=(int*)omRealloc0Size((ADDRESS)syzstr->Howmuch[index],
753  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
754  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
755  syzstr->Firstelem[index]=(int*)omRealloc0Size((ADDRESS)syzstr->Firstelem[index],
756  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
757  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
758  syzstr->elemLength[index]=(int*)omRealloc0Size((ADDRESS)syzstr->elemLength[index],
759  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
760  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
761  syzstr->sev[index]=(unsigned long*)omRealloc0Size((ADDRESS)syzstr->sev[index],
762  (IDELEMS(syzstr->res[index])+1)*sizeof(unsigned long),
763  (IDELEMS(syzstr->res[index])+17)*sizeof(unsigned long));
764  IDELEMS(syzstr->res[index]) += 16;
765  pEnlargeSet(&(syzstr->orderedRes[index]->m),IDELEMS(syzstr->orderedRes[index]),16);
766  IDELEMS(syzstr->orderedRes[index]) += 16;
767 }
#define omRealloc0Size(addr, o_size, size)
Definition: omAllocDecl.h:221
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:161
resolvente orderedRes
Definition: syz.h:48
int ** backcomponents
Definition: syz.h:41
int ** Howmuch
Definition: syz.h:42
#define IDELEMS(i)
Definition: simpleideals.h:24
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int ** elemLength
Definition: syz.h:44
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
void pEnlargeSet(poly **p, int l, int increment)
Definition: p_polys.cc:3551
unsigned long ** sev
Definition: syz.h:59
void syEnterPair ( syStrategy  syzstr,
SObject *  so,
int *  sPlength,
int  index 
)

Definition at line 1040 of file syz1.cc.

1041 {
1042  int ll;
1043 
1044  if (*sPlength>=(*syzstr->Tl)[index])
1045  {
1046  SSet temp = (SSet)omAlloc0(((*syzstr->Tl)[index]+16)*sizeof(SObject));
1047  for (ll=0;ll<(*syzstr->Tl)[index];ll++)
1048  {
1049  temp[ll].p = (syzstr->resPairs[index])[ll].p;
1050  temp[ll].p1 = (syzstr->resPairs[index])[ll].p1;
1051  temp[ll].p2 = (syzstr->resPairs[index])[ll].p2;
1052  temp[ll].syz = (syzstr->resPairs[index])[ll].syz;
1053  temp[ll].lcm = (syzstr->resPairs[index])[ll].lcm;
1054  temp[ll].ind1 = (syzstr->resPairs[index])[ll].ind1;
1055  temp[ll].ind2 = (syzstr->resPairs[index])[ll].ind2;
1056  temp[ll].syzind = (syzstr->resPairs[index])[ll].syzind;
1057  temp[ll].order = (syzstr->resPairs[index])[ll].order;
1058  temp[ll].isNotMinimal = (syzstr->resPairs[index])[ll].isNotMinimal;
1059  temp[ll].length = (syzstr->resPairs[index])[ll].length;
1060  temp[ll].reference = (syzstr->resPairs[index])[ll].reference;
1061  }
1062  if (syzstr->resPairs[index] != NULL) // OB: ?????
1063  omFreeSize((ADDRESS)syzstr->resPairs[index],(*syzstr->Tl)[index]*sizeof(SObject));
1064  (*syzstr->Tl)[index] += 16;
1065  syzstr->resPairs[index] = temp;
1066  }
1067  syEnterPair(syzstr->resPairs[index],so,sPlength,index);
1068 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:161
intvec * Tl
Definition: syz.h:50
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
void syEnterPair(SSet sPairs, SObject *so, int *sPlength, int)
Definition: syz1.cc:990
SObject * SSet
Definition: syz.h:32
long ind2(long arg)
Definition: kutil.cc:3335
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
#define omAlloc0(size)
Definition: omAllocDecl.h:211
void syEnterPair ( SSet  sPairs,
SObject *  so,
int *  sPlength,
int  index 
)

Definition at line 990 of file syz1.cc.

991 {
992  int ll,k,no=(*so).order,sP=*sPlength,i;
993 
994  if ((sP==0) || (sPairs[sP-1].order<=no))
995  ll = sP;
996  else if (sP==1)
997  ll = 0;
998  else
999  {
1000  int an=0,en=sP-1;
1001  loop
1002  {
1003  if (an>=en-1)
1004  {
1005  if ((sPairs[an].order<=no) && (sPairs[an+1].order>no))
1006  {
1007  ll = an+1;
1008  break;
1009  }
1010  else if ((sPairs[en].order<=no) && (sPairs[en+1].order>no))
1011  {
1012  ll = en+1;
1013  break;
1014  }
1015  else if (sPairs[an].order>no)
1016  {
1017  ll = an;
1018  break;
1019  }
1020  else
1021  {
1022  PrintS("Hier ist was faul!\n");
1023  break;
1024  }
1025  }
1026  i=(an+en) / 2;
1027  if (sPairs[i].order <= no)
1028  an=i;
1029  else
1030  en=i;
1031  }
1032  }
1033  for (k=(*sPlength);k>ll;k--)
1034  {
1035  syCopyPair(&sPairs[k-1],&sPairs[k]);
1036  }
1037  syCopyPair(so,&sPairs[ll]);
1038  (*sPlength)++;
1039 }
loop
Definition: myNF.cc:98
int k
Definition: cfEzgcd.cc:93
void syCopyPair(SObject *argso, SObject *imso)
Definition: syz1.cc:90
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
void syGaussForOne ( ideal  arg,
int  gen,
int  ModComp,
int  from = -1,
int  till = 0 
)

Definition at line 223 of file syz.cc.

224 {
225  int /*k,j,i,*/lu;
226  poly unit1,unit2;
227  poly actWith=syz->m[elnum];
228 
229  if (from<0) from = 0;
230  if ((till<=0) || (till>IDELEMS(syz))) till = IDELEMS(syz);
231  syz->m[elnum] = NULL;
233 /*--makes Gauss alg. for the column ModComp--*/
234  pTakeOutComp(&(actWith), ModComp, &unit1, &lu);
235  while (from<till)
236  {
237  poly tmp=syz->m[from];
238  if (/*syz->m[from]*/ tmp!=NULL)
239  {
240  pTakeOutComp(&(tmp), ModComp, &unit2, &lu);
241  tmp = pMult(pCopy(unit1),tmp);
242  syz->m[from] = pSub(tmp,
243  pMult(unit2,pCopy(actWith)));
244  }
245  from++;
246  }
247  pDelete(&actWith);
248  pDelete(&unit1);
249 }
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:494
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define pSub(a, b)
Definition: polys.h:258
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
void pTakeOutComp(poly *p, long comp, poly *q, int *lq, const ring R=currRing)
Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other ...
Definition: polys.h:310
#define pMult(p, q)
Definition: polys.h:178
#define pDelete(p_ptr)
Definition: polys.h:157
polyrec * poly
Definition: hilb.h:10
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2707
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
syStrategy syHilb ( ideal  arg,
int *  length 
)

Definition at line 953 of file syz2.cc.

954 {
955  int i,j,actdeg=32000,index=0;
956  int howmuch,toSub=0;
957  int maxindex=0,maxdeg=0;
958  ideal temp=NULL;
959  SSet nextPairs;
960  ring origR = currRing;
961  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
962 
963  if ((idIs0(arg)) || (id_RankFreeModule(arg,currRing)>0))
964  {
966  syzstr->length = 1;
967  syzstr->minres[0] = idInit(1,arg->rank);
968  return syzstr;
969  }
970 
971  // Creare dp,S ring and change to it
972  syzstr->syRing = rAssure_dp_C(origR);
973  rChangeCurrRing(syzstr->syRing);
974 
975  // set initial ShiftedComps
976  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
977  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
978 
979 /*--- initializes the data structures---------------*/
980 #ifdef SHOW_CRIT
981  crit = 0;
982  crit1 = 0;
983  spfl = 0;
984  cons_pairs = 0;
985  crit_fails = 0;
986 #endif
987  syzstr->length = *length = currRing->N+2;
988  syzstr->Tl = new intvec(*length+1);
989  temp = idInit(IDELEMS(arg),arg->rank);
990  for (i=0;i<IDELEMS(arg);i++)
991  {
992  if (origR != syzstr->syRing)
993  temp->m[i] = prCopyR( arg->m[i], origR, syzstr->syRing);
994  else
995  temp->m[i] = pCopy( arg->m[i]);
996  if (temp->m[i]!=NULL)
997  {
998  j = pTotaldegree(temp->m[i]);
999  if (j<actdeg) actdeg = j;
1000  }
1001  }
1002  idTest(temp);
1003  idSkipZeroes(temp);
1004  syzstr->resPairs = syInitRes(temp,length,syzstr->Tl,syzstr->cw);
1005  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
1006  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(int));
1007  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1008  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1009  syzstr->elemLength = (int**)omAlloc0((*length+1)*sizeof(int*));
1010  syzstr->truecomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
1011  syzstr->backcomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
1012  syzstr->ShiftedComponents = (long**)omAlloc0((*length+1)*sizeof(long*));
1013  syzstr->Howmuch = (int**)omAlloc0((*length+1)*sizeof(int*));
1014  syzstr->Firstelem = (int**)omAlloc0((*length+1)*sizeof(int*));
1015  syzstr->hilb_coeffs = (intvec**)omAlloc0((*length+1)*sizeof(intvec*));
1016  syzstr->sev = (unsigned long **)omAlloc0((*length+1)*sizeof(unsigned long*));
1017  syzstr->bucket = kBucketCreate(currRing);
1018  syzstr->syz_bucket = kBucketCreate(currRing);
1019  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
1020 /*--- computes the resolution ----------------------*/
1021  while (nextPairs!=NULL)
1022  {
1023 #ifdef SHOW_PROT
1024 Print("compute %d Paare im Module %d im Grad %d \n",howmuch,index,actdeg+index);
1025 #endif
1026  if (TEST_OPT_PROT) Print("%d",actdeg);
1027  if (TEST_OPT_PROT) Print("(m%d)",index);
1028  if (index==0)
1029  i = syInitSyzMod(syzstr,index,id_RankFreeModule(arg, origR)+1);
1030  else
1031  i = syInitSyzMod(syzstr,index);
1032  j = syInitSyzMod(syzstr,index+1);
1033  if (index>0)
1034  {
1035  syRedNextPairs_Hilb(nextPairs,syzstr,howmuch,index,actdeg,&toSub,&maxindex,&maxdeg);
1036  syzstr->res[index+1]->rank=id_RankFreeModule(syzstr->res[index+1],currRing);
1037  sySetNewHilb(syzstr,toSub,index,actdeg);
1038  toSub = 0;
1039  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
1040  }
1041  else
1042  syRedGenerOfCurrDeg_Hilb(syzstr,actdeg,&maxindex,&maxdeg);
1043 /*--- creates new pairs -----------------------------*/
1044 #ifdef SHOW_PROT
1045 Print("Bilde neue Paare in Modul %d!\n",index);
1046 #endif
1047  syCreateNewPairs_Hilb(syzstr,index,actdeg);
1048  if (index<(*length)-1)
1049  {
1050 #ifdef SHOW_PROT
1051 Print("Bilde neue Paare in Modul %d!\n",index+1);
1052 #endif
1053  syCreateNewPairs_Hilb(syzstr,index+1,actdeg-1);
1054  }
1055  index++;
1056  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
1057  }
1058  syReOrdResult_Hilb(syzstr,maxindex,maxdeg);
1059 #ifdef SHOW_RESULT
1060 PrintS("minimal resolution:\n");
1061 for (int ti=1;ti<=*length;ti++)
1062 {
1063  if (!idIs0(syzstr->orderedRes[ti])) idPrint(syzstr->orderedRes[ti]);
1064 }
1065 PrintS("full resolution:\n");
1066 for (int ti=1;ti<=*length;ti++)
1067 {
1068  if (!idIs0(syzstr->res[ti])) idPrint(syzstr->res[ti]);
1069 }
1070 #endif
1071 #ifdef SHOW_CRIT
1072 Print("Criterion %d times applied\n",crit);
1073 Print("Criterion1 %d times applied\n",crit1);
1074 Print("%d superfluous pairs\n",spfl);
1075 Print("%d pairs considered\n",cons_pairs);
1076 Print("Criterion fails %d times\n",crit_fails);
1077 crit = 0;
1078 crit1 = 0;
1079 spfl = 0;
1080 cons_pairs = 0;
1081 crit_fails = 0;
1082 #endif
1083  if (temp!=NULL) idDelete(&temp);
1084  kBucketDestroy(&(syzstr->bucket));
1085  kBucketDestroy(&(syzstr->syz_bucket));
1086  if (origR != syzstr->syRing)
1087  rChangeCurrRing(origR);
1088  else
1089  currRing = origR;
1090  if (TEST_OPT_PROT) PrintLn();
1091  return syzstr;
1092 }
int length
Definition: syz.h:60
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw=NULL)
Definition: syz1.cc:298
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:98
omBin sip_sideal_bin
Definition: simpleideals.cc:30
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
Definition: syz1.cc:112
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
resolvente res
Definition: syz.h:47
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
Definition: syz1.cc:1293
static void syReOrdResult_Hilb(syStrategy syzstr, int maxindex, int maxdeg)
Definition: syz2.cc:908
void * ADDRESS
Definition: auxiliary.h:161
long * currShiftedComponents
Definition: syz1.cc:40
intvec ** hilb_coeffs
Definition: syz.h:46
intvec * Tl
Definition: syz.h:50
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
static void syRedNextPairs_Hilb(SSet nextPairs, syStrategy syzstr, int howmuch, int index, int actord, int *toSub, int *maxindex, int *maxdeg)
Definition: syz2.cc:497
#define idPrint(id)
Definition: ideals.h:59
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:204
Definition: intvec.h:14
int syInitSyzMod(syStrategy syzstr, int index, int init=17)
Definition: syz1.cc:1461
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
static long pTotaldegree(poly p)
Definition: polys.h:253
ring rAssure_dp_C(const ring r)
Definition: ring.cc:4885
int ** backcomponents
Definition: syz.h:41
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
int ** Howmuch
Definition: syz.h:42
static void syCreateNewPairs_Hilb(syStrategy syzstr, int index, int actdeg)
Definition: syz2.cc:71
kBucket_pt syz_bucket
Definition: syz.h:55
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:14
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
int * currcomponents
Definition: syz1.cc:39
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
void sySetNewHilb(syStrategy syzstr, int toSub, int index, int actord)
Definition: syz2.cc:787
unsigned long ** sev
Definition: syz.h:59
SObject * SSet
Definition: syz.h:32
ideal * resolvente
Definition: ideals.h:20
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:197
static void syRedGenerOfCurrDeg_Hilb(syStrategy syzstr, int deg, int *maxindex, int *maxdeg)
Definition: syz2.cc:847
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
#define idTest(id)
Definition: ideals.h:60
ssyStrategy * syStrategy
Definition: syz.h:35
void syInitializePair ( SObject *  so)

Definition at line 71 of file syz1.cc.

72 {
73  (*so).p = NULL;
74  (*so).lcm = NULL;
75  (*so).syz = NULL;
76  (*so).p1 = NULL;
77  (*so).p2 = NULL;
78  (*so).ind1 = 0;
79  (*so).ind2 = 0;
80  (*so).syzind = -1;
81  (*so).order = 0;
82  (*so).isNotMinimal = NULL;
83  (*so).length = -1;
84  (*so).reference = -1;
85 }
#define NULL
Definition: omList.c:10
SRes syInitRes ( ideal  arg,
int *  length,
intvec Tl,
intvec cw = NULL 
)

Definition at line 298 of file syz1.cc.

299 {
300  if (idIs0(arg)) return NULL;
301  SRes resPairs = (SRes)omAlloc0(*length*sizeof(SSet));
302  resPairs[0] = (SSet)omAlloc0(IDELEMS(arg)*sizeof(SObject));
303  intvec * iv=NULL;
304  int i,j;
305 
307  {
308  iv = idSort(arg);
309  for (i=0;i<IDELEMS(arg);i++)
310  {
311  (resPairs[0])[i].syz = /*pCopy*/(arg->m[(*iv)[i]-1]);
312  arg->m[(*iv)[i]-1] = NULL;
313  (resPairs[0])[i].order = pTotaldegree((resPairs[0])[i].syz);
314  }
315  }
316  else
317  {
318  iv = new intvec(IDELEMS(arg),1,-1);
319  for (i=0;i<IDELEMS(arg);i++)
320  {
321  (*iv)[i] = pTotaldegree(arg->m[i])+(*cw)[pGetComp(arg->m[i])-1];
322  }
323  for (i=0;i<IDELEMS(arg);i++)
324  {
325  j = syChMin(iv);
326  if (j<0) break;
327  (resPairs[0])[i].syz = arg->m[j];
328  arg->m[j] = NULL;
329  (resPairs[0])[i].order = (*iv)[j];
330  (*iv)[j] = -1;
331  }
332  }
333  if (iv!=NULL) delete iv;
334  (*Tl)[0] = IDELEMS(arg);
335  return resPairs;
336 }
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:181
#define pGetComp(p)
Component.
Definition: polys.h:37
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
static int syChMin(intvec *iv)
Definition: syz1.cc:275
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
static long pTotaldegree(poly p)
Definition: polys.h:253
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
SObject * SSet
Definition: syz.h:32
SSet * SRes
Definition: syz.h:33
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int syInitSyzMod ( syStrategy  syzstr,
int  index,
int  init = 17 
)

Definition at line 1461 of file syz1.cc.

1462 {
1463  int result;
1464 
1465  if (syzstr->res[index]==NULL)
1466  {
1467  syzstr->res[index] = idInit(init-1,1);
1468  syzstr->truecomponents[index] = (int*)omAlloc0(init*sizeof(int));
1469  syzstr->ShiftedComponents[index] = (long*)omAlloc0(init*sizeof(long));
1470  if (index==0)
1471  {
1472  for (int i=0;i<init;i++)
1473  {
1474  syzstr->truecomponents[0][i] = i;
1475  syzstr->ShiftedComponents[0][i] = (i)*SYZ_SHIFT_BASE;
1476  }
1477  }
1478  syzstr->backcomponents[index] = (int*)omAlloc0(init*sizeof(int));
1479  syzstr->Howmuch[index] = (int*)omAlloc0(init*sizeof(int));
1480  syzstr->Firstelem[index] = (int*)omAlloc0(init*sizeof(int));
1481  syzstr->elemLength[index] = (int*)omAlloc0(init*sizeof(int));
1482  syzstr->orderedRes[index] = idInit(init-1,1);
1483  syzstr->sev[index] = (unsigned long*) omAlloc0(init*sizeof(unsigned long));
1484  result = 0;
1485  }
1486  else
1487  {
1488  result = IDELEMS(syzstr->res[index]);
1489  while ((result>0) && (syzstr->res[index]->m[result-1]==NULL)) result--;
1490  }
1491  return result;
1492 }
resolvente res
Definition: syz.h:47
resolvente orderedRes
Definition: syz.h:48
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int ** backcomponents
Definition: syz.h:41
int i
Definition: cfEzgcd.cc:123
int ** Howmuch
Definition: syz.h:42
#define IDELEMS(i)
Definition: simpleideals.h:24
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int ** elemLength
Definition: syz.h:44
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
unsigned long ** sev
Definition: syz.h:59
#define omAlloc0(size)
Definition: omAllocDecl.h:211
return result
Definition: facAbsBiFact.cc:76
void syKillComputation ( syStrategy  syzstr,
ring  r = currRing 
)

Definition at line 1497 of file syz1.cc.

1498 {
1499  if (syzstr->references>0)
1500  {
1501  (syzstr->references)--;
1502  }
1503  else
1504  {
1505  int i,j;
1506  if (syzstr->minres!=NULL)
1507  {
1508  for (i=0;i<syzstr->length;i++)
1509  {
1510  if (syzstr->minres[i]!=NULL)
1511  {
1512  for (j=0;j<IDELEMS(syzstr->minres[i]);j++)
1513  {
1514  if (syzstr->minres[i]->m[j]!=NULL)
1515  p_Delete(&(syzstr->minres[i]->m[j]),r);
1516  }
1517  }
1518  id_Delete(&(syzstr->minres[i]),r);
1519  }
1520  omFreeSize((ADDRESS)syzstr->minres,(syzstr->length+1)*sizeof(ideal));
1521  }
1522  if (syzstr->fullres!=NULL)
1523  {
1524  for (i=0;i<syzstr->length;i++)
1525  {
1526  if (syzstr->fullres[i]!=NULL)
1527  {
1528  for (j=0;j<IDELEMS(syzstr->fullres[i]);j++)
1529  {
1530  if (syzstr->fullres[i]->m[j]!=NULL)
1531  p_Delete(&(syzstr->fullres[i]->m[j]),r);
1532  }
1533  }
1534  id_Delete(&(syzstr->fullres[i]),r);
1535  }
1536  omFreeSize((ADDRESS)syzstr->fullres,(syzstr->length+1)*sizeof(ideal));
1537  }
1538  if (syzstr->weights!=0)
1539  {
1540  for (i=0;i<syzstr->length;i++)
1541  {
1542  if (syzstr->weights[i]!=NULL)
1543  {
1544  delete syzstr->weights[i];
1545  }
1546  }
1547  omFreeSize((ADDRESS)syzstr->weights,syzstr->length*sizeof(intvec*));
1548  }
1549 
1550  ring sr=syzstr->syRing;
1551  if (sr==NULL) sr=r;
1552 
1553  if (syzstr->resPairs!=NULL)
1554  {
1555  for (i=0;i<syzstr->length;i++)
1556  {
1557  for (j=0;j<(*syzstr->Tl)[i];j++)
1558  {
1559  if ((syzstr->resPairs[i])[j].lcm!=NULL)
1560  p_Delete(&((syzstr->resPairs[i])[j].lcm),sr);
1561  if ((i>0) && ((syzstr->resPairs[i])[j].syz!=NULL))
1562  p_Delete(&((syzstr->resPairs[i])[j].syz),sr);
1563  }
1564  if (syzstr->orderedRes[i]!=NULL)
1565  {
1566  for (j=0;j<IDELEMS(syzstr->orderedRes[i]);j++)
1567  {
1568  syzstr->orderedRes[i]->m[j] = NULL;
1569  }
1570  }
1571  id_Delete(&(syzstr->orderedRes[i]),sr);
1572  if (syzstr->truecomponents[i]!=NULL)
1573  {
1574  omFreeSize((ADDRESS)syzstr->truecomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1575  syzstr->truecomponents[i]=NULL;
1576  omFreeSize((ADDRESS)syzstr->ShiftedComponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(long));
1577  syzstr->ShiftedComponents[i]=NULL;
1578  }
1579  if (syzstr->backcomponents[i]!=NULL)
1580  {
1581  omFreeSize((ADDRESS)syzstr->backcomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1582  syzstr->backcomponents[i]=NULL;
1583  }
1584  if (syzstr->Howmuch[i]!=NULL)
1585  {
1586  omFreeSize((ADDRESS)syzstr->Howmuch[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1587  syzstr->Howmuch[i]=NULL;
1588  }
1589  if (syzstr->Firstelem[i]!=NULL)
1590  {
1591  omFreeSize((ADDRESS)syzstr->Firstelem[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1592  syzstr->Firstelem[i]=NULL;
1593  }
1594  if (syzstr->elemLength[i]!=NULL)
1595  {
1596  omFreeSize((ADDRESS)syzstr->elemLength[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1597  syzstr->elemLength[i]=NULL;
1598  }
1599  if (syzstr->res[i]!=NULL)
1600  {
1601  for (j=0;j<IDELEMS(syzstr->res[i]);j++)
1602  {
1603  if (syzstr->res[i]->m[j]!=NULL)
1604  p_Delete(&(syzstr->res[i]->m[j]),sr);
1605  }
1606  }
1607  if ((syzstr->hilb_coeffs!=NULL)
1608  && (syzstr->hilb_coeffs[i]!=NULL))
1609  delete syzstr->hilb_coeffs[i];
1610  if (syzstr->sev[i] != NULL)
1611  omFreeSize((ADDRESS)syzstr->sev[i], (IDELEMS(syzstr->res[i])+1)*sizeof(unsigned long));
1612  id_Delete(&(syzstr->res[i]),sr);
1613  if (syzstr->resPairs[i] != NULL) // OB: ????
1614  omFreeSize((ADDRESS)syzstr->resPairs[i],(*syzstr->Tl)[i]*sizeof(SObject));
1615  }
1616  omFreeSize((ADDRESS)syzstr->resPairs,syzstr->length*sizeof(SObject*));
1617  omFreeSize((ADDRESS)syzstr->res,(syzstr->length+1)*sizeof(ideal));
1618  omFreeSize((ADDRESS)syzstr->orderedRes,(syzstr->length+1)*sizeof(ideal));
1619  omFreeSize((ADDRESS)syzstr->elemLength,(syzstr->length+1)*sizeof(int*));
1620  omFreeSize((ADDRESS)syzstr->truecomponents,(syzstr->length+1)*sizeof(int*));
1621  omFreeSize((ADDRESS)syzstr->ShiftedComponents,(syzstr->length+1)*sizeof(long*));
1622  if (syzstr->sev != NULL)
1623  omFreeSize(((ADDRESS)syzstr->sev), (syzstr->length+1)*sizeof(unsigned long*));
1624  omFreeSize((ADDRESS)syzstr->backcomponents,(syzstr->length+1)*sizeof(int*));
1625  omFreeSize((ADDRESS)syzstr->Howmuch,(syzstr->length+1)*sizeof(int*));
1626  omFreeSize((ADDRESS)syzstr->Firstelem,(syzstr->length+1)*sizeof(int*));
1627  if (syzstr->hilb_coeffs!=NULL)
1628  omFreeSize((ADDRESS)syzstr->hilb_coeffs,(syzstr->length+1)*sizeof(intvec*));
1629  }
1630  if (syzstr->cw!=NULL)
1631  delete syzstr->cw;
1632  if (syzstr->betti!=NULL)
1633  delete syzstr->betti;
1634  if (syzstr->resolution!=NULL)
1635  delete syzstr->resolution;
1636  if (syzstr->Tl!=NULL)
1637  delete syzstr->Tl;
1638  if ((syzstr->syRing != NULL) && (syzstr->syRing != r))
1639  {
1640  if(syzstr->syRing->typ[1].ord_typ == ro_syzcomp)
1641  rChangeSComps(NULL, NULL, 0, syzstr->syRing);
1642 
1643  rDelete(syzstr->syRing);
1644  }
1645  omFreeSize((ADDRESS)syzstr, sizeof(ssyStrategy));
1646  }
1647 }
int length
Definition: syz.h:60
intvec ** weights
Definition: syz.h:45
short references
Definition: syz.h:63
intvec * betti
Definition: syz.h:53
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:161
intvec ** hilb_coeffs
Definition: syz.h:46
intvec * Tl
Definition: syz.h:50
const ring r
Definition: syzextra.cc:208
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int ** backcomponents
Definition: syz.h:41
int i
Definition: cfEzgcd.cc:123
int ** Howmuch
Definition: syz.h:42
#define IDELEMS(i)
Definition: simpleideals.h:24
resolvente fullres
Definition: syz.h:57
int ** Firstelem
Definition: syz.h:43
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:849
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
unsigned long ** sev
Definition: syz.h:59
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4356
intvec * resolution
Definition: syz.h:51
void syKillEmptyEntres ( resolvente  res,
int  length 
)

Definition at line 2209 of file syz1.cc.

2210 {
2211  int i,j,jj,k,rj;
2212  intvec * changes;
2213  poly p;
2214  ideal ri;
2215 
2216  for (i=0;i<length;i++)
2217  {
2218  ri = res[i];
2219  if (ri!=NULL)
2220  {
2221  rj = IDELEMS(ri);
2222  changes = new intvec(rj+1,1,-1);
2223  while ((rj>0) && (ri->m[rj-1]==NULL)) rj--;
2224  j = k = 0;
2225  while (j+k<rj)
2226  {
2227  if (ri->m[j+k]!=NULL)
2228  {
2229  ri->m[j] = ri->m[j+k];
2230  (*changes)[j+k+1] = j+1;
2231  j++;
2232  }
2233  else
2234  {
2235  k++;
2236  }
2237  }
2238  for (jj=j;jj<rj;jj++)
2239  ri->m[jj] = NULL;
2240  if (res[i+1]!=NULL)
2241  {
2242  ri = res[i+1];
2243  for (j=IDELEMS(ri)-1;j>=0;j--)
2244  {
2245  p = ri->m[j];
2246  while (p!=NULL)
2247  {
2248  pSetComp(p,(*changes)[pGetComp(p)]);
2249  pSetm(p);
2250  pIter(p);
2251  }
2252  }
2253  }
2254  delete changes;
2255  }
2256  }
2257 }
#define pSetm(p)
Definition: polys.h:241
if(0 > strat->sl)
Definition: myNF.cc:73
return P p
Definition: myNF.cc:203
int k
Definition: cfEzgcd.cc:93
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
int j
Definition: myNF.cc:70
#define pSetComp(p, v)
Definition: polys.h:38
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
syStrategy syKosz ( ideal  arg,
int *  length 
)

Definition at line 1765 of file syz3.cc.

1766 {
1767  int i,j,jj,k=0,index=0,rk_arg/*,next_syz=0*/;
1768  int crit_comp,t_comp,next_deg,old_tl;
1769  ideal temp=NULL,old_ideal,old_repr;
1770  ring origR = currRing;
1771  poly next_gen;
1772  BOOLEAN isRegular;
1773 
1774  discard_pairs = 0;
1775  short_pairs = 0;
1776  if (idIs0(arg)) return NULL;
1777  rk_arg = id_RankFreeModule(arg,currRing);
1778  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
1779 /*--- changes to a Cdp-ring ----------------------------*/
1780  syzstr->syRing = rAssure_C_dp(origR); rChangeCurrRing(syzstr->syRing);
1781 /*--- initializes the data structures---------------*/
1782  syzstr->length = *length = (syzstr->syRing->N)+2;
1783  syzstr->regularity = -1;
1784  if (origR!=syzstr->syRing)
1785  temp = idrCopyR(arg, origR, syzstr->syRing);
1786  else
1787  temp = idCopy(arg);
1788  if (rk_arg==0)
1789  {
1790  id_Shift(temp,1,currRing);
1791  }
1792  idSkipZeroes(temp);
1793 #ifdef WITH_SORT
1794  if (temp->m[0]!=NULL)
1795  {
1796  int md;
1797  int maxdeg=p_FDeg(temp->m[IDELEMS(temp)-1],currRing);
1798  ideal temp1=idInit(IDELEMS(temp),temp->rank);
1799  for (j=IDELEMS(temp)-2;j>=0;j--)
1800  {
1801  jj = p_FDeg(temp->m[j],currRing);
1802  if (jj>maxdeg) maxdeg = jj;
1803  }
1804  while (!idIs0(temp))
1805  {
1806  md = maxdeg;
1807  for (j=IDELEMS(temp)-1;j>=0;j--)
1808  {
1809  if (temp->m[j]!=NULL)
1810  {
1811  jj = p_FDeg(temp->m[j],currRing);
1812  if (jj<md) md = jj;
1813  }
1814  }
1815  for (j=0;j<IDELEMS(temp);j++)
1816  {
1817  if ((temp->m[j]!=NULL) && (p_FDeg(temp->m[j],currRing)==md))
1818  {
1819  temp1->m[k] = temp->m[j];
1820  temp->m[j] = NULL;
1821  k++;
1822  }
1823  }
1824  }
1825  idDelete(&temp);
1826  temp = temp1;
1827  temp1 = NULL;
1828  }
1829 #endif
1830 #ifdef USE_REGULARITY
1831  int last_generator=IDELEMS(temp)-1;
1832  while ((last_generator>=0) && (temp->m[last_generator]==NULL))
1833  last_generator--;
1834 #endif
1835  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1836  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1837  resolvente totake=(resolvente)omAlloc0((*length+1)*sizeof(ideal));
1838  syzstr->Tl = new intvec(*length+1);
1839  syzstr->bucket = kBucketCreate(currRing);
1840  syzstr->syz_bucket = kBucketCreate(currRing);
1841  ideal new_generators=idInit(1,si_max(rk_arg,1));
1842  ideal temp_gens,old_std;
1843  syzstr->res[0] = idInit(1,1);
1844  if (rk_arg>1) syzstr->res[0]->rank = rk_arg;
1845  syzstr->orderedRes[0] = idInit(1,1);
1846 /*--- computes the resolution ----------------------*/
1847  i = 0;
1848  while (i<IDELEMS(temp))
1849  {
1850  if (temp->m[i]!=NULL)
1851  {
1852  new_generators->m[0] = kNF(syzstr->res[0],currRing->qideal,temp->m[i]);
1853  if (!nIsOne(pGetCoeff(new_generators->m[0])))
1854  pNorm(new_generators->m[0]);
1855  next_deg = p_FDeg(new_generators->m[0],currRing);
1856  next_gen = pCopy(new_generators->m[0]);
1857  }
1858  if (!idIs0(new_generators))
1859  {
1860  index = 0;
1861  while (index<=*length)
1862  {
1863  if (index==0)
1864  {
1865  old_ideal = idCopy(syzstr->res[0]);
1866  old_repr = idCopy(syzstr->orderedRes[0]);
1867  old_tl = (*syzstr->Tl)[0];
1868  old_std = id_Head(syzstr->res[0],currRing);
1869  }
1870  t_comp = (*syzstr->Tl)[index];
1871  if (index==0) crit_comp = t_comp;
1872  temp_gens = syAppendSyz(new_generators,syzstr, index,crit_comp,totake);
1873  crit_comp = t_comp;
1874  if (index==0)
1875  {
1876  isRegular = syIsRegular(old_std,syzstr->res[0],next_deg);
1877 #ifndef ONLY_STD
1878  if (isRegular)
1879  syCreateRegularExtension(syzstr,old_ideal,old_repr,old_tl,next_gen,
1880  totake);
1881 #ifdef USE_REGULARITY
1882  if ((index==0) && (!isRegular) && (i==last_generator))
1883  {
1884 /*----------- we are computing the regularity -----------------------*/
1885  ideal initial=id_Head(syzstr->res[0],currRing);
1886  int len=0,reg=0;
1887  intvec *w=NULL;
1888  ring dp_C_ring = rAssure_dp_C(currRing); rChangeCurrRing(dp_C_ring);
1889  initial = idrMoveR_NoSort(initial, syzstr->syRing, dp_C_ring);
1890  resolvente res = sySchreyerResolvente(initial,-1,&len,TRUE, TRUE);
1891  intvec * dummy = syBetti(res,len,&reg, w);
1892  syzstr->regularity = reg+2;
1893  delete dummy;
1894  delete w;
1895  for (j=0;j<len;j++)
1896  {
1897  if (res[j]!=NULL) idDelete(&(res[j]));
1898  }
1899  omFreeSize((ADDRESS)res,len*sizeof(ideal));
1900  idDelete(&initial);
1901  rChangeCurrRing(syzstr->syRing);
1902  rDelete(dp_C_ring);
1903  }
1904 #endif
1905 #endif
1906  idDelete(&old_ideal);
1907  idDelete(&old_repr);
1908  idDelete(&old_std);
1909  if (TEST_OPT_PROT)
1910  {
1911  if (isRegular)
1912  PrintS("\n regular\n");
1913  else
1914  PrintS("\n not regular\n");
1915  }
1916  if (next_gen!=NULL)
1917  pDelete(&next_gen);
1918  if (isRegular)
1919  {
1920  idDelete(&temp_gens);
1921  break;
1922  }
1923  }
1924  idDelete(&new_generators);
1925  new_generators = temp_gens;
1926 #ifdef ONLY_STD
1927  break;
1928 #endif
1929  if (idIs0(new_generators)) break;
1930  index++;
1931  }
1932  if (!idIs0(new_generators))
1933  {
1934  for (j=0;j<IDELEMS(new_generators);j++)
1935  {
1936  if (new_generators->m[j]!=NULL)
1937  {
1938  pDelete(&new_generators->m[j]);
1939  new_generators->m[j] = NULL;
1940  }
1941  }
1942  }
1943  }
1944  i++;
1945  }
1946  if (idIs0(new_generators) && new_generators!=NULL) idDelete(&new_generators);
1947  if (temp!=NULL) idDelete(&temp);
1948  kBucketDestroy(&(syzstr->bucket));
1949  kBucketDestroy(&(syzstr->syz_bucket));
1950  index = 0;
1951  syzstr->fullres = syzstr->res;
1952  syzstr->res = NULL;
1953  index = 0;
1954  while ((index<=*length) && (syzstr->fullres[index]!=NULL))
1955  {
1956 #ifdef SHOW_RESULT
1957  Print("The %d-th syzygy-module is now:\n",index);
1958  ideal ttt=id_Head(syzstr->fullres[index],currRing);
1959  idShow(ttt);
1960  idDelete(&ttt);
1961  //if (index>0)
1962  //{
1963  //Print("The related module is: \n");
1964  //idPrint(totake[index-1]);
1965  //}
1966  //Print("The %d-th module of the minimal resolution is:\n",index);
1967  if (!idIs0(totake[index]))
1968  idShow(totake[index]);
1969  //Print("with standard basis:\n");
1970  //idPrint(syzstr->fullres[index]);
1971  //if ((index<*length) && (totake[index+1]!=NULL))
1972  //{
1973  //Print("The %d-th syzygy-module is now:\n",index+1);
1974  //idPrint(totake[index+1]);
1975  //matrix m1=idModule2Matrix(totake[index]);
1976  //matrix m2=idModule2Matrix(totake[index+1]);
1977  //matrix m3=mpMult(m1,m2);
1978  //idPrint((ideal)m3);
1979  //}
1980 #endif
1981  if (!idIs0(totake[index]))
1982  {
1983  for(i=0;i<IDELEMS(totake[index]);i++)
1984  {
1985  if (totake[index]->m[i]!=NULL)
1986  {
1987  j=0;
1988  while ((j<IDELEMS(syzstr->fullres[index])) &&
1989  ((syzstr->fullres[index]->m[j]==NULL) ||
1990  (!pLmEqual(syzstr->fullres[index]->m[j],totake[index]->m[i])))) j++;
1991  if (j<IDELEMS(syzstr->fullres[index]))
1992  {
1993  pDelete(&totake[index]->m[i]);
1994  totake[index]->m[i] = syzstr->fullres[index]->m[j];
1995  syzstr->fullres[index]->m[j] = NULL;
1996  }
1997  else
1998  {
1999  PrintS("Da ist was faul!!!\n");
2000  Print("Aber: Regularitaet %d, Grad %ld\n",
2001  syzstr->regularity,p_FDeg(totake[index]->m[i],currRing));
2002  }
2003  }
2004  }
2005  idDelete(&syzstr->fullres[index]);
2006  syzstr->fullres[index] = totake[index];
2007  }
2008 #ifdef SHOW_RESULT
2009  idShow(syzstr->fullres[index]);
2010 #endif
2011  index++;
2012  }
2013  syReorder_Kosz(syzstr);
2014  index = 0;
2015  while ((index<=*length) && (syzstr->orderedRes[index]!=NULL))
2016  {
2017  idDelete(&(syzstr->orderedRes[index]));
2018  index++;
2019  }
2020  if (origR!=syzstr->syRing)
2021  {
2022  rChangeCurrRing(origR);
2023  index = 0;
2024  while ((index<=*length) && (syzstr->fullres[index]!=NULL))
2025  {
2026  syzstr->fullres[index] = idrMoveR(syzstr->fullres[index],syzstr->syRing, origR);
2027  index++;
2028  }
2029  }
2030  delete syzstr->Tl;
2031  syzstr->Tl = NULL;
2032  rDelete(syzstr->syRing);
2033  syzstr->syRing = NULL;
2034  omFreeSize((ADDRESS)totake,(*length+1)*sizeof(ideal));
2035  omFreeSize((ADDRESS)syzstr->orderedRes,(*length+1)*sizeof(ideal));
2036 //Print("Pairs to discard: %d\n",discard_pairs);
2037 //Print("Pairs shorter reduced: %d\n",short_pairs);
2038 //discard_pairs = 0;
2039 //short_pairs = 0;
2040  return syzstr;
2041 }
int length
Definition: syz.h:60
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2819
#define Print
Definition: emacs.cc:83
static ideal syAppendSyz(ideal new_generators, syStrategy syzstr, int index, int crit_comp, resolvente totake)
Definition: syz3.cc:1689
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:98
void syReorder_Kosz(syStrategy syzstr)
Definition: syz3.cc:266
static void syCreateRegularExtension(syStrategy syzstr, ideal old_ideal, ideal old_repr, int old_tl, poly next_generator, resolvente totake)
Definition: syz3.cc:112
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
resolvente res
Definition: syz.h:47
#define TRUE
Definition: auxiliary.h:144
#define nIsOne(n)
Definition: numbers.h:25
void * ADDRESS
Definition: auxiliary.h:161
int k
Definition: cfEzgcd.cc:93
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint)
Definition: simpleideals.cc:60
int regularity
Definition: syz.h:61
intvec * Tl
Definition: syz.h:50
poly res
Definition: myNF.cc:322
poly initial(const poly p, const ring r, const gfan::ZVector w)
Returns the initial form of p with respect to w.
Definition: initial.cc:32
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void id_Shift(ideal M, int s, const ring r)
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:204
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
ring rAssure_dp_C(const ring r)
Definition: ring.cc:4885
static long p_FDeg(const poly p, const ring r)
Definition: p_polys.h:375
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
Definition: prCopy.cc:249
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
kBucket_pt syz_bucket
Definition: syz.h:55
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
Definition: syz0.cc:861
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
resolvente fullres
Definition: syz.h:57
ideal idCopy(ideal A)
Definition: ideals.h:73
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:14
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int discard_pairs
Definition: syz3.cc:49
#define NULL
Definition: omList.c:10
static BOOLEAN syIsRegular(ideal old_ideal, ideal new_ideal, int deg)
Definition: syz3.cc:56
ring syRing
Definition: syz.h:56
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
ring rAssure_C_dp(const ring r)
Definition: ring.cc:4890
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:334
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define pDelete(p_ptr)
Definition: polys.h:157
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
int short_pairs
Definition: syz3.cc:50
ideal * resolvente
Definition: ideals.h:20
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition: syz.cc:793
polyrec * poly
Definition: hilb.h:10
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:197
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define pLmEqual(p1, p2)
Definition: polys.h:111
#define omAlloc0(size)
Definition: omAllocDecl.h:211
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
Definition: prCopy.cc:262
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
ssyStrategy * syStrategy
Definition: syz.h:35
syStrategy syLaScala ( ideal  arg,
int &  maxlength,
intvec weights = NULL 
)

Definition at line 2563 of file syz1.cc.

2564 {
2565  int i,j,actdeg=32000,index=0;
2566  int howmuch;
2567  ideal temp;
2568  SSet nextPairs;
2569  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2570  ring origR = currRing;
2571 
2572  if(weights!= NULL)
2573  syzstr->cw = new intvec(weights);
2574  else
2575  syzstr->cw = NULL;
2576 
2577  if ((idIs0(arg)) ||
2578  ((id_RankFreeModule(arg,currRing)>0) && (!idTestHomModule(arg, NULL, syzstr->cw))))
2579  {
2581  syzstr->length = 1;
2582  syzstr->minres[0] = idInit(1,arg->rank);
2583  return syzstr;
2584  }
2585 
2586 
2587  //crit = 0;
2588  //euler = -1;
2589  redpol = pInit();
2590 
2591  if( maxlength > 0 )
2592  syzstr->length = maxlength; // = (currRing->N)+2;
2593  else
2594  syzstr->length = maxlength = (currRing->N)+2;
2595 
2596  // Creare dp,S ring and change to it
2597  syzstr->syRing = rAssure_dp_S(origR);
2598  assume(syzstr->syRing != origR);
2599  assume(syzstr->syRing->typ[1].ord_typ == ro_syzcomp);
2600  rChangeCurrRing(syzstr->syRing);
2601 
2602  // set initial ShiftedComps
2603  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2604  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2605  for (i=0;i<=arg->rank;i++)
2606  {
2608  currcomponents[i] = i;
2609  }
2611 /*--- initializes the data structures---------------*/
2612  syzstr->Tl = new intvec(maxlength);
2613  temp = idInit(IDELEMS(arg),arg->rank);
2614  for (i=0;i<IDELEMS(arg);i++)
2615  {
2616  temp->m[i] = prCopyR( arg->m[i], origR, currRing);
2617  if (temp->m[i]!=NULL)
2618  {
2619  j = pTotaldegree(temp->m[i]);
2620  if (j<actdeg) actdeg = j;
2621  }
2622  }
2623  idTest(temp);
2624  idSkipZeroes(temp);
2625  idTest(temp);
2626  syzstr->resPairs = syInitRes(temp,&maxlength,syzstr->Tl,syzstr->cw);
2627  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2628  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2629 
2630  syzstr->res = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2631  syzstr->orderedRes = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2632  syzstr->elemLength = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2633 
2634  syzstr->truecomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2635  syzstr->ShiftedComponents = (long**)omAlloc0((maxlength+1)*sizeof(long*));
2636 
2637  syzstr->backcomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2638  syzstr->Howmuch = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2639  syzstr->Firstelem = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2640  syzstr->sev = (unsigned long **) omAlloc0((maxlength+1)*sizeof(unsigned long *));
2641 
2642  assume( syzstr->length == maxlength );
2643 
2644  syzstr->bucket = kBucketCreate(currRing);
2645  int len0=id_RankFreeModule(temp,currRing)+1;
2646 
2647  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2648  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2649 /*--- computes the resolution ----------------------*/
2650  while (nextPairs!=NULL)
2651  {
2652  if (TEST_OPT_PROT) Print("%d",actdeg);
2653  if (TEST_OPT_PROT) Print("(m%d)",index);
2654  if (index==0)
2655  i = syInitSyzMod(syzstr,index,len0);
2656  else
2657  i = syInitSyzMod(syzstr,index);
2658  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2659  currShiftedComponents = syzstr->ShiftedComponents[si_max(index-1,0)];
2660  rChangeSComps(currcomponents, currShiftedComponents,
2661  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2662  j = syInitSyzMod(syzstr,index+1);
2663  if (index>0)
2664  {
2665  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2666  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2667  }
2668  else
2669  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2670 /*--- creates new pairs -----------------------------*/
2671  syCreateNewPairs(syzstr,index,i);
2672  if (index<(maxlength-1))
2673  {
2674  syCreateNewPairs(syzstr,index+1,j);
2675  }
2676  index++;
2677  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2678  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2679  }
2680  if (temp!=NULL) idDelete(&temp);
2681  kBucketDestroy(&(syzstr->bucket));
2682  if (origR != syzstr->syRing)
2683  rChangeCurrRing(origR);
2684  pLmDelete(&redpol);
2685  if (TEST_OPT_PROT) PrintLn();
2686  return syzstr;
2687 }
int length
Definition: syz.h:60
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
Definition: syz1.cc:1074
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:98
int * currcomponents
Definition: syz1.cc:39
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1881
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static void syRedNextPairs(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
Definition: syz1.cc:773
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:161
omBin char_ptr_bin
Definition: ring.cc:55
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
Definition: syz1.cc:112
intvec * Tl
Definition: syz.h:50
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:204
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
static long pTotaldegree(poly p)
Definition: polys.h:253
#define assume(x)
Definition: mod2.h:405
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int syInitSyzMod(syStrategy syzstr, int index, int init)
Definition: syz1.cc:1461
int ** backcomponents
Definition: syz.h:41
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
int ** Howmuch
Definition: syz.h:42
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
Definition: syz1.cc:1293
#define IDELEMS(i)
Definition: simpleideals.h:24
static void syRedGenerOfCurrDeg(syStrategy syzstr, int deg, int index)
Definition: syz1.cc:920
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:14
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
ring rAssure_dp_S(const ring r)
Definition: ring.cc:4880
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
unsigned long ** sev
Definition: syz.h:59
#define pInit()
allocates a new monomial and initializes everything to 0
Definition: polys.h:61
long * currShiftedComponents
Definition: syz1.cc:40
SObject * SSet
Definition: syz.h:32
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw)
Definition: syz1.cc:298
ideal * resolvente
Definition: ideals.h:20
static poly redpol
Definition: syz1.cc:44
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:197
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4356
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:60
ssyStrategy * syStrategy
Definition: syz.h:35
resolvente syLaScala1 ( ideal  arg,
int *  length 
)
syStrategy syLaScala3 ( ideal  arg,
int *  length 
)

Definition at line 2435 of file syz1.cc.

2436 {
2437  int i,j,actdeg=32000,index=0;
2438  int howmuch;
2439  ideal temp;
2440  SSet nextPairs;
2441  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2442  ring origR = currRing;
2443 
2444  if ((idIs0(arg)) ||
2445  ((id_RankFreeModule(arg,currRing)>0) && (!idHomModule(arg,NULL,&(syzstr->cw)))))
2446  {
2448  syzstr->length = 1;
2449  syzstr->minres[0] = idInit(1,arg->rank);
2450  return syzstr;
2451  }
2452 
2453  //crit = 0;
2454  //euler = -1;
2455  redpol = pInit();
2456  syzstr->length = *length = (currRing->N)+2;
2457 
2458  // Creare dp,S ring and change to it
2459  syzstr->syRing = rAssure_dp_S(origR);
2460  assume(syzstr->syRing != origR); // why?
2461  rChangeCurrRing(syzstr->syRing);
2462 
2463  // set initial ShiftedComps
2464  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2465  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2466  for (i=0;i<=arg->rank;i++)
2467  {
2469  currcomponents[i] = i;
2470  }
2472 /*--- initializes the data structures---------------*/
2473  syzstr->Tl = new intvec(*length);
2474  temp = idInit(IDELEMS(arg),arg->rank);
2475  for (i=0;i<IDELEMS(arg);i++)
2476  {
2477  temp->m[i] = prCopyR( arg->m[i], origR, syzstr->syRing);
2478  if (temp->m[i]!=NULL)
2479  {
2480  j = pTotaldegree(temp->m[i]);
2481  if (j<actdeg) actdeg = j;
2482  }
2483  }
2484  idTest(temp);
2485  idSkipZeroes(temp);
2486  idTest(temp);
2487  syzstr->resPairs = syInitRes(temp,length,syzstr->Tl,syzstr->cw);
2488  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2489  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2490  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2491  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2492  syzstr->elemLength = (int**)omAlloc0((*length+1)*sizeof(int*));
2493  syzstr->truecomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2494  syzstr->ShiftedComponents = (long**)omAlloc0((*length+1)*sizeof(long*));
2495  syzstr->backcomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2496  syzstr->Howmuch = (int**)omAlloc0((*length+1)*sizeof(int*));
2497  syzstr->Firstelem = (int**)omAlloc0((*length+1)*sizeof(int*));
2498  syzstr->sev = (unsigned long **) omAlloc0((*length+1)*sizeof(unsigned long *));
2499  syzstr->bucket = kBucketCreate(currRing);
2500  int len0=id_RankFreeModule(temp,currRing)+1;
2501 
2502  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2503  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2504 /*--- computes the resolution ----------------------*/
2505  while (nextPairs!=NULL)
2506  {
2507  if (TEST_OPT_PROT) Print("%d",actdeg);
2508  if (TEST_OPT_PROT) Print("(m%d)",index);
2509  if (index==0)
2510  i = syInitSyzMod(syzstr,index,len0);
2511  else
2512  i = syInitSyzMod(syzstr,index);
2513  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2514  currShiftedComponents = syzstr->ShiftedComponents[si_max(index-1,0)];
2515  rChangeSComps(currcomponents, currShiftedComponents,
2516  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2517  j = syInitSyzMod(syzstr,index+1);
2518  if (index>0)
2519  {
2520  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2521  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2522  }
2523  else
2524  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2525 /*--- creates new pairs -----------------------------*/
2526  syCreateNewPairs(syzstr,index,i);
2527  if (index<(*length)-1)
2528  {
2529  syCreateNewPairs(syzstr,index+1,j);
2530  }
2531  index++;
2532  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2533  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2534  }
2535  if (temp!=NULL) idDelete(&temp);
2536  kBucketDestroy(&(syzstr->bucket));
2537 
2538  if (origR != syzstr->syRing)
2539  rChangeCurrRing(origR);
2540  pLmDelete(&redpol);
2541 
2542  if (TEST_OPT_PROT) PrintLn();
2543 
2544  assume(syzstr->minres==NULL); assume(syzstr->fullres ==NULL);
2545  assume(syzstr->resPairs!=NULL); assume(syzstr->hilb_coeffs==NULL);
2546  assume(syzstr->res!=NULL);
2547 
2548  if(! TEST_OPT_NO_SYZ_MINIM )
2549  syzstr->minres = syReadOutMinimalRes(syzstr);
2550  else
2551  syzstr->fullres = syReorder(syzstr->res, syzstr->length, syzstr); // buggy? (betti...?)
2552 
2553  return syzstr;
2554 }
int length
Definition: syz.h:60
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
Definition: syz1.cc:1074
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:98
int * currcomponents
Definition: syz1.cc:39
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static void syRedNextPairs(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
Definition: syz1.cc:773
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1653
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:161
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
Definition: syz1.cc:2322
omBin char_ptr_bin
Definition: ring.cc:55
intvec ** hilb_coeffs
Definition: syz.h:46
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
Definition: syz1.cc:112
intvec * Tl
Definition: syz.h:50
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:204
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define TEST_OPT_NO_SYZ_MINIM
Definition: options.h:118
int j
Definition: myNF.cc:70
static long pTotaldegree(poly p)
Definition: polys.h:253
#define assume(x)
Definition: mod2.h:405
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int syInitSyzMod(syStrategy syzstr, int index, int init)
Definition: syz1.cc:1461
int ** backcomponents
Definition: syz.h:41
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
int ** Howmuch
Definition: syz.h:42
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
Definition: syz1.cc:1293
#define IDELEMS(i)
Definition: simpleideals.h:24
static void syRedGenerOfCurrDeg(syStrategy syzstr, int deg, int index)
Definition: syz1.cc:920
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
resolvente fullres
Definition: syz.h:57
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:14
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
ring rAssure_dp_S(const ring r)
Definition: ring.cc:4880
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
unsigned long ** sev
Definition: syz.h:59
#define pInit()
allocates a new monomial and initializes everything to 0
Definition: polys.h:61
long * currShiftedComponents
Definition: syz1.cc:40
SObject * SSet
Definition: syz.h:32
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw)
Definition: syz1.cc:298
ideal * resolvente
Definition: ideals.h:20
static poly redpol
Definition: syz1.cc:44
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:197
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4356
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:60
ssyStrategy * syStrategy
Definition: syz.h:35
ideal syMinBase ( ideal  arg)

Definition at line 1025 of file syz.cc.

1026 {
1027  intvec ** weights=NULL;
1028  int leng;
1029  if (idIs0(arg)) return idInit(1,arg->rank);
1030  resolvente res=syResolvente(arg,1,&leng,&weights,TRUE);
1031  ideal result=res[0];
1032  omFreeSize((ADDRESS)res,leng*sizeof(ideal));
1033  if (weights!=NULL)
1034  {
1035  if (*weights!=NULL)
1036  {
1037  delete (*weights);
1038  *weights=NULL;
1039  }
1040  if ((leng>=1) && (*(weights+1)!=NULL))
1041  {
1042  delete *(weights+1);
1043  *(weights+1)=NULL;
1044  }
1045  }
1046  idSkipZeroes(result);
1047  return result;
1048 }
resolvente syResolvente(ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
Definition: syz.cc:394
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define TRUE
Definition: auxiliary.h:144
void * ADDRESS
Definition: auxiliary.h:161
poly res
Definition: myNF.cc:322
Definition: intvec.h:14
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
ideal * resolvente
Definition: ideals.h:20
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
return result
Definition: facAbsBiFact.cc:76
syStrategy syMinimize ( syStrategy  syzstr)

Definition at line 2403 of file syz1.cc.

2404 {
2405  if (syzstr->minres==NULL)
2406  {
2407  if (syzstr->resPairs!=NULL)
2408  {
2409  if (syzstr->hilb_coeffs==NULL)
2410  {
2411  // La Scala Resolution
2412  syzstr->minres = syReadOutMinimalRes(syzstr);
2413  }
2414  else
2415  { // HRES
2416  syzstr->minres = syReorder(syzstr->orderedRes,syzstr->length,syzstr);
2417  }
2418  }
2419  else if (syzstr->fullres!=NULL)
2420  {
2421  syMinimizeResolvente(syzstr->fullres,syzstr->length,1);
2422  syzstr->minres = syzstr->fullres;
2423  syzstr->fullres = NULL;
2424  }
2425  }
2426  (syzstr->references)++;
2427  return syzstr;
2428 }
int length
Definition: syz.h:60
void syMinimizeResolvente(resolvente res, int length, int first)
Definition: syz.cc:360
short references
Definition: syz.h:63
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1653
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
Definition: syz1.cc:2322
intvec ** hilb_coeffs
Definition: syz.h:46
resolvente orderedRes
Definition: syz.h:48
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
void syMinimizeResolvente ( resolvente  res,
int  length,
int  first 
)

Definition at line 360 of file syz.cc.

361 {
362  int syzIndex=first;
363  intvec *dummy;
364 
365  if (syzIndex<1) syzIndex=1;
366  if ((syzIndex==1) && (idHomModule(res[0],currRing->qideal,&dummy)) && (!rIsPluralRing(currRing)))
367  {
368  syMinStep1(res,length);
369  delete dummy;
370  return;
371  }
372  while ((syzIndex<length-1) && (res[syzIndex]!=NULL) && (res[syzIndex+1]!=NULL))
373  {
374  syMinStep(res[syzIndex-1],res[syzIndex],FALSE,res[syzIndex+1]);
375  syzIndex++;
376  }
377  if (res[syzIndex]!=NULL)
378  syMinStep(res[syzIndex-1],res[syzIndex]);
379  if (!idIs0(res[0]))
380  idMinEmbedding(res[0],TRUE);
381 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
static void syMinStep1(resolvente res, int length)
Definition: syz.cc:294
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
Definition: ideals.cc:2344
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
static void syMinStep(ideal mod, ideal syz, BOOLEAN final=FALSE, ideal up=NULL, tHomog h=isNotHomog)
Definition: syz.cc:87
#define NULL
Definition: omList.c:10
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
void syPrint ( syStrategy  syzstr,
const char *  currRingName 
)

Definition at line 1945 of file syz1.cc.

1946 {
1947  if ( (syzstr->resPairs==NULL) &&
1948  (syzstr->fullres==NULL) &&
1949  (syzstr->minres==NULL) &&
1950  (syzstr->resolution == NULL) )
1951  {
1952  PrintS("No resolution defined\n");
1953  return;
1954  }
1955 
1956  intvec* resolution = syzstr->resolution;
1957 
1958  if (resolution==NULL)
1959  {
1960  if (syzstr->resPairs!=NULL)
1961  {
1962  resolution = new intvec(syzstr->length+1);
1963  SRes rP = syzstr->resPairs;
1964 // assume(idRankFreeModule(syzstr->res[1], (syzstr->syRing != NULL ? syzstr->syRing : currRing))==syzstr->res[1]->rank);
1965  (*resolution)[0] = syzstr->res[1]->rank;
1966  int k=0;
1967  while ((k<syzstr->length) && (rP[k]!=NULL))
1968  {
1969  int j = 0;
1970  while ((j<(*syzstr->Tl)[k]) &&
1971  ((rP[k][j].lcm!=NULL) || (rP[k][j].syz!=NULL)))
1972  {
1973  if (rP[k][j].isNotMinimal==NULL)
1974  ((*resolution)[k+1])++;
1975  j++;
1976  }
1977  k++;
1978  }
1979  }
1980  else
1981  {
1982  resolution = new intvec(syzstr->length+2);
1983  resolvente rr;
1984  if (syzstr->minres!=NULL)
1985  rr = syzstr->minres;
1986  else
1987  rr = syzstr->fullres;
1988  (*resolution)[0]
1989  = si_max(1,(int)id_RankFreeModule(rr[0],
1990  (syzstr->syRing != NULL ? syzstr->syRing : currRing)));
1991  int k=0;
1992  while ((k<syzstr->length) && (rr[k]!=NULL))
1993  {
1994  (*resolution)[k+1] = idSize(rr[k]);
1995  k++;
1996  }
1997  }
1998  }
1999 
2000  int sl=strlen(sn);
2001  syPrintEmptySpaces1(sl);
2002  int k = 0;
2003  loop
2004  {
2005  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2006  break;
2007  Print("%d",(*resolution)[k]);
2008  syPrintEmptySpaces1(sl+5);
2009  k++;
2010  }
2011  PrintLn();
2012  k = 0;
2013  loop
2014  {
2015  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2016  break;
2017  PrintS(sn);
2018  if (((k+1)>=resolution->length()) || ((*resolution)[(k+1)]==0))
2019  break;
2020  PrintS(" <-- ");
2021  syPrintEmptySpaces((*resolution)[k]);
2022  k++;
2023  }
2024  PrintLn();
2025  PrintLn();
2026  k = 0;
2027  loop
2028  {
2029  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2030  break;
2031  Print("%d",k);
2032  syPrintEmptySpaces1(sl+5+syLengthInt((*resolution)[k])-
2033  syLengthInt(k));
2034  k++;
2035  }
2036  PrintLn();
2037  if (syzstr->minres==NULL)
2038  {
2039  PrintS("resolution not minimized yet");
2040  PrintLn();
2041  }
2042 
2043  if (syzstr->resolution == NULL) syzstr->resolution = resolution;
2044 }
int length
Definition: syz.h:60
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
loop
Definition: myNF.cc:98
resolvente res
Definition: syz.h:47
int length() const
Definition: intvec.h:86
int k
Definition: cfEzgcd.cc:93
intvec * Tl
Definition: syz.h:50
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
void PrintS(const char *s)
Definition: reporter.cc:294
static void syPrintEmptySpaces(int i)
Definition: syz1.cc:1905
static int syLengthInt(int i)
Definition: syz1.cc:1929
static void syPrintEmptySpaces1(int i)
Definition: syz1.cc:1917
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:10
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
SSet * SRes
Definition: syz.h:33
ideal * resolvente
Definition: ideals.h:20
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
intvec * resolution
Definition: syz.h:51
resolvente syReorder ( resolvente  res,
int  length,
syStrategy  syzstr,
BOOLEAN  toCopy = TRUE,
resolvente  totake = NULL 
)

Definition at line 1653 of file syz1.cc.

1655 {
1656  int i,j,l;
1657  poly p,q,tq;
1658  polyset ri1;
1659  resolvente fullres;
1660  ring origR=syzstr->syRing;
1661  fullres = (resolvente)omAlloc0((length+1)*sizeof(ideal));
1662  if (totake==NULL)
1663  totake = res;
1664  for (i=length-1;i>0;i--)
1665  {
1666  if (res[i]!=NULL)
1667  {
1668  if (i>1)
1669  {
1670  j = IDELEMS(res[i-1]);
1671  while ((j>0) && (res[i-1]->m[j-1]==NULL)) j--;
1672  fullres[i-1] = idInit(IDELEMS(res[i]),j);
1673  ri1 = totake[i-1]->m;
1674  for (j=IDELEMS(res[i])-1;j>=0;j--)
1675  {
1676  p = res[i]->m[j];
1677  q = NULL;
1678  while (p!=NULL)
1679  {
1680  if (toCopy)
1681  {
1682  if (origR!=NULL)
1683  tq = prHeadR(p,origR, currRing);
1684  else
1685  tq = pHead(p);
1686  pIter(p);
1687  }
1688  else
1689  {
1690  res[i]->m[j] = NULL;
1691  if (origR!=NULL)
1692  {
1693  poly pp=p;
1694  pIter(p);
1695  pNext(pp)=NULL;
1696  tq = prMoveR(pp, origR, currRing);
1697  }
1698  else
1699  {
1700  tq = p;
1701  pIter(p);
1702  pNext(tq) = NULL;
1703  }
1704  }
1705 // pWrite(tq);
1706  pTest(tq);
1707  for (l=(currRing->N);l>0;l--)
1708  {
1709  if (origR!=NULL)
1710  pSubExp(tq,l, p_GetExp(ri1[pGetComp(tq)-1],l,origR));
1711  else
1712  pSubExp(tq,l, pGetExp(ri1[pGetComp(tq)-1],l));
1713  }
1714  pSetm(tq);
1715  pTest(tq);
1716  q = pAdd(q,tq);
1717  pTest(q);
1718  }
1719  fullres[i-1]->m[j] = q;
1720  }
1721  }
1722  else
1723  {
1724  if (origR!=NULL)
1725  {
1726  fullres[i-1] = idInit(IDELEMS(res[i]),res[i]->rank);
1727  for (j=IDELEMS(res[i])-1;j>=0;j--)
1728  {
1729  if (toCopy)
1730  fullres[i-1]->m[j] = prCopyR(res[i]->m[j], origR, currRing);
1731  else
1732  {
1733  fullres[i-1]->m[j] = prMoveR(res[i]->m[j], origR, currRing);
1734  res[i]->m[j] = NULL;
1735  }
1736  }
1737  }
1738  else
1739  {
1740  if (toCopy)
1741  fullres[i-1] = idCopy(res[i]);
1742  else
1743  {
1744  fullres[i-1] = res[i];
1745  res[i] = NULL;
1746  }
1747  }
1748  for (j=IDELEMS(fullres[i-1])-1;j>=0;j--)
1749  fullres[i-1]->m[j] = pSortCompCorrect(fullres[i-1]->m[j]);
1750  }
1751  if (!toCopy)
1752  {
1753  if (res[i]!=NULL) idDelete(&res[i]);
1754  }
1755  }
1756  }
1757  if (!toCopy)
1758  omFreeSize((ADDRESS)res,(length+1)*sizeof(ideal));
1759  //syzstr->length = length;
1760  return fullres;
1761 }
poly prHeadR(poly p, ring src_r, ring dest_r, prCopyProc_t prproc)
Definition: prCopy.cc:127
#define pSetm(p)
Definition: polys.h:241
#define pAdd(p, q)
Definition: polys.h:174
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
return P p
Definition: myNF.cc:203
poly prMoveR(poly &p, ring src_r, ring dest_r)
Definition: prCopy.cc:91
#define pTest(p)
Definition: polys.h:387
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define pSubExp(p, i, v)
Definition: polys.h:46
void * ADDRESS
Definition: auxiliary.h:161
#define pGetComp(p)
Component.
Definition: polys.h:37
poly pp
Definition: myNF.cc:296
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
#define pSortCompCorrect(p)
Assume: If considerd only as poly in any component of p (say, monomials of other components of p are ...
Definition: polys.h:198
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:464
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
#define IDELEMS(i)
Definition: simpleideals.h:24
ideal idCopy(ideal A)
Definition: ideals.h:73
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
poly * polyset
Definition: hutil.h:15
ring syRing
Definition: syz.h:56
#define pNext(p)
Definition: monomials.h:43
ideal * resolvente
Definition: ideals.h:20
polyrec * poly
Definition: hilb.h:10
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
void syReOrderResolventFB ( resolvente  res,
int  length,
int  initial = 1 
)

Definition at line 746 of file syz0.cc.

747 {
748  int syzIndex=length-1,i,j;
749  poly p;
750 
751  while ((syzIndex!=0) && (res[syzIndex]==NULL)) syzIndex--;
752  while (syzIndex>=initial)
753  {
754  for(i=0;i<IDELEMS(res[syzIndex]);i++)
755  {
756  p = res[syzIndex]->m[i];
757 
758  while (p!=NULL)
759  {
760  if (res[syzIndex-1]->m[pGetComp(p)-1]!=NULL)
761  {
762  for(j=1;j<=(currRing->N);j++)
763  {
764  pSetExp(p,j,pGetExp(p,j)
765  -pGetExp(res[syzIndex-1]->m[pGetComp(p)-1],j));
766  }
767  }
768  else
769  PrintS("error in the resolvent\n");
770  pSetm(p);
771  pIter(p);
772  }
773  }
774  syzIndex--;
775  }
776 }
#define pSetm(p)
Definition: polys.h:241
#define pSetExp(p, i, v)
Definition: polys.h:42
return P p
Definition: myNF.cc:203
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
poly initial(const poly p, const ring r, const gfan::ZVector w)
Returns the initial form of p with respect to w.
Definition: initial.cc:32
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
long syReorderShiftedComponents ( long *  sc,
int  n 
)

Definition at line 339 of file syz1.cc.

340 {
341  long holes = 0;
342  int i;
343  long new_comps = 0, new_space, max;
344 
345  // count number of holes
346  for (i=1; i<n; i++)
347  {
348  if (sc[i-1] + 1 < sc[i]) holes++;
349  }
350 
351  if (LONG_MAX - SYZ_SHIFT_BASE <= sc[n-1])
352  {
353  // need new components
354  new_comps = (((long) 1) << SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE) - 1;
355  max = LONG_MAX;
356  }
357  else
358  {
359  max = sc[n-1] + SYZ_SHIFT_BASE;
360  }
361 
362  // no we arrange things such that
363  // (n - holes) + holes*new_space + new_comps*SYZ_SHIFT_BASE= LONG_MAX
364  new_space = (max - n + holes - new_comps*SYZ_SHIFT_BASE) / holes;
365 
366  assume(new_space < SYZ_SHIFT_BASE && new_space >= 4);
367 
368  long* tc = ( long*) omAlloc(n*sizeof(long));
369  tc[0] = sc[0];
370  // rearrange things
371  for (i=1; i<n; i++)
372  {
373  if (sc[i-1] + 1 < sc[i])
374  {
375  tc[i] = tc[i-1] + new_space;
376  }
377  else
378  {
379  tc[i] = tc[i-1] + 1;
380  }
381  assume(tc[i] > tc[i-1]);
382  }
383 
384  assume(LONG_MAX - SYZ_SHIFT_BASE > tc[n-1]);
385 #ifdef HAVE_ASSUME
386  for (i=1; i<n; i++)
387  {
388  assume(tc[i] >= 0);
389  assume(tc[i-1] + 1 <= tc[i]);
390  }
391 #endif
392 
393  omMemcpyW(sc, tc, n);
394  omFreeSize(tc, n*sizeof(long));
395  return new_space;
396 }
#define omMemcpyW(p1, p2, l)
Definition: omMemOps.h:29
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE
Definition: syz.h:15
#define omAlloc(size)
Definition: omAllocDecl.h:210
static int max(int a, int b)
Definition: fast_mult.cc:264
#define assume(x)
Definition: mod2.h:405
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int i
Definition: cfEzgcd.cc:123
void syResetShiftedComponents ( syStrategy  syzstr,
int  index,
int  hilb = 0 
)

Definition at line 414 of file syz1.cc.

415 {
416  assume(index > 0);
417  int i;
418  if (syzstr->res[index] != NULL)
419  {
420  long * prev_s;
421  int* prev_c;
422  int p_length;
423  rGetSComps(&prev_c, &prev_s, &p_length, currRing);
424  currcomponents = syzstr->truecomponents[index-1];
428  IDELEMS(syzstr->res[index-1]), currRing);
429  if (hilb==0)
430  {
431  ideal id = syzstr->res[index];
432  for (i=0; i<IDELEMS(id); i++)
433  {
434  pResetSetm(id->m[i]);
435  }
436  }
437  else if (hilb==1)
438  {
439  assume (index>1);
440  assume (syzstr->resPairs[index-1]!=NULL);
441  SSet Pairs=syzstr->resPairs[index-1];
442  SSet Pairs1=syzstr->resPairs[index];
443  int till=(*syzstr->Tl)[index-1];
444  for (i=0;i<till;i++)
445  {
446  if (Pairs[i].syz!=NULL)
447  pResetSetm(Pairs[i].syz);
448  }
449  till=(*syzstr->Tl)[index];
450  for (i=0;i<till;i++)
451  {
452  if (Pairs1[i].p!=NULL)
453  pResetSetm(Pairs1[i].p);
454  }
455  }
456  currcomponents = prev_c;
457  currShiftedComponents = prev_s;
458  rChangeSComps(prev_c, prev_s, p_length, currRing);
459  }
460 }
return P p
Definition: myNF.cc:203
int * currcomponents
Definition: syz1.cc:39
resolvente res
Definition: syz.h:47
intvec * Tl
Definition: syz.h:50
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void rGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
Definition: ring.cc:4365
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
static void pResetSetm(poly p)
Definition: syz1.cc:399
long * currShiftedComponents
Definition: syz1.cc:40
SObject * SSet
Definition: syz.h:32
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4356
syStrategy syResolution ( ideal  arg,
int  maxlength,
intvec w,
BOOLEAN  minim 
)

Definition at line 623 of file syz.cc.

624 {
625 
626 #ifdef HAVE_PLURAL
627 
628  const ideal idSaveCurrRingQuotient = currRing->qideal;
629 
630  if( rIsSCA(currRing) )
631  {
632 
633 #ifdef RDEBUG
634 // rWrite(currRing);
635 // rDebugPrint(currRing);
636 #endif
637 
639  {
640  currRing->qideal = SCAQuotient(currRing);
641  }
642 
643  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
644  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
645 
646  arg = id_KillSquares(arg, m_iFirstAltVar, m_iLastAltVar, currRing, false); // kill suares in input!
647  }
648 #endif
649 
651 
652  if ((w!=NULL) && (!idTestHomModule(arg,currRing->qideal,w))) // is this right in SCA case???
653  {
654  WarnS("wrong weights given(2):");w->show();PrintLn();
655  idHomModule(arg,currRing->qideal,&w);
656  w->show();PrintLn();
657  w=NULL;
658  }
659  if (w!=NULL)
660  {
661  result->weights = (intvec**)omAlloc0Bin(char_ptr_bin);
662  (result->weights)[0] = ivCopy(w);
663  result->length = 1;
664  }
665  resolvente fr = syResolvente(arg,maxlength,&(result->length),&(result->weights),minim),fr1;
666  if (minim)
667  {
668  result->minres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
669  fr1 = result->minres;
670  }
671  else
672  {
673  result->fullres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
674  fr1 = result->fullres;
675  }
676  for (int i=result->length-1;i>=0;i--)
677  {
678  if (fr[i]!=NULL)
679  fr1[i] = fr[i];
680  fr[i] = NULL;
681  }
682  omFreeSize((ADDRESS)fr,(result->length)*sizeof(ideal));
683 
684 
685 #ifdef HAVE_PLURAL
686  if( rIsSCA(currRing) )
687  {
688 
690  {
691  currRing->qideal = idSaveCurrRingQuotient;
692  }
693 
695  }
696 #endif
697 
698 
699  return result;
700 }
int length
Definition: syz.h:60
intvec ** weights
Definition: syz.h:45
ideal SCAQuotient(const ring r)
Definition: sca.h:10
resolvente syResolvente(ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
Definition: syz.cc:394
void PrintLn()
Definition: reporter.cc:327
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1881
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
void * ADDRESS
Definition: auxiliary.h:161
#define WarnS
Definition: emacs.cc:81
omBin char_ptr_bin
Definition: ring.cc:55
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:14
bool ncExtensions(int iMask)
Definition: old.gring.cc:100
int i
Definition: cfEzgcd.cc:123
static short scaFirstAltVar(ring r)
Definition: sca.h:18
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
const int TESTSYZSCAMASK
Definition: nc.h:373
#define NULL
Definition: omList.c:10
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
Definition: sca.cc:1534
static short scaLastAltVar(ring r)
Definition: sca.h:25
static bool rIsSCA(const ring r)
Definition: nc.h:206
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
ideal * resolvente
Definition: ideals.h:20
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
#define omAlloc0(size)
Definition: omAllocDecl.h:211
return result
Definition: facAbsBiFact.cc:76
ssyStrategy * syStrategy
Definition: syz.h:35
resolvente syResolvente ( ideal  arg,
int  maxlength,
int *  length,
intvec ***  weights,
BOOLEAN  minim 
)

Definition at line 394 of file syz.cc.

396 {
397  BITSET save1;
398  SI_SAVE_OPT1(save1);
399  resolvente res;
400  resolvente newres;
401  tHomog hom=isNotHomog;
402  ideal temp=NULL;
403  intvec *w = NULL,**tempW;
404  int i,k,syzIndex = 0,j,rk_arg=si_max(1,(int)id_RankFreeModule(arg,currRing));
405  int Kstd1_OldDeg=Kstd1_deg;
406  BOOLEAN completeMinim;
407  BOOLEAN oldDegBound=TEST_OPT_DEGBOUND;
408  BOOLEAN setRegularity=TRUE;
409  int wlength=*length;
410 
411  if (maxlength!=-1) *length = maxlength+1;
412  else *length = 5;
413  if ((wlength!=0) && (*length!=wlength))
414  {
415  intvec **wtmp = (intvec**)omAlloc0((*length)*sizeof(intvec*));
416  wtmp[0]=(*weights)[0];
417  omFreeSize((ADDRESS)*weights,wlength*sizeof(intvec*));
418  *weights=wtmp;
419  }
420  res = (resolvente)omAlloc0((*length)*sizeof(ideal));
421 
422 /*--- initialize the syzygy-ring -----------------------------*/
423  ring origR = currRing;
424  ring syz_ring = rAssure_SyzComp(origR, TRUE); // will do rChangeCurrRing if needed
425  rSetSyzComp(rk_arg, syz_ring);
426 
427  if (syz_ring != origR)
428  {
429  rChangeCurrRing(syz_ring);
430  res[0] = idrCopyR_NoSort(arg, origR, syz_ring);
431  }
432  else
433  {
434  res[0] = idCopy(arg);
435  }
436 
437 /*--- creating weights for the module components ---------------*/
438  if ((weights!=NULL) && (*weights!=NULL)&& ((*weights)[0]!=NULL))
439  {
440  if (!idTestHomModule(res[0],currRing->qideal,(*weights)[0]))
441  {
442  WarnS("wrong weights given(1):"); (*weights)[0]->show();PrintLn();
443  idHomModule(res[0],currRing->qideal,&w);
444  w->show();PrintLn();
445  *weights=NULL;
446  }
447  }
448 
449  if ((weights==NULL) || (*weights==NULL) || ((*weights)[0]==NULL))
450  {
451  hom=(tHomog)idHomModule(res[0],currRing->qideal,&w);
452  if (hom==isHomog)
453  {
454  *weights = (intvec**)omAlloc0((*length)*sizeof(intvec*));
455  if (w!=NULL) (*weights)[0] = ivCopy(w);
456  }
457  }
458  else
459  {
460  if ((weights!=NULL) && (*weights!=NULL)&& ((*weights)[0]!=NULL))
461  {
462  w = ivCopy((*weights)[0]);
463  hom = isHomog;
464  }
465  }
466 
467 #ifdef HAVE_PLURAL
469  {
470 // quick solution; need theory to apply homog GB stuff for G-Algebras
471  hom = isNotHomog;
472  }
473 #endif // HAVE_PLURAL
474 
475  if (hom==isHomog)
476  {
477  intvec *w1 = syPrepareModComp(res[0],&w);
478  if (w!=NULL) { delete w;w=NULL; }
479  w = w1;
480  j = 0;
481  while ((j<IDELEMS(res[0])) && (res[0]->m[j]==NULL)) j++;
482  if (j<IDELEMS(res[0]))
483  {
484  if (p_FDeg(res[0]->m[j],currRing)!=pTotaldegree(res[0]->m[j]))
485  setRegularity = FALSE;
486  }
487  }
488  else
489  {
490  setRegularity = FALSE;
491  }
492 
493 /*--- the main loop --------------------------------------*/
494  while ((res[syzIndex]!=NULL) && (!idIs0(res[syzIndex])) &&
495  ((maxlength==-1) || (syzIndex<=maxlength)))
496  // (syzIndex<maxlength+(int)minim)))
497 /*--- compute one step more for minimizing-----------------*/
498  {
499  if (Kstd1_deg!=0) Kstd1_deg++;
500  if (syzIndex+1==*length)
501  {
502  newres = (resolvente)omAlloc0((*length+5)*sizeof(ideal));
503  tempW = (intvec**)omAlloc0((*length+5)*sizeof(intvec*));
504  for (j=0;j<*length;j++)
505  {
506  newres[j] = res[j];
507  if (*weights!=NULL) tempW[j] = (*weights)[j];
508  /*else tempW[j] = NULL;*/
509  }
510  omFreeSize((ADDRESS)res,*length*sizeof(ideal));
511  if (*weights != NULL) omFreeSize((ADDRESS)*weights,*length*sizeof(intvec*));
512  *length += 5;
513  res=newres;
514  *weights = tempW;
515  }
516 /*--- interreducing first -----------------------------------*/
517  if (syzIndex>0)
518  {
519  int rkI=id_RankFreeModule(res[syzIndex],currRing);
520  rSetSyzComp(rkI, currRing);
521  }
522  if(! TEST_OPT_NO_SYZ_MINIM )
523  if (minim || (syzIndex!=0))
524  {
525  temp = kInterRedOld(res[syzIndex],currRing->qideal);
526  idDelete(&res[syzIndex]);
527  idSkipZeroes(temp);
528  res[syzIndex] = temp;
529  }
530  temp = NULL;
531 /*--- computing the syzygy modules --------------------------------*/
532  if ((currRing->qideal==NULL)&&(syzIndex==0)&& (!TEST_OPT_DEGBOUND))
533  {
534  res[/*syzIndex+*/1] = idSyzygies(res[0/*syzIndex*/],hom,&w,FALSE,setRegularity,&Kstd1_deg);
535  if ((!TEST_OPT_NOTREGULARITY) && (Kstd1_deg>0)
536  #ifdef HAVE_RINGS
537  && (!rField_is_Ring(currRing))
538  #endif
540  }
541  else
542  {
543  res[syzIndex+1] = idSyzygies(res[syzIndex],hom,&w,FALSE);
544  }
545  completeMinim=(syzIndex!=maxlength) || (maxlength ==-1) || (hom!=isHomog);
546  syzIndex++;
547  if (TEST_OPT_PROT) Print("[%d]\n",syzIndex);
548 
549  if(! TEST_OPT_NO_SYZ_MINIM )
550  {
551  if ((minim)||(syzIndex>1))
552  syMinStep(res[syzIndex-1],res[syzIndex],!completeMinim,NULL,hom);
553  if (!completeMinim)
554  /*minim is TRUE, we are in the module: maxlength, maxlength <>0*/
555  {
556  idDelete(&res[syzIndex]);
557  }
558  }
559 /*---creating the iterated weights for module components ---------*/
560  if ((hom == isHomog) && (res[syzIndex]!=NULL) && (!idIs0(res[syzIndex])))
561  {
562 //Print("die %d Modulegewichte sind:\n",w1->length());
563 //w1->show();
564 //PrintLn();
565  int max_comp = id_RankFreeModule(res[syzIndex],currRing);
566  k = max_comp - rGetCurrSyzLimit(currRing);
567  assume(w != NULL);
568  if (w != NULL)
569  w->resize(max_comp+IDELEMS(res[syzIndex]));
570  else
571  w = new intvec(max_comp+IDELEMS(res[syzIndex]));
572  (*weights)[syzIndex] = new intvec(k);
573  for (i=0;i<k;i++)
574  {
575  if (res[syzIndex-1]->m[i]!=NULL) // hs
576  {
577  (*w)[i + rGetCurrSyzLimit(currRing)] = p_FDeg(res[syzIndex-1]->m[i],currRing);
578  if (pGetComp(res[syzIndex-1]->m[i])>0)
579  (*w)[i + rGetCurrSyzLimit(currRing)]
580  += (*w)[pGetComp(res[syzIndex-1]->m[i])-1];
581  (*((*weights)[syzIndex]))[i] = (*w)[i+rGetCurrSyzLimit(currRing)];
582  }
583  }
584  for (i=k;i<k+IDELEMS(res[syzIndex]);i++)
585  {
586  if (res[syzIndex]->m[i-k]!=NULL)
587  (*w)[i+rGetCurrSyzLimit(currRing)] = p_FDeg(res[syzIndex]->m[i-k],currRing)
588  +(*w)[pGetComp(res[syzIndex]->m[i-k])-1];
589  }
590  }
591  }
592 /*--- end of the main loop --------------------------------------*/
593 /*--- deleting the temporare data structures --------------------*/
594  if ((syzIndex!=0) && (res[syzIndex]!=NULL) && (idIs0(res[syzIndex])))
595  idDelete(&res[syzIndex]);
596  if (w !=NULL) delete w;
597 
598  Kstd1_deg=Kstd1_OldDeg;
599  if (!oldDegBound)
601 
602  for (i=1; i<=syzIndex; i++)
603  {
604  if ((res[i]!=NULL) && ! idIs0(res[i]))
605  {
607  }
608  }
609 /*--- going back to the original ring -------------------------*/
610  if (origR != syz_ring)
611  {
612  rChangeCurrRing(origR); // should not be needed now?
613  for (i=0; i<=syzIndex; i++)
614  {
615  res[i] = idrMoveR_NoSort(res[i], syz_ring, origR);
616  }
617  rDelete(syz_ring);
618  }
619  SI_RESTORE_OPT1(save1);
620  return res;
621 }
#define TEST_OPT_NOTREGULARITY
Definition: options.h:114
unsigned si_opt_1
Definition: options.c:5
void resize(int new_length)
Definition: intvec.cc:107
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:140
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1881
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:714
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:144
void * ADDRESS
Definition: auxiliary.h:161
#define SI_SAVE_OPT1(A)
Definition: options.h:20
int k
Definition: cfEzgcd.cc:93
#define WarnS
Definition: emacs.cc:81
#define BITSET
Definition: structs.h:17
#define Sy_bit(x)
Definition: options.h:30
#define pGetComp(p)
Component.
Definition: polys.h:37
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void id_Shift(ideal M, int s, const ring r)
Definition: intvec.h:14
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define TEST_OPT_NO_SYZ_MINIM
Definition: options.h:118
tHomog
Definition: structs.h:37
int j
Definition: myNF.cc:70
static long pTotaldegree(poly p)
Definition: polys.h:253
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
int rGetMaxSyzComp(int i, const ring r)
return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit
Definition: ring.cc:5059
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition: ring.cc:4386
static long p_FDeg(const poly p, const ring r)
Definition: p_polys.h:375
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:166
int i
Definition: cfEzgcd.cc:123
ideal kInterRedOld(ideal F, ideal Q)
Definition: kstd1.cc:2932
#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:73
void rSetSyzComp(int k, const ring r)
Definition: ring.cc:4991
void rChangeCurrRing(ring r)
Definition: polys.cc:14
static void syMinStep(ideal mod, ideal syz, BOOLEAN final=FALSE, ideal up=NULL, tHomog h=isNotHomog)
Definition: syz.cc:87
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:434
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
const CanonicalForm & w
Definition: facAbsFact.cc:55
static bool rIsSCA(const ring r)
Definition: nc.h:206
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
ideal * resolvente
Definition: ideals.h:20
#define OPT_DEGBOUND
Definition: options.h:85
int Kstd1_deg
Definition: kutil.cc:228
int BOOLEAN
Definition: auxiliary.h:131
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
Definition: ideals.cc:557
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define SI_RESTORE_OPT1(A)
Definition: options.h:23
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:206
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
static intvec * syPrepareModComp(ideal arg, intvec **w)
Definition: syz.cc:30
#define omAlloc0(size)
Definition: omAllocDecl.h:211
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
Definition: prCopy.cc:262
syStrategy sySchreyer ( ideal  arg,
int  maxlength 
)

Definition at line 1024 of file syz0.cc.

1025 {
1026  int rl;
1027  resolvente fr = sySchreyerResolvente(arg,maxlength,&(rl));
1028  if (fr==NULL) return NULL;
1029 
1030  // int typ0;
1032  result->length=rl;
1033  result->fullres = (resolvente)omAlloc0((rl /*result->length*/+1)*sizeof(ideal));
1034  for (int i=rl /*result->length*/-1;i>=0;i--)
1035  {
1036  if (fr[i]!=NULL)
1037  result->fullres[i] = fr[i];
1038  fr[i] = NULL;
1039  }
1040  if (currRing->qideal!=NULL)
1041  {
1042  for (int i=0; i<rl; i++)
1043  {
1044  if (result->fullres[i]!=NULL)
1045  {
1046  ideal t=kNF(currRing->qideal,NULL,result->fullres[i]);
1047  idDelete(&result->fullres[i]);
1048  result->fullres[i]=t;
1049  if (i<rl-1)
1050  {
1051  for(int j=IDELEMS(t)-1;j>=0; j--)
1052  {
1053  if ((t->m[j]==NULL) && (result->fullres[i+1]!=NULL))
1054  {
1055  for(int k=IDELEMS(result->fullres[i+1])-1;k>=0; k--)
1056  {
1057  if (result->fullres[i+1]->m[k]!=NULL)
1058  {
1059  pDeleteComp(&(result->fullres[i+1]->m[k]),j+1);
1060  }
1061  }
1062  }
1063  }
1064  }
1065  idSkipZeroes(result->fullres[i]);
1066  }
1067  }
1068  if ((rl>maxlength) && (result->fullres[rl-1]!=NULL))
1069  {
1070  idDelete(&result->fullres[rl-1]);
1071  }
1072  }
1073  omFreeSize((ADDRESS)fr,(rl /*result->length*/)*sizeof(ideal));
1074  return result;
1075 }
int length
Definition: syz.h:60
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial, BOOLEAN)
Definition: syz0.cc:861
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2819
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:161
int k
Definition: cfEzgcd.cc:93
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
resolvente fullres
Definition: syz.h:57
#define NULL
Definition: omList.c:10
ideal * resolvente
Definition: ideals.h:20
#define pDeleteComp(p, k)
Definition: polys.h:332
#define omAlloc0(size)
Definition: omAllocDecl.h:211
return result
Definition: facAbsBiFact.cc:76
ssyStrategy * syStrategy
Definition: syz.h:35
resolvente sySchreyerResolvente ( ideal  arg,
int  maxlength,
int *  length,
BOOLEAN  isMonomial = FALSE,
BOOLEAN  notReplace = FALSE 
)

Definition at line 861 of file syz0.cc.

863 {
864  ideal mW=NULL;
865  int i,syzIndex = 0,j=0;
866  intvec * modcomp=NULL,*w=NULL;
867  // int ** wv=NULL;
868  tHomog hom=(tHomog)idHomModule(arg,NULL,&w);
869  ring origR = currRing;
870  ring syRing = NULL;
871 
872  if ((!isMonomial) && syTestOrder(arg))
873  {
874  WerrorS("sres only implemented for modules with ordering ..,c or ..,C");
875  return NULL;
876  }
877  *length = 4;
878  resolvente res = (resolvente)omAlloc0(4*sizeof(ideal)),newres;
879  res[0] = idCopy(arg);
880 
881  while ((!idIs0(res[syzIndex])) && ((maxlength==-1) || (syzIndex<maxlength)))
882  {
883  i = IDELEMS(res[syzIndex]);
884  //while ((i!=0) && (!res[syzIndex]->m[i-1])) i--;
885  if (syzIndex+1==*length)
886  {
887  newres = (resolvente)omAlloc0((*length+4)*sizeof(ideal));
888  // for (j=0;j<*length+4;j++) newres[j] = NULL;
889  for (j=0;j<*length;j++) newres[j] = res[j];
890  omFreeSize((ADDRESS)res,*length*sizeof(ideal));
891  *length += 4;
892  res=newres;
893  }
894 
895  if ((hom==isHomog)|| (rHasGlobalOrdering(origR)))
896  {
897  if (syzIndex==0) syInitSort(res[0],&modcomp);
898 
899  if ((syzIndex==0) && !rRing_has_CompLastBlock(currRing))
900  res[syzIndex+1] = sySchreyersSyzygiesFB(res[syzIndex],&modcomp,mW,FALSE);
901  else
902  res[syzIndex+1] = sySchreyersSyzygiesFB(res[syzIndex],&modcomp,mW);
903 
904  if (errorreported)
905  {
906  for (j=0;j<*length;j++) idDelete( &res[j] );
907  omFreeSize((ADDRESS)res,*length*sizeof(ideal));
908  return NULL;
909  }
910 
911  mW = res[syzIndex];
912  }
913 //idPrint(res[syzIndex+1]);
914 
915  if ( /*(*/ syzIndex==0 /*)*/ )
916  {
917  if ((hom==isHomog)|| (rHasGlobalOrdering(origR)))
918  {
919  syRing = rAssure_CompLastBlock(origR, TRUE);
920  if (syRing != origR)
921  {
922  rChangeCurrRing(syRing);
923  for (i=0; i<IDELEMS(res[1]); i++)
924  {
925  res[1]->m[i] = prMoveR( res[1]->m[i], origR, syRing);
926  }
927  }
928  idTest(res[1]);
929  }
930  else
931  {
932  syRing = rAssure_SyzComp_CompLastBlock(origR, TRUE);
933  if (syRing != origR)
934  {
935  rChangeCurrRing(syRing);
936  for (i=0; i<IDELEMS(res[0]); i++)
937  {
938  res[0]->m[i] = prMoveR( res[0]->m[i], origR, syRing);
939  }
940  }
941  idTest(res[0]);
942  }
943  }
944  if ((hom!=isHomog) && (rHasLocalOrMixedOrdering(origR)))
945  {
946  if (syzIndex==0) syInitSort(res[0],&modcomp);
947  res[syzIndex+1] = sySchreyersSyzygiesFM(res[syzIndex],&modcomp);
948  if (errorreported)
949  {
950  for (j=0;j<*length;j++) idDelete( &res[j] );
951  omFreeSize((ADDRESS)res,*length*sizeof(ideal));
952  return NULL;
953  }
954  }
955  syzIndex++;
956  if (TEST_OPT_PROT) Print("[%d]\n",syzIndex);
957  }
958  //syPrintResolution(res,1,*length);
959  if ((hom!=isHomog) && (rHasLocalOrMixedOrdering(origR)))
960  {
961  syzIndex = 1;
962  while ((syzIndex < *length) && (!idIs0(res[syzIndex])))
963  {
964  id_Shift(res[syzIndex],-rGetMaxSyzComp(syzIndex, currRing),currRing);
965  syzIndex++;
966  }
967  }
968  if ((hom==isHomog) || (rHasGlobalOrdering(origR)))
969  syzIndex = 1;
970  else
971  syzIndex = 0;
972  syReOrderResolventFB(res,*length,syzIndex+1);
973  if (/*ringOrderChanged:*/ origR!=syRing && syRing != NULL)
974  {
975  rChangeCurrRing(origR);
976  // Thomas: Here I assume that all (!) polys of res live in tmpR
977  while ((syzIndex < *length) && (res[syzIndex]))
978  {
979  for (i=0;i<IDELEMS(res[syzIndex]);i++)
980  {
981  if (res[syzIndex]->m[i])
982  {
983  res[syzIndex]->m[i] = prMoveR( res[syzIndex]->m[i], syRing, origR);
984  }
985  }
986  syzIndex++;
987  }
988 // j = 0; while (currRing->order[j]!=0) j++; // What was this for???!
989  rDelete(syRing);
990  }
991  else
992  {
993  // Thomas -- are you sure that you have to "reorder" here?
994  while ((syzIndex < *length) && (res[syzIndex]))
995  {
996  for (i=0;i<IDELEMS(res[syzIndex]);i++)
997  {
998  if (res[syzIndex]->m[i])
999  res[syzIndex]->m[i] = pSortCompCorrect(res[syzIndex]->m[i]);
1000  }
1001  syzIndex++;
1002  }
1003  }
1004  if ((hom==isHomog) || (rHasGlobalOrdering(origR)))
1005  {
1006  if (res[1]!=NULL)
1007  {
1008  syReOrderResolventFB(res,2,1);
1009  for (i=0;i<IDELEMS(res[1]);i++)
1010  {
1011  if (res[1]->m[i])
1012  res[1]->m[i] = pSort(res[1]->m[i]);
1013  }
1014  }
1015  }
1016  //syPrintResolution(res,0,*length);
1017 
1018  //syMergeSortResolventFB(res,*length);
1019  if (modcomp!=NULL) delete modcomp;
1020  if (w!=NULL) delete w;
1021  return res;
1022 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
void syReOrderResolventFB(resolvente res, int length, int initial)
Definition: syz0.cc:746
#define Print
Definition: emacs.cc:83
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:140
poly prMoveR(poly &p, ring src_r, ring dest_r)
Definition: prCopy.cc:91
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define pSort(p)
Definition: polys.h:189
#define TRUE
Definition: auxiliary.h:144
void * ADDRESS
Definition: auxiliary.h:161
void WerrorS(const char *s)
Definition: feFopen.cc:24
static ideal sySchreyersSyzygiesFM(ideal arg, intvec **modcomp)
Definition: syz0.cc:168
ring rAssure_SyzComp_CompLastBlock(const ring r, BOOLEAN)
makes sure that c/C ordering is last ordering and SyzIndex is first
Definition: ring.cc:4669
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void id_Shift(ideal M, int s, const ring r)
#define pSortCompCorrect(p)
Assume: If considerd only as poly in any component of p (say, monomials of other components of p are ...
Definition: polys.h:198
Definition: intvec.h:14
tHomog
Definition: structs.h:37
int j
Definition: myNF.cc:70
int rGetMaxSyzComp(int i, const ring r)
return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit
Definition: ring.cc:5059
static void syInitSort(ideal arg, intvec **modcomp)
Definition: syz0.cc:29
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
ring rAssure_CompLastBlock(ring r, BOOLEAN complete)
makes sure that c/C ordering is last ordering
Definition: ring.cc:4614
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN syTestOrder(ideal M)
Definition: syz0.cc:835
ideal idCopy(ideal A)
Definition: ideals.h:73
short errorreported
Definition: feFopen.cc:23
void rChangeCurrRing(ring r)
Definition: polys.cc:14
#define NULL
Definition: omList.c:10
BOOLEAN rHasGlobalOrdering(const ring r)
Definition: ring.h:749
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
const CanonicalForm & w
Definition: facAbsFact.cc:55
ideal * resolvente
Definition: ideals.h:20
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN rRing_has_CompLastBlock(ring r)
Definition: ring.cc:5105
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:108
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:60
static ideal sySchreyersSyzygiesFB(ideal arg, intvec **modcomp, ideal mW, BOOLEAN redTail=TRUE)
Definition: syz0.cc:505
void sySchreyersSyzygiesB ( polyset  F,
int  Fmax,
polyset Shdl,
int *  Smax,
BOOLEAN  noSort 
)
void sySchreyersSyzygiesM ( polyset  F,
int  Fmax,
polyset Shdl,
int *  Smax,
BOOLEAN  noSort 
)
int sySize ( syStrategy  syzstr)

Definition at line 1840 of file syz1.cc.

1841 {
1842  resolvente r=syzstr->res;
1843  if (r==NULL)
1844  r = syzstr->fullres;
1845  if (r==NULL)
1846  r = syzstr->minres;
1847  if (r==NULL)
1848  {
1849  WerrorS("No resolution found");
1850  return 0;
1851  }
1852  int i=syzstr->length;
1853  while ((i>0) && (r[i-1]==NULL)) i--;
1854  return i;
1855 }
int length
Definition: syz.h:60
resolvente res
Definition: syz.h:47
void WerrorS(const char *s)
Definition: feFopen.cc:24
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:10
ideal * resolvente
Definition: ideals.h:20
BOOLEAN syTestOrder ( ideal  i)

Definition at line 835 of file syz0.cc.

836 {
838  if (i == 0) return FALSE;
839  int j=0;
840 
841  while ((currRing->order[j]!=ringorder_c) && (currRing->order[j]!=ringorder_C))
842  j++;
843  if (currRing->order[j+1]!=0)
844  return TRUE;
845  return FALSE;
846 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
#define M
Definition: sirandom.c:24
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123

Variable Documentation

int* currcomponents

Definition at line 39 of file syz1.cc.

long* currShiftedComponents

Definition at line 40 of file syz1.cc.