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

§ sSObject

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

§ ssyStrategy

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

§ SYZ_SHIFT_BASE

#define SYZ_SHIFT_BASE   (1L << SYZ_SHIFT_BASE_LOG)

Definition at line 18 of file syz.h.

§ SYZ_SHIFT_BASE_LOG

#define SYZ_SHIFT_BASE_LOG   (BIT_SIZEOF_LONG - 1 - SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE)

Definition at line 17 of file syz.h.

§ SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE

#define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE   8

Definition at line 15 of file syz.h.

Typedef Documentation

§ SRes

typedef SSet* SRes

Definition at line 33 of file syz.h.

§ SSet

typedef SObject* SSet

Definition at line 32 of file syz.h.

§ syStrategy

Definition at line 35 of file syz.h.

Function Documentation

§ syBetti()

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

Definition at line 791 of file syz.cc.

793 {
794 //#define BETTI_WITH_ZEROS
795  //tomin = FALSE;
796  int i,j=0,k=0,l,rows,cols,mr;
797  int *temp1,*temp2,*temp3;/*used to compute degrees*/
798  int *tocancel; /*(BOOLEAN)tocancel[i]=element is superfluous*/
799  int r0_len;
800 
801  /*------ compute size --------------*/
802  *regularity = -1;
803  cols = length;
804  while ((cols>0)
805  && ((res[cols-1]==NULL)
806  || (idIs0(res[cols-1]))))
807  {
808  cols--;
809  }
810  intvec * result;
811  if (idIs0(res[0]))
812  {
813  if (res[0]==NULL)
814  result = new intvec(1,1,1);
815  else
816  result = new intvec(1,1,res[0]->rank);
817  return result;
818  }
819  intvec *w=NULL;
820  if (weights!=NULL)
821  {
822  if (!idTestHomModule(res[0],currRing->qideal,weights))
823  {
824  WarnS("wrong weights given(3):");weights->show();PrintLn();
825  idHomModule(res[0],currRing->qideal,&w);
826  if (w!=NULL) { w->show();PrintLn();}
827  weights=NULL;
828  }
829  }
830 #if 0
831  if (idHomModule(res[0],currRing->qideal,&w)!=isHomog)
832  {
833  Warn("betti-command: Input is not homogeneous!");
834  weights=NULL;
835  }
836 #endif
837  if (weights==NULL) weights=w;
838  else delete w;
839  r0_len=IDELEMS(res[0]);
840  while ((r0_len>0) && (res[0]->m[r0_len-1]==NULL)) r0_len--;
841  #ifdef SHOW_W
842  PrintS("weights:");if (weights!=NULL) weights->show(); else Print("NULL"); PrintLn();
843  #endif
844  int rkl=l = si_max(id_RankFreeModule(res[0],currRing),res[0]->rank);
845  i = 0;
846  while ((i<length) && (res[i]!=NULL))
847  {
848  if (IDELEMS(res[i])>l) l = IDELEMS(res[i]);
849  i++;
850  }
851  temp1 = (int*)omAlloc0((l+1)*sizeof(int));
852  temp2 = (int*)omAlloc((l+1)*sizeof(int));
853  rows = 1;
854  mr = 1;
855  cols++;
856  for (i=0;i<cols-1;i++)
857  {
858  if ((i==0) && (weights!=NULL)) p_SetModDeg(weights, currRing);
859  memset(temp2,0,(l+1)*sizeof(int));
860  for (j=0;j<IDELEMS(res[i]);j++)
861  {
862  if (res[i]->m[j]!=NULL)
863  {
864  if ((pGetComp(res[i]->m[j])>l)
865  // usual resolutions do not the following, but artifulal built may: (tr. #763)
866  //|| ((i>1) && (res[i-1]->m[pGetComp(res[i]->m[j])-1]==NULL))
867  )
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:3532
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
int rows() const
Definition: intvec.h:88
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define TRUE
Definition: auxiliary.h:99
void * ADDRESS
Definition: auxiliary.h:116
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:10
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:121
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
const CanonicalForm & w
Definition: facAbsFact.cc:55
int cols() const
Definition: intvec.h:87
int syDetect(ideal id, int index, BOOLEAN homog, int *degrees, int *tocancel)
Definition: syz.cc:722
#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:96
#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

§ syBettiOfComputation()

intvec* syBettiOfComputation ( syStrategy  syzstr,
BOOLEAN  minim = TRUE,
int *  row_shift = NULL,
intvec weights = NULL 
)

Don't change the syzstr???

Definition at line 1757 of file syz1.cc.

1759 {
1760  int dummy;
1761  BOOLEAN std_weights=TRUE;
1762  if ((weights!=NULL)
1763  && (syzstr->betti!=NULL)
1764  && (syzstr->weights!=NULL) && (syzstr->weights[0]!=NULL))
1765  {
1766  int i;
1767  for(i=weights->length()-1; i>=0; i--)
1768  {
1769  //Print("test %d: %d - %d\n",i,(*weights)[i], (*(syzstr->weights[0]))[i]);
1770  if ((*weights)[i]!=(*(syzstr->weights[0]))[i])
1771  {
1772  std_weights=FALSE;
1773  break;
1774  }
1775  }
1776  }
1777  if ((syzstr->betti!=NULL)
1778  && (std_weights))
1779  {
1780  if (minim || (syzstr->resPairs!=NULL))
1781  return ivCopy(syzstr->betti);
1782  }
1783 
1784  resolvente fullres = syzstr->fullres;
1785  resolvente minres = syzstr->minres;
1786  const int length = syzstr->length;
1787 
1788  if ((fullres==NULL) && (minres==NULL))
1789  {
1790  if (syzstr->hilb_coeffs==NULL)
1791  { // LA SCALA
1792  fullres = syReorder(syzstr->res, length, syzstr);
1793  }
1794  else
1795  { // HRES
1796  minres = syReorder(syzstr->orderedRes, length, syzstr);
1797  syKillEmptyEntres(minres, length);
1798  }
1799  }
1800 
1801  intvec *result=NULL;
1802 
1803  if (fullres!=NULL)
1804  result = syBetti(fullres,length,&dummy,weights,minim,row_shift);
1805  else
1806  result = syBetti(minres,length,&dummy,weights,minim,row_shift);
1807 
1808 
1809  return result; /// Don't change the syzstr???
1810 
1811  // TODO: cleanup thses!
1812  if( fullres != NULL && syzstr->fullres == NULL )
1813  syzstr->fullres = fullres;
1814  if( minres != NULL && syzstr->minres == NULL )
1815  syzstr->minres = minres;
1816 
1817  if ((result!=NULL)
1818  && ((minim) || (syzstr->resPairs!=NULL))
1819  && std_weights
1820  && (syzstr->betti==NULL))
1821  {
1822  syzstr->betti = ivCopy(result); // cache the result...
1823  }
1824 
1825  return result;
1826 }
int length
Definition: syz.h:60
intvec ** weights
Definition: syz.h:45
void syKillEmptyEntres(resolvente res, int length)
Definition: syz1.cc:2199
#define FALSE
Definition: auxiliary.h:95
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:1643
resolvente res
Definition: syz.h:47
#define TRUE
Definition: auxiliary.h:99
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
int length() const
Definition: intvec.h:86
ideal * resolvente
Definition: ideals.h:18
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition: syz.cc:791
int BOOLEAN
Definition: auxiliary.h:86
return result
Definition: facAbsBiFact.cc:76

§ syChosePairs()

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

§ syCompactify1()

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

§ syCompactifyPairSet()

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

§ syCopy()

syStrategy syCopy ( syStrategy  syzstr)

Definition at line 1886 of file syz1.cc.

1887 {
1888  syStrategy result=syzstr;
1889  (result->references)++;
1890  return result;
1891 }
short references
Definition: syz.h:63
return result
Definition: facAbsBiFact.cc:76

§ syCopyPair()

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

§ syDeletePair()

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:169

§ syDim()

int syDim ( syStrategy  syzstr)

Definition at line 1851 of file syz1.cc.

1852 {
1853  int i,l;
1854  if (syzstr->resPairs!=NULL)
1855  {
1856  SRes rP=syzstr->resPairs;
1857 
1858  l = syzstr->length;
1859  while ((l>0) && (rP[l-1]==NULL)) l--;
1860  if (l==0) return -1;
1861  l--;
1862  while (l>=0)
1863  {
1864  i = 0;
1865  while ((i<(*syzstr->Tl)[l]) &&
1866  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1867  (rP[l][i].isNotMinimal!=NULL))
1868  {
1869  i++;
1870  }
1871  if ((i<(*syzstr->Tl)[l]) &&
1872  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1873  (rP[l][i].isNotMinimal==NULL))
1874  return l;
1875  l--;
1876  }
1877  return l;
1878  }
1879  else
1880  return sySize(syzstr);
1881 }
int length
Definition: syz.h:60
intvec * Tl
Definition: syz.h:50
int sySize(syStrategy syzstr)
Definition: syz1.cc:1831
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

§ syEnlargeFields()

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:116
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:3555
unsigned long ** sev
Definition: syz.h:59

§ syEnterPair() [1/2]

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:116
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:4197
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ syEnterPair() [2/2]

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:284

§ syGaussForOne()

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:537
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pSub(a, b)
Definition: polys.h:270
#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:322
#define pMult(p, q)
Definition: polys.h:190
#define pDelete(p_ptr)
Definition: polys.h:169
polyrec * poly
Definition: hilb.h:10
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2715
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168

§ syHilb()

syStrategy syHilb ( ideal  arg,
int *  length 
)

Definition at line 956 of file syz2.cc.

957 {
958  int i,j,actdeg=32000,index=0;
959  int howmuch,toSub=0;
960  int maxindex=0,maxdeg=0;
961  ideal temp=NULL;
962  SSet nextPairs;
963  ring origR = currRing;
964  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
965 
966  if ((idIs0(arg)) || (id_RankFreeModule(arg,currRing)>0))
967  {
969  syzstr->length = 1;
970  syzstr->minres[0] = idInit(1,arg->rank);
971  return syzstr;
972  }
973 
974  // Creare dp,S ring and change to it
975  syzstr->syRing = rAssure_dp_C(origR);
976  rChangeCurrRing(syzstr->syRing);
977 
978  // set initial ShiftedComps
979  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
980  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
981 
982 /*--- initializes the data structures---------------*/
983 #ifdef SHOW_CRIT
984  crit = 0;
985  crit1 = 0;
986  spfl = 0;
987  cons_pairs = 0;
988  crit_fails = 0;
989 #endif
990  syzstr->length = *length = currRing->N+2;
991  syzstr->Tl = new intvec(*length+1);
992  temp = idInit(IDELEMS(arg),arg->rank);
993  for (i=0;i<IDELEMS(arg);i++)
994  {
995  if (origR != syzstr->syRing)
996  temp->m[i] = prCopyR( arg->m[i], origR, syzstr->syRing);
997  else
998  temp->m[i] = pCopy( arg->m[i]);
999  if (temp->m[i]!=NULL)
1000  {
1001  j = pTotaldegree(temp->m[i]);
1002  if (j<actdeg) actdeg = j;
1003  }
1004  }
1005  idTest(temp);
1006  idSkipZeroes(temp);
1007  syzstr->resPairs = syInitRes(temp,length,syzstr->Tl,syzstr->cw);
1008  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
1009  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(int));
1010  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1011  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1012  syzstr->elemLength = (int**)omAlloc0((*length+1)*sizeof(int*));
1013  syzstr->truecomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
1014  syzstr->backcomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
1015  syzstr->ShiftedComponents = (long**)omAlloc0((*length+1)*sizeof(long*));
1016  syzstr->Howmuch = (int**)omAlloc0((*length+1)*sizeof(int*));
1017  syzstr->Firstelem = (int**)omAlloc0((*length+1)*sizeof(int*));
1018  syzstr->hilb_coeffs = (intvec**)omAlloc0((*length+1)*sizeof(intvec*));
1019  syzstr->sev = (unsigned long **)omAlloc0((*length+1)*sizeof(unsigned long*));
1020  syzstr->bucket = kBucketCreate(currRing);
1021  syzstr->syz_bucket = kBucketCreate(currRing);
1022  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
1023 /*--- computes the resolution ----------------------*/
1024  while (nextPairs!=NULL)
1025  {
1026 #ifdef SHOW_PROT
1027 Print("compute %d Paare im Module %d im Grad %d \n",howmuch,index,actdeg+index);
1028 #endif
1029  if (TEST_OPT_PROT) Print("%d",actdeg);
1030  if (TEST_OPT_PROT) Print("(m%d)",index);
1031  if (index==0)
1032  i = syInitSyzMod(syzstr,index,id_RankFreeModule(arg, origR)+1);
1033  else
1034  i = syInitSyzMod(syzstr,index);
1035  j = syInitSyzMod(syzstr,index+1);
1036  if (index>0)
1037  {
1038  syRedNextPairs_Hilb(nextPairs,syzstr,howmuch,index,actdeg,&toSub,&maxindex,&maxdeg);
1039  syzstr->res[index+1]->rank=id_RankFreeModule(syzstr->res[index+1],currRing);
1040  sySetNewHilb(syzstr,toSub,index,actdeg);
1041  toSub = 0;
1042  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
1043  }
1044  else
1045  syRedGenerOfCurrDeg_Hilb(syzstr,actdeg,&maxindex,&maxdeg);
1046 /*--- creates new pairs -----------------------------*/
1047 #ifdef SHOW_PROT
1048 Print("Bilde neue Paare in Modul %d!\n",index);
1049 #endif
1050  syCreateNewPairs_Hilb(syzstr,index,actdeg);
1051  if (index<(*length)-1)
1052  {
1053 #ifdef SHOW_PROT
1054 Print("Bilde neue Paare in Modul %d!\n",index+1);
1055 #endif
1056  syCreateNewPairs_Hilb(syzstr,index+1,actdeg-1);
1057  }
1058  index++;
1059  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
1060  }
1061  syReOrdResult_Hilb(syzstr,maxindex,maxdeg);
1062 #ifdef SHOW_RESULT
1063 PrintS("minimal resolution:\n");
1064 for (int ti=1;ti<=*length;ti++)
1065 {
1066  if (!idIs0(syzstr->orderedRes[ti])) idPrint(syzstr->orderedRes[ti]);
1067 }
1068 PrintS("full resolution:\n");
1069 for (int ti=1;ti<=*length;ti++)
1070 {
1071  if (!idIs0(syzstr->res[ti])) idPrint(syzstr->res[ti]);
1072 }
1073 #endif
1074 #ifdef SHOW_CRIT
1075 Print("Criterion %d times applied\n",crit);
1076 Print("Criterion1 %d times applied\n",crit1);
1077 Print("%d superfluous pairs\n",spfl);
1078 Print("%d pairs considered\n",cons_pairs);
1079 Print("Criterion fails %d times\n",crit_fails);
1080 crit = 0;
1081 crit1 = 0;
1082 spfl = 0;
1083 cons_pairs = 0;
1084 crit_fails = 0;
1085 #endif
1086  if (temp!=NULL) idDelete(&temp);
1087  kBucketDestroy(&(syzstr->bucket));
1088  kBucketDestroy(&(syzstr->syz_bucket));
1089  if (origR != syzstr->syRing)
1090  rChangeCurrRing(origR);
1091  else
1092  currRing = origR;
1093  if (TEST_OPT_PROT) PrintLn();
1094  return syzstr;
1095 }
int length
Definition: syz.h:60
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
void PrintLn()
Definition: reporter.cc:310
#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:29
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:116
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:10
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:46
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
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:265
ring rAssure_dp_C(const ring r)
Definition: ring.cc:4848
int ** backcomponents
Definition: syz.h:41
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
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:12
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:18
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
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:168
#define idTest(id)
Definition: ideals.h:47
ssyStrategy * syStrategy
Definition: syz.h:35

§ syInitializePair()

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

§ syInitRes()

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:169
#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:10
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:265
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

§ syInitSyzMod()

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

§ syKillComputation()

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  id_Delete(&(syzstr->minres[i]),r);
1513  }
1514  }
1515  omFreeSize((ADDRESS)syzstr->minres,(syzstr->length+1)*sizeof(ideal));
1516  }
1517  if (syzstr->fullres!=NULL)
1518  {
1519  for (i=0;i<syzstr->length;i++)
1520  {
1521  if (syzstr->fullres[i]!=NULL)
1522  {
1523  id_Delete(&(syzstr->fullres[i]),r);
1524  }
1525  }
1526  omFreeSize((ADDRESS)syzstr->fullres,(syzstr->length+1)*sizeof(ideal));
1527  }
1528  if (syzstr->weights!=0)
1529  {
1530  for (i=0;i<syzstr->length;i++)
1531  {
1532  if (syzstr->weights[i]!=NULL)
1533  {
1534  delete syzstr->weights[i];
1535  }
1536  }
1537  omFreeSize((ADDRESS)syzstr->weights,syzstr->length*sizeof(intvec*));
1538  }
1539 
1540  ring sr=syzstr->syRing;
1541  if (sr==NULL) sr=r;
1542 
1543  if (syzstr->resPairs!=NULL)
1544  {
1545  for (i=0;i<syzstr->length;i++)
1546  {
1547  for (j=0;j<(*syzstr->Tl)[i];j++)
1548  {
1549  if ((syzstr->resPairs[i])[j].lcm!=NULL)
1550  p_Delete(&((syzstr->resPairs[i])[j].lcm),sr);
1551  if ((i>0) && ((syzstr->resPairs[i])[j].syz!=NULL))
1552  p_Delete(&((syzstr->resPairs[i])[j].syz),sr);
1553  }
1554  if (syzstr->orderedRes[i]!=NULL)
1555  {
1556  for (j=0;j<IDELEMS(syzstr->orderedRes[i]);j++)
1557  {
1558  syzstr->orderedRes[i]->m[j] = NULL;
1559  }
1560  id_Delete(&(syzstr->orderedRes[i]),sr);
1561  }
1562  if (syzstr->truecomponents[i]!=NULL)
1563  {
1564  omFreeSize((ADDRESS)syzstr->truecomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1565  syzstr->truecomponents[i]=NULL;
1566  omFreeSize((ADDRESS)syzstr->ShiftedComponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(long));
1567  syzstr->ShiftedComponents[i]=NULL;
1568  }
1569  if (syzstr->backcomponents[i]!=NULL)
1570  {
1571  omFreeSize((ADDRESS)syzstr->backcomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1572  syzstr->backcomponents[i]=NULL;
1573  }
1574  if (syzstr->Howmuch[i]!=NULL)
1575  {
1576  omFreeSize((ADDRESS)syzstr->Howmuch[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1577  syzstr->Howmuch[i]=NULL;
1578  }
1579  if (syzstr->Firstelem[i]!=NULL)
1580  {
1581  omFreeSize((ADDRESS)syzstr->Firstelem[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1582  syzstr->Firstelem[i]=NULL;
1583  }
1584  if (syzstr->elemLength[i]!=NULL)
1585  {
1586  omFreeSize((ADDRESS)syzstr->elemLength[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1587  syzstr->elemLength[i]=NULL;
1588  }
1589  if (syzstr->res[i]!=NULL)
1590  {
1591  for (j=0;j<IDELEMS(syzstr->res[i]);j++)
1592  {
1593  if (syzstr->res[i]->m[j]!=NULL)
1594  p_Delete(&(syzstr->res[i]->m[j]),sr);
1595  }
1596  }
1597  if ((syzstr->hilb_coeffs!=NULL)
1598  && (syzstr->hilb_coeffs[i]!=NULL))
1599  delete syzstr->hilb_coeffs[i];
1600  if (syzstr->sev[i] != NULL)
1601  omFreeSize((ADDRESS)syzstr->sev[i], (IDELEMS(syzstr->res[i])+1)*sizeof(unsigned long));
1602  id_Delete(&(syzstr->res[i]),sr);
1603  if (syzstr->resPairs[i] != NULL) // OB: ????
1604  omFreeSize((ADDRESS)syzstr->resPairs[i],(*syzstr->Tl)[i]*sizeof(SObject));
1605  }
1606  omFreeSize((ADDRESS)syzstr->resPairs,syzstr->length*sizeof(SObject*));
1607  omFreeSize((ADDRESS)syzstr->res,(syzstr->length+1)*sizeof(ideal));
1608  omFreeSize((ADDRESS)syzstr->orderedRes,(syzstr->length+1)*sizeof(ideal));
1609  omFreeSize((ADDRESS)syzstr->elemLength,(syzstr->length+1)*sizeof(int*));
1610  omFreeSize((ADDRESS)syzstr->truecomponents,(syzstr->length+1)*sizeof(int*));
1611  omFreeSize((ADDRESS)syzstr->ShiftedComponents,(syzstr->length+1)*sizeof(long*));
1612  if (syzstr->sev != NULL)
1613  omFreeSize(((ADDRESS)syzstr->sev), (syzstr->length+1)*sizeof(unsigned long*));
1614  omFreeSize((ADDRESS)syzstr->backcomponents,(syzstr->length+1)*sizeof(int*));
1615  omFreeSize((ADDRESS)syzstr->Howmuch,(syzstr->length+1)*sizeof(int*));
1616  omFreeSize((ADDRESS)syzstr->Firstelem,(syzstr->length+1)*sizeof(int*));
1617  if (syzstr->hilb_coeffs!=NULL)
1618  omFreeSize((ADDRESS)syzstr->hilb_coeffs,(syzstr->length+1)*sizeof(intvec*));
1619  }
1620  if (syzstr->cw!=NULL)
1621  delete syzstr->cw;
1622  if (syzstr->betti!=NULL)
1623  delete syzstr->betti;
1624  if (syzstr->resolution!=NULL)
1625  delete syzstr->resolution;
1626  if (syzstr->Tl!=NULL)
1627  delete syzstr->Tl;
1628  if ((syzstr->syRing != NULL) && (syzstr->syRing != r))
1629  {
1630  if(syzstr->syRing->typ[1].ord_typ == ro_syzcomp)
1631  rChangeSComps(NULL, NULL, 0, syzstr->syRing);
1632 
1633  rDelete(syzstr->syRing);
1634  }
1635  omFreeSize((ADDRESS)syzstr, sizeof(ssyStrategy));
1636  }
1637 }
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:116
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:843
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:4319
intvec * resolution
Definition: syz.h:51

§ syKillEmptyEntres()

void syKillEmptyEntres ( resolvente  res,
int  length 
)

Definition at line 2199 of file syz1.cc.

2200 {
2201  int i,j,jj,k,rj;
2202  intvec * changes;
2203  poly p;
2204  ideal ri;
2205 
2206  for (i=0;i<length;i++)
2207  {
2208  ri = res[i];
2209  if (ri!=NULL)
2210  {
2211  rj = IDELEMS(ri);
2212  changes = new intvec(rj+1,1,-1);
2213  while ((rj>0) && (ri->m[rj-1]==NULL)) rj--;
2214  j = k = 0;
2215  while (j+k<rj)
2216  {
2217  if (ri->m[j+k]!=NULL)
2218  {
2219  ri->m[j] = ri->m[j+k];
2220  (*changes)[j+k+1] = j+1;
2221  j++;
2222  }
2223  else
2224  {
2225  k++;
2226  }
2227  }
2228  for (jj=j;jj<rj;jj++)
2229  ri->m[jj] = NULL;
2230  if (res[i+1]!=NULL)
2231  {
2232  ri = res[i+1];
2233  for (j=IDELEMS(ri)-1;j>=0;j--)
2234  {
2235  p = ri->m[j];
2236  while (p!=NULL)
2237  {
2238  pSetComp(p,(*changes)[pGetComp(p)]);
2239  pSetm(p);
2240  pIter(p);
2241  }
2242  }
2243  }
2244  delete changes;
2245  }
2246  }
2247 }
#define pSetm(p)
Definition: polys.h:253
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

§ syKosz()

syStrategy syKosz ( ideal  arg,
int *  length 
)

Definition at line 1761 of file syz3.cc.

1762 {
1763  int i,j,jj,k=0,index=0,rk_arg/*,next_syz=0*/;
1764  int crit_comp,t_comp,next_deg,old_tl;
1765  ideal temp=NULL,old_ideal,old_repr;
1766  ring origR = currRing;
1767  poly next_gen;
1768  BOOLEAN isRegular;
1769 
1770  discard_pairs = 0;
1771  short_pairs = 0;
1772  if (idIs0(arg)) return NULL;
1773  rk_arg = id_RankFreeModule(arg,currRing);
1774  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
1775 /*--- changes to a Cdp-ring ----------------------------*/
1776  syzstr->syRing = rAssure_C_dp(origR); rChangeCurrRing(syzstr->syRing);
1777 /*--- initializes the data structures---------------*/
1778  syzstr->length = *length = (syzstr->syRing->N)+2;
1779  syzstr->regularity = -1;
1780  if (origR!=syzstr->syRing)
1781  temp = idrCopyR(arg, origR, syzstr->syRing);
1782  else
1783  temp = idCopy(arg);
1784  if (rk_arg==0)
1785  {
1786  id_Shift(temp,1,currRing);
1787  }
1788  idSkipZeroes(temp);
1789 #ifdef WITH_SORT
1790  if (temp->m[0]!=NULL)
1791  {
1792  int md;
1793  int maxdeg=p_FDeg(temp->m[IDELEMS(temp)-1],currRing);
1794  ideal temp1=idInit(IDELEMS(temp),temp->rank);
1795  for (j=IDELEMS(temp)-2;j>=0;j--)
1796  {
1797  jj = p_FDeg(temp->m[j],currRing);
1798  if (jj>maxdeg) maxdeg = jj;
1799  }
1800  while (!idIs0(temp))
1801  {
1802  md = maxdeg;
1803  for (j=IDELEMS(temp)-1;j>=0;j--)
1804  {
1805  if (temp->m[j]!=NULL)
1806  {
1807  jj = p_FDeg(temp->m[j],currRing);
1808  if (jj<md) md = jj;
1809  }
1810  }
1811  for (j=0;j<IDELEMS(temp);j++)
1812  {
1813  if ((temp->m[j]!=NULL) && (p_FDeg(temp->m[j],currRing)==md))
1814  {
1815  temp1->m[k] = temp->m[j];
1816  temp->m[j] = NULL;
1817  k++;
1818  }
1819  }
1820  }
1821  idDelete(&temp);
1822  temp = temp1;
1823  temp1 = NULL;
1824  }
1825 #endif
1826 #ifdef USE_REGULARITY
1827  int last_generator=IDELEMS(temp)-1;
1828  while ((last_generator>=0) && (temp->m[last_generator]==NULL))
1829  last_generator--;
1830 #endif
1831  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1832  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1833  resolvente totake=(resolvente)omAlloc0((*length+1)*sizeof(ideal));
1834  syzstr->Tl = new intvec(*length+1);
1835  syzstr->bucket = kBucketCreate(currRing);
1836  syzstr->syz_bucket = kBucketCreate(currRing);
1837  ideal new_generators=idInit(1,si_max(rk_arg,1));
1838  ideal temp_gens,old_std;
1839  syzstr->res[0] = idInit(1,1);
1840  if (rk_arg>1) syzstr->res[0]->rank = rk_arg;
1841  syzstr->orderedRes[0] = idInit(1,1);
1842 /*--- computes the resolution ----------------------*/
1843  i = 0;
1844  while (i<IDELEMS(temp))
1845  {
1846  if (temp->m[i]!=NULL)
1847  {
1848  new_generators->m[0] = kNF(syzstr->res[0],currRing->qideal,temp->m[i]);
1849  if (!nIsOne(pGetCoeff(new_generators->m[0])))
1850  pNorm(new_generators->m[0]);
1851  next_deg = p_FDeg(new_generators->m[0],currRing);
1852  next_gen = pCopy(new_generators->m[0]);
1853  }
1854  if (!idIs0(new_generators))
1855  {
1856  index = 0;
1857  while (index<=*length)
1858  {
1859  if (index==0)
1860  {
1861  old_ideal = idCopy(syzstr->res[0]);
1862  old_repr = idCopy(syzstr->orderedRes[0]);
1863  old_tl = (*syzstr->Tl)[0];
1864  old_std = id_Head(syzstr->res[0],currRing);
1865  }
1866  t_comp = (*syzstr->Tl)[index];
1867  if (index==0) crit_comp = t_comp;
1868  temp_gens = syAppendSyz(new_generators,syzstr, index,crit_comp,totake);
1869  crit_comp = t_comp;
1870  if (index==0)
1871  {
1872  isRegular = syIsRegular(old_std,syzstr->res[0],next_deg);
1873 #ifndef ONLY_STD
1874  if (isRegular)
1875  syCreateRegularExtension(syzstr,old_ideal,old_repr,old_tl,next_gen,
1876  totake);
1877 #ifdef USE_REGULARITY
1878  if ((index==0) && (!isRegular) && (i==last_generator))
1879  {
1880 /*----------- we are computing the regularity -----------------------*/
1881  ideal initial=id_Head(syzstr->res[0],currRing);
1882  int len=0,reg=0;
1883  intvec *w=NULL;
1884  ring dp_C_ring = rAssure_dp_C(currRing); rChangeCurrRing(dp_C_ring);
1885  initial = idrMoveR_NoSort(initial, syzstr->syRing, dp_C_ring);
1886  resolvente res = sySchreyerResolvente(initial,-1,&len,TRUE, TRUE);
1887  intvec * dummy = syBetti(res,len,&reg, w);
1888  syzstr->regularity = reg+2;
1889  delete dummy;
1890  delete w;
1891  for (j=0;j<len;j++)
1892  {
1893  if (res[j]!=NULL) idDelete(&(res[j]));
1894  }
1895  omFreeSize((ADDRESS)res,len*sizeof(ideal));
1896  idDelete(&initial);
1897  rChangeCurrRing(syzstr->syRing);
1898  rDelete(dp_C_ring);
1899  }
1900 #endif
1901 #endif
1902  idDelete(&old_ideal);
1903  idDelete(&old_repr);
1904  idDelete(&old_std);
1905  if (TEST_OPT_PROT)
1906  {
1907  if (isRegular)
1908  PrintS("\n regular\n");
1909  else
1910  PrintS("\n not regular\n");
1911  }
1912  if (next_gen!=NULL)
1913  pDelete(&next_gen);
1914  if (isRegular)
1915  {
1916  idDelete(&temp_gens);
1917  break;
1918  }
1919  }
1920  idDelete(&new_generators);
1921  new_generators = temp_gens;
1922 #ifdef ONLY_STD
1923  break;
1924 #endif
1925  if (idIs0(new_generators)) break;
1926  index++;
1927  }
1928  if (!idIs0(new_generators))
1929  {
1930  for (j=0;j<IDELEMS(new_generators);j++)
1931  {
1932  if (new_generators->m[j]!=NULL)
1933  {
1934  pDelete(&new_generators->m[j]);
1935  new_generators->m[j] = NULL;
1936  }
1937  }
1938  }
1939  }
1940  i++;
1941  }
1942  if (idIs0(new_generators) && new_generators!=NULL) idDelete(&new_generators);
1943  if (temp!=NULL) idDelete(&temp);
1944  kBucketDestroy(&(syzstr->bucket));
1945  kBucketDestroy(&(syzstr->syz_bucket));
1946  index = 0;
1947  syzstr->fullres = syzstr->res;
1948  syzstr->res = NULL;
1949  index = 0;
1950  while ((index<=*length) && (syzstr->fullres[index]!=NULL))
1951  {
1952 #ifdef SHOW_RESULT
1953  Print("The %d-th syzygy-module is now:\n",index);
1954  ideal ttt=id_Head(syzstr->fullres[index],currRing);
1955  idShow(ttt);
1956  idDelete(&ttt);
1957  //if (index>0)
1958  //{
1959  //Print("The related module is: \n");
1960  //idPrint(totake[index-1]);
1961  //}
1962  //Print("The %d-th module of the minimal resolution is:\n",index);
1963  if (!idIs0(totake[index]))
1964  idShow(totake[index]);
1965  //Print("with standard basis:\n");
1966  //idPrint(syzstr->fullres[index]);
1967  //if ((index<*length) && (totake[index+1]!=NULL))
1968  //{
1969  //Print("The %d-th syzygy-module is now:\n",index+1);
1970  //idPrint(totake[index+1]);
1971  //matrix m1=idModule2Matrix(totake[index]);
1972  //matrix m2=idModule2Matrix(totake[index+1]);
1973  //matrix m3=mpMult(m1,m2);
1974  //idPrint((ideal)m3);
1975  //}
1976 #endif
1977  if (!idIs0(totake[index]))
1978  {
1979  for(i=0;i<IDELEMS(totake[index]);i++)
1980  {
1981  if (totake[index]->m[i]!=NULL)
1982  {
1983  j=0;
1984  while ((j<IDELEMS(syzstr->fullres[index])) &&
1985  ((syzstr->fullres[index]->m[j]==NULL) ||
1986  (!pLmEqual(syzstr->fullres[index]->m[j],totake[index]->m[i])))) j++;
1987  if (j<IDELEMS(syzstr->fullres[index]))
1988  {
1989  pDelete(&totake[index]->m[i]);
1990  totake[index]->m[i] = syzstr->fullres[index]->m[j];
1991  syzstr->fullres[index]->m[j] = NULL;
1992  }
1993  else
1994  {
1995  PrintS("Da ist was faul!!!\n");
1996  Print("Aber: Regularitaet %d, Grad %ld\n",
1997  syzstr->regularity,p_FDeg(totake[index]->m[i],currRing));
1998  }
1999  }
2000  }
2001  idDelete(&syzstr->fullres[index]);
2002  syzstr->fullres[index] = totake[index];
2003  }
2004 #ifdef SHOW_RESULT
2005  idShow(syzstr->fullres[index]);
2006 #endif
2007  index++;
2008  }
2009  syReorder_Kosz(syzstr);
2010  index = 0;
2011  while ((index<=*length) && (syzstr->orderedRes[index]!=NULL))
2012  {
2013  idDelete(&(syzstr->orderedRes[index]));
2014  index++;
2015  }
2016  if (origR!=syzstr->syRing)
2017  {
2018  rChangeCurrRing(origR);
2019  index = 0;
2020  while ((index<=*length) && (syzstr->fullres[index]!=NULL))
2021  {
2022  syzstr->fullres[index] = idrMoveR(syzstr->fullres[index],syzstr->syRing, origR);
2023  index++;
2024  }
2025  }
2026  delete syzstr->Tl;
2027  syzstr->Tl = NULL;
2028  rDelete(syzstr->syRing);
2029  syzstr->syRing = NULL;
2030  omFreeSize((ADDRESS)totake,(*length+1)*sizeof(ideal));
2031  omFreeSize((ADDRESS)syzstr->orderedRes,(*length+1)*sizeof(ideal));
2032 //Print("Pairs to discard: %d\n",discard_pairs);
2033 //Print("Pairs shorter reduced: %d\n",short_pairs);
2034 //discard_pairs = 0;
2035 //short_pairs = 0;
2036  return syzstr;
2037 }
int length
Definition: syz.h:60
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define Print
Definition: emacs.cc:83
static ideal syAppendSyz(ideal new_generators, syStrategy syzstr, int index, int crit_comp, resolvente totake)
Definition: syz3.cc:1685
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:98
void syReorder_Kosz(syStrategy syzstr)
Definition: syz3.cc:262
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:99
#define nIsOne(n)
Definition: numbers.h:25
void * ADDRESS
Definition: auxiliary.h:116
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
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
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
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:200
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:4848
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:121
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
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:60
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:12
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:4853
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:346
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:169
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:18
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition: syz.cc:791
polyrec * poly
Definition: hilb.h:10
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
int BOOLEAN
Definition: auxiliary.h:86
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:168
ssyStrategy * syStrategy
Definition: syz.h:35

§ syLaScala()

syStrategy syLaScala ( ideal  arg,
int &  maxlength,
intvec weights = NULL 
)

Definition at line 2553 of file syz1.cc.

2554 {
2555  int i,j,actdeg=32000,index=0;
2556  int howmuch;
2557  ideal temp;
2558  SSet nextPairs;
2559  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2560  ring origR = currRing;
2561 
2562  if(weights!= NULL)
2563  syzstr->cw = new intvec(weights);
2564  else
2565  syzstr->cw = NULL;
2566 
2567  if ((idIs0(arg)) ||
2568  ((id_RankFreeModule(arg,currRing)>0) && (!idTestHomModule(arg, NULL, syzstr->cw))))
2569  {
2571  syzstr->length = 1;
2572  syzstr->minres[0] = idInit(1,arg->rank);
2573  return syzstr;
2574  }
2575 
2576 
2577  //crit = 0;
2578  //euler = -1;
2579  redpol = pInit();
2580 
2581  if( maxlength > 0 )
2582  syzstr->length = maxlength; // = (currRing->N)+2;
2583  else
2584  syzstr->length = maxlength = (currRing->N)+2;
2585 
2586  // Creare dp,S ring and change to it
2587  syzstr->syRing = rAssure_dp_S(origR);
2588  assume(syzstr->syRing != origR);
2589  assume(syzstr->syRing->typ[1].ord_typ == ro_syzcomp);
2590  rChangeCurrRing(syzstr->syRing);
2591 
2592  // set initial ShiftedComps
2593  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2594  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2595  for (i=0;i<=arg->rank;i++)
2596  {
2598  currcomponents[i] = i;
2599  }
2601 /*--- initializes the data structures---------------*/
2602  syzstr->Tl = new intvec(maxlength);
2603  temp = idInit(IDELEMS(arg),arg->rank);
2604  for (i=0;i<IDELEMS(arg);i++)
2605  {
2606  temp->m[i] = prCopyR( arg->m[i], origR, currRing);
2607  if (temp->m[i]!=NULL)
2608  {
2609  j = pTotaldegree(temp->m[i]);
2610  if (j<actdeg) actdeg = j;
2611  }
2612  }
2613  idTest(temp);
2614  idSkipZeroes(temp);
2615  idTest(temp);
2616  syzstr->resPairs = syInitRes(temp,&maxlength,syzstr->Tl,syzstr->cw);
2617  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2618  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2619 
2620  syzstr->res = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2621  syzstr->orderedRes = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2622  syzstr->elemLength = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2623 
2624  syzstr->truecomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2625  syzstr->ShiftedComponents = (long**)omAlloc0((maxlength+1)*sizeof(long*));
2626 
2627  syzstr->backcomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2628  syzstr->Howmuch = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2629  syzstr->Firstelem = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2630  syzstr->sev = (unsigned long **) omAlloc0((maxlength+1)*sizeof(unsigned long *));
2631 
2632  assume( syzstr->length == maxlength );
2633 
2634  syzstr->bucket = kBucketCreate(currRing);
2635  int len0=id_RankFreeModule(temp,currRing)+1;
2636 
2637  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2638  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2639 /*--- computes the resolution ----------------------*/
2640  while (nextPairs!=NULL)
2641  {
2642  if (TEST_OPT_PROT) Print("%d",actdeg);
2643  if (TEST_OPT_PROT) Print("(m%d)",index);
2644  if (index==0)
2645  i = syInitSyzMod(syzstr,index,len0);
2646  else
2647  i = syInitSyzMod(syzstr,index);
2648  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2649  currShiftedComponents = syzstr->ShiftedComponents[si_max(index-1,0)];
2650  rChangeSComps(currcomponents, currShiftedComponents,
2651  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2652  j = syInitSyzMod(syzstr,index+1);
2653  if (index>0)
2654  {
2655  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2656  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2657  }
2658  else
2659  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2660 /*--- creates new pairs -----------------------------*/
2661  syCreateNewPairs(syzstr,index,i);
2662  if (index<(maxlength-1))
2663  {
2664  syCreateNewPairs(syzstr,index+1,j);
2665  }
2666  index++;
2667  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2668  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2669  }
2670  if (temp!=NULL) idDelete(&temp);
2671  kBucketDestroy(&(syzstr->bucket));
2672  if (origR != syzstr->syRing)
2673  rChangeCurrRing(origR);
2674  pLmDelete(&redpol);
2675  if (TEST_OPT_PROT) PrintLn();
2676  return syzstr;
2677 }
int length
Definition: syz.h:60
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
Definition: syz1.cc:1074
void PrintLn()
Definition: reporter.cc:310
#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:29
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:1834
#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:116
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:10
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
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:265
#define assume(x)
Definition: mod2.h:403
#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:121
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:12
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:4843
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:18
static poly redpol
Definition: syz1.cc:44
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
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:4319
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:47
ssyStrategy * syStrategy
Definition: syz.h:35

§ syLaScala1()

resolvente syLaScala1 ( ideal  arg,
int *  length 
)

§ syLaScala3()

syStrategy syLaScala3 ( ideal  arg,
int *  length 
)

Definition at line 2425 of file syz1.cc.

2426 {
2427  int i,j,actdeg=32000,index=0;
2428  int howmuch;
2429  ideal temp;
2430  SSet nextPairs;
2431  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2432  ring origR = currRing;
2433 
2434  if ((idIs0(arg)) ||
2435  ((id_RankFreeModule(arg,currRing)>0) && (!idHomModule(arg,NULL,&(syzstr->cw)))))
2436  {
2438  syzstr->length = 1;
2439  syzstr->minres[0] = idInit(1,arg->rank);
2440  return syzstr;
2441  }
2442 
2443  //crit = 0;
2444  //euler = -1;
2445  redpol = pInit();
2446  syzstr->length = *length = (currRing->N)+2;
2447 
2448  // Creare dp,S ring and change to it
2449  syzstr->syRing = rAssure_dp_S(origR);
2450  assume(syzstr->syRing != origR); // why?
2451  rChangeCurrRing(syzstr->syRing);
2452 
2453  // set initial ShiftedComps
2454  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2455  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2456  for (i=0;i<=arg->rank;i++)
2457  {
2459  currcomponents[i] = i;
2460  }
2462 /*--- initializes the data structures---------------*/
2463  syzstr->Tl = new intvec(*length);
2464  temp = idInit(IDELEMS(arg),arg->rank);
2465  for (i=0;i<IDELEMS(arg);i++)
2466  {
2467  temp->m[i] = prCopyR( arg->m[i], origR, syzstr->syRing);
2468  if (temp->m[i]!=NULL)
2469  {
2470  j = pTotaldegree(temp->m[i]);
2471  if (j<actdeg) actdeg = j;
2472  }
2473  }
2474  idTest(temp);
2475  idSkipZeroes(temp);
2476  idTest(temp);
2477  syzstr->resPairs = syInitRes(temp,length,syzstr->Tl,syzstr->cw);
2478  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2479  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2480  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2481  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2482  syzstr->elemLength = (int**)omAlloc0((*length+1)*sizeof(int*));
2483  syzstr->truecomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2484  syzstr->ShiftedComponents = (long**)omAlloc0((*length+1)*sizeof(long*));
2485  syzstr->backcomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2486  syzstr->Howmuch = (int**)omAlloc0((*length+1)*sizeof(int*));
2487  syzstr->Firstelem = (int**)omAlloc0((*length+1)*sizeof(int*));
2488  syzstr->sev = (unsigned long **) omAlloc0((*length+1)*sizeof(unsigned long *));
2489  syzstr->bucket = kBucketCreate(currRing);
2490  int len0=id_RankFreeModule(temp,currRing)+1;
2491 
2492  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2493  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2494 /*--- computes the resolution ----------------------*/
2495  while (nextPairs!=NULL)
2496  {
2497  if (TEST_OPT_PROT) Print("%d",actdeg);
2498  if (TEST_OPT_PROT) Print("(m%d)",index);
2499  if (index==0)
2500  i = syInitSyzMod(syzstr,index,len0);
2501  else
2502  i = syInitSyzMod(syzstr,index);
2503  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2504  currShiftedComponents = syzstr->ShiftedComponents[si_max(index-1,0)];
2505  rChangeSComps(currcomponents, currShiftedComponents,
2506  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2507  j = syInitSyzMod(syzstr,index+1);
2508  if (index>0)
2509  {
2510  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2511  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2512  }
2513  else
2514  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2515 /*--- creates new pairs -----------------------------*/
2516  syCreateNewPairs(syzstr,index,i);
2517  if (index<(*length)-1)
2518  {
2519  syCreateNewPairs(syzstr,index+1,j);
2520  }
2521  index++;
2522  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2523  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2524  }
2525  if (temp!=NULL) idDelete(&temp);
2526  kBucketDestroy(&(syzstr->bucket));
2527 
2528  if (origR != syzstr->syRing)
2529  rChangeCurrRing(origR);
2530  pLmDelete(&redpol);
2531 
2532  if (TEST_OPT_PROT) PrintLn();
2533 
2534  assume(syzstr->minres==NULL); assume(syzstr->fullres ==NULL);
2535  assume(syzstr->resPairs!=NULL); assume(syzstr->hilb_coeffs==NULL);
2536  assume(syzstr->res!=NULL);
2537 
2538  if(! TEST_OPT_NO_SYZ_MINIM )
2539  syzstr->minres = syReadOutMinimalRes(syzstr);
2540  else
2541  syzstr->fullres = syReorder(syzstr->res, syzstr->length, syzstr); // buggy? (betti...?)
2542 
2543  return syzstr;
2544 }
int length
Definition: syz.h:60
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
Definition: syz1.cc:1074
void PrintLn()
Definition: reporter.cc:310
#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:29
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:1643
#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:116
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
Definition: syz1.cc:2312
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:10
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
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:265
#define assume(x)
Definition: mod2.h:403
#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:121
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:12
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:4843
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:18
static poly redpol
Definition: syz1.cc:44
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
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:4319
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:47
ssyStrategy * syStrategy
Definition: syz.h:35

§ syMinBase()

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:99
void * ADDRESS
Definition: auxiliary.h:116
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:18
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
return result
Definition: facAbsBiFact.cc:76

§ syMinimize()

syStrategy syMinimize ( syStrategy  syzstr)

Definition at line 2393 of file syz1.cc.

2394 {
2395  if (syzstr->minres==NULL)
2396  {
2397  if (syzstr->resPairs!=NULL)
2398  {
2399  if (syzstr->hilb_coeffs==NULL)
2400  {
2401  // La Scala Resolution
2402  syzstr->minres = syReadOutMinimalRes(syzstr);
2403  }
2404  else
2405  { // HRES
2406  syzstr->minres = syReorder(syzstr->orderedRes,syzstr->length,syzstr);
2407  }
2408  }
2409  else if (syzstr->fullres!=NULL)
2410  {
2411  syMinimizeResolvente(syzstr->fullres,syzstr->length,1);
2412  syzstr->minres = syzstr->fullres;
2413  syzstr->fullres = NULL;
2414  }
2415  }
2416  (syzstr->references)++;
2417  return syzstr;
2418 }
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:1643
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
Definition: syz1.cc:2312
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

§ syMinimizeResolvente()

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:95
#define TRUE
Definition: auxiliary.h:99
static void syMinStep1(resolvente res, int length)
Definition: syz.cc:294
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
Definition: ideals.cc:2297
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:10
Definition: intvec.h:14
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
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:96

§ syPrint()

void syPrint ( syStrategy  syzstr,
const char *  currRingName 
)

Definition at line 1936 of file syz1.cc.

1937 {
1938  if ( (syzstr->resPairs==NULL) &&
1939  (syzstr->fullres==NULL) &&
1940  (syzstr->minres==NULL) &&
1941  (syzstr->resolution == NULL) )
1942  {
1943  PrintS("No resolution defined\n");
1944  return;
1945  }
1946 
1947  intvec* resolution = syzstr->resolution;
1948 
1949  if (resolution==NULL)
1950  {
1951  if (syzstr->resPairs!=NULL)
1952  {
1953  resolution = new intvec(syzstr->length+1);
1954  SRes rP = syzstr->resPairs;
1955 // assume(idRankFreeModule(syzstr->res[1], (syzstr->syRing != NULL ? syzstr->syRing : currRing))==syzstr->res[1]->rank);
1956  (*resolution)[0] = syzstr->res[1]->rank;
1957  int k=0;
1958  while ((k<syzstr->length) && (rP[k]!=NULL))
1959  {
1960  int j = 0;
1961  while ((j<(*syzstr->Tl)[k]) &&
1962  ((rP[k][j].lcm!=NULL) || (rP[k][j].syz!=NULL)))
1963  {
1964  if (rP[k][j].isNotMinimal==NULL)
1965  ((*resolution)[k+1])++;
1966  j++;
1967  }
1968  k++;
1969  }
1970  }
1971  else
1972  {
1973  resolution = new intvec(syzstr->length+2);
1974  resolvente rr;
1975  if (syzstr->minres!=NULL)
1976  rr = syzstr->minres;
1977  else
1978  rr = syzstr->fullres;
1979  (*resolution)[0]
1980  = si_max(1,(int)id_RankFreeModule(rr[0],
1981  (syzstr->syRing != NULL ? syzstr->syRing : currRing)));
1982  int k=0;
1983  while ((k<syzstr->length) && (rr[k]!=NULL))
1984  {
1985  (*resolution)[k+1] = idElem(rr[k]);
1986  k++;
1987  }
1988  }
1989  }
1990 
1991  int sl=strlen(sn);
1992  syPrintEmptySpaces1(sl);
1993  int k = 0;
1994  loop
1995  {
1996  if ((k>=resolution->length()) || ((*resolution)[k]==0))
1997  break;
1998  Print("%d",(*resolution)[k]);
1999  syPrintEmptySpaces1(sl+5);
2000  k++;
2001  }
2002  PrintLn();
2003  k = 0;
2004  loop
2005  {
2006  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2007  break;
2008  PrintS(sn);
2009  if (((k+1)>=resolution->length()) || ((*resolution)[(k+1)]==0))
2010  break;
2011  PrintS(" <-- ");
2012  syPrintEmptySpaces((*resolution)[k]);
2013  k++;
2014  }
2015  PrintLn();
2016  PrintLn();
2017  k = 0;
2018  loop
2019  {
2020  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2021  break;
2022  Print("%d",k);
2023  syPrintEmptySpaces1(sl+5+syLengthInt((*resolution)[k])-
2024  syLengthInt(k));
2025  k++;
2026  }
2027  PrintLn();
2028  if (syzstr->minres==NULL)
2029  {
2030  PrintS("resolution not minimized yet\n");
2031  }
2032 
2033  if (syzstr->resolution == NULL) syzstr->resolution = resolution;
2034 }
int length
Definition: syz.h:60
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
loop
Definition: myNF.cc:98
resolvente res
Definition: syz.h:47
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:10
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:121
void PrintS(const char *s)
Definition: reporter.cc:284
static void syPrintEmptySpaces(int i)
Definition: syz1.cc:1896
static int syLengthInt(int i)
Definition: syz1.cc:1920
static void syPrintEmptySpaces1(int i)
Definition: syz1.cc:1908
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
int length() const
Definition: intvec.h:86
SSet * SRes
Definition: syz.h:33
ideal * resolvente
Definition: ideals.h:18
int idElem(const ideal F)
count non-zero elements
intvec * resolution
Definition: syz.h:51

§ syReorder()

resolvente syReorder ( resolvente  res,
int  length,
syStrategy  syzstr,
BOOLEAN  toCopy = TRUE,
resolvente  totake = NULL 
)

Definition at line 1643 of file syz1.cc.

1645 {
1646  int i,j,l;
1647  poly p,q,tq;
1648  polyset ri1;
1649  resolvente fullres;
1650  ring origR=syzstr->syRing;
1651  fullres = (resolvente)omAlloc0((length+1)*sizeof(ideal));
1652  if (totake==NULL)
1653  totake = res;
1654  for (i=length-1;i>0;i--)
1655  {
1656  if (res[i]!=NULL)
1657  {
1658  if (i>1)
1659  {
1660  j = IDELEMS(res[i-1]);
1661  while ((j>0) && (res[i-1]->m[j-1]==NULL)) j--;
1662  fullres[i-1] = idInit(IDELEMS(res[i]),j);
1663  ri1 = totake[i-1]->m;
1664  for (j=IDELEMS(res[i])-1;j>=0;j--)
1665  {
1666  p = res[i]->m[j];
1667  q = NULL;
1668  while (p!=NULL)
1669  {
1670  if (toCopy)
1671  {
1672  if (origR!=NULL)
1673  tq = prHeadR(p,origR, currRing);
1674  else
1675  tq = pHead(p);
1676  pIter(p);
1677  }
1678  else
1679  {
1680  res[i]->m[j] = NULL;
1681  if (origR!=NULL)
1682  {
1683  poly pp=p;
1684  pIter(p);
1685  pNext(pp)=NULL;
1686  tq = prMoveR(pp, origR, currRing);
1687  }
1688  else
1689  {
1690  tq = p;
1691  pIter(p);
1692  pNext(tq) = NULL;
1693  }
1694  }
1695 // pWrite(tq);
1696  pTest(tq);
1697  for (l=(currRing->N);l>0;l--)
1698  {
1699  if (origR!=NULL)
1700  pSubExp(tq,l, p_GetExp(ri1[pGetComp(tq)-1],l,origR));
1701  else
1702  pSubExp(tq,l, pGetExp(ri1[pGetComp(tq)-1],l));
1703  }
1704  pSetm(tq);
1705  pTest(tq);
1706  q = pAdd(q,tq);
1707  pTest(q);
1708  }
1709  fullres[i-1]->m[j] = q;
1710  }
1711  }
1712  else
1713  {
1714  if (origR!=NULL)
1715  {
1716  fullres[i-1] = idInit(IDELEMS(res[i]),res[i]->rank);
1717  for (j=IDELEMS(res[i])-1;j>=0;j--)
1718  {
1719  if (toCopy)
1720  fullres[i-1]->m[j] = prCopyR(res[i]->m[j], origR, currRing);
1721  else
1722  {
1723  fullres[i-1]->m[j] = prMoveR(res[i]->m[j], origR, currRing);
1724  res[i]->m[j] = NULL;
1725  }
1726  }
1727  }
1728  else
1729  {
1730  if (toCopy)
1731  fullres[i-1] = idCopy(res[i]);
1732  else
1733  {
1734  fullres[i-1] = res[i];
1735  res[i] = NULL;
1736  }
1737  }
1738  for (j=IDELEMS(fullres[i-1])-1;j>=0;j--)
1739  fullres[i-1]->m[j] = pSortCompCorrect(fullres[i-1]->m[j]);
1740  }
1741  if (!toCopy)
1742  {
1743  if (res[i]!=NULL) idDelete(&res[i]);
1744  }
1745  }
1746  }
1747  if (!toCopy)
1748  omFreeSize((ADDRESS)res,(length+1)*sizeof(ideal));
1749  //syzstr->length = length;
1750  return fullres;
1751 }
poly prHeadR(poly p, ring src_r, ring dest_r, prCopyProc_t prproc)
Definition: prCopy.cc:127
#define pSetm(p)
Definition: polys.h:253
#define pAdd(p, q)
Definition: polys.h:186
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
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:399
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define pSubExp(p, i, v)
Definition: polys.h:46
void * ADDRESS
Definition: auxiliary.h:116
#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:10
#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:210
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:60
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:18
polyrec * poly
Definition: hilb.h:10
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94

§ syReOrderResolventFB()

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:253
#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
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
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
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:284
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10

§ syReorderShiftedComponents()

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:403
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int i
Definition: cfEzgcd.cc:123

§ syResetShiftedComponents()

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:10
void rGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
Definition: ring.cc:4328
#define assume(x)
Definition: mod2.h:403
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:4319

§ syResolution()

syStrategy syResolution ( ideal  arg,
int  maxlength,
intvec w,
BOOLEAN  minim 
)

Definition at line 621 of file syz.cc.

622 {
623 
624 #ifdef HAVE_PLURAL
625 
626  const ideal idSaveCurrRingQuotient = currRing->qideal;
627 
628  if( rIsSCA(currRing) )
629  {
630 
631 #ifdef RDEBUG
632 // rWrite(currRing);
633 // rDebugPrint(currRing);
634 #endif
635 
637  {
638  currRing->qideal = SCAQuotient(currRing);
639  }
640 
641  const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
642  const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
643 
644  arg = id_KillSquares(arg, m_iFirstAltVar, m_iLastAltVar, currRing, false); // kill suares in input!
645  }
646 #endif
647 
649 
650  if ((w!=NULL) && (!idTestHomModule(arg,currRing->qideal,w))) // is this right in SCA case???
651  {
652  WarnS("wrong weights given(2):");w->show();PrintLn();
653  idHomModule(arg,currRing->qideal,&w);
654  w->show();PrintLn();
655  w=NULL;
656  }
657  if (w!=NULL)
658  {
659  result->weights = (intvec**)omAlloc0Bin(char_ptr_bin);
660  (result->weights)[0] = ivCopy(w);
661  result->length = 1;
662  }
663  resolvente fr = syResolvente(arg,maxlength,&(result->length),&(result->weights),minim),fr1;
664  if (minim)
665  {
666  result->minres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
667  fr1 = result->minres;
668  }
669  else
670  {
671  result->fullres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
672  fr1 = result->fullres;
673  }
674  for (int i=result->length-1;i>=0;i--)
675  {
676  if (fr[i]!=NULL)
677  fr1[i] = fr[i];
678  fr[i] = NULL;
679  }
680  omFreeSize((ADDRESS)fr,(result->length)*sizeof(ideal));
681 
682 
683 #ifdef HAVE_PLURAL
684  if( rIsSCA(currRing) )
685  {
686 
688  {
689  currRing->qideal = idSaveCurrRingQuotient;
690  }
691 
693  }
694 #endif
695 
696 
697  return result;
698 }
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:310
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
#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:116
#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:10
Definition: intvec.h:14
bool ncExtensions(int iMask)
Definition: old.gring.cc:99
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:1533
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
static short scaLastAltVar(ring r)
Definition: sca.h:25
static bool rIsSCA(const ring r)
Definition: nc.h:206
ideal * resolvente
Definition: ideals.h:18
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
#define omAlloc0(size)
Definition: omAllocDecl.h:211
return result
Definition: facAbsBiFact.cc:76
ssyStrategy * syStrategy
Definition: syz.h:35

§ syResolvente()

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  && (!rField_is_Ring(currRing))
538  }
539  else
540  {
541  res[syzIndex+1] = idSyzygies(res[syzIndex],hom,&w,FALSE);
542  }
543  completeMinim=(syzIndex!=maxlength) || (maxlength ==-1) || (hom!=isHomog);
544  syzIndex++;
545  if (TEST_OPT_PROT) Print("[%d]\n",syzIndex);
546 
547  if(! TEST_OPT_NO_SYZ_MINIM )
548  {
549  if ((minim)||(syzIndex>1))
550  syMinStep(res[syzIndex-1],res[syzIndex],!completeMinim,NULL,hom);
551  if (!completeMinim)
552  /*minim is TRUE, we are in the module: maxlength, maxlength <>0*/
553  {
554  idDelete(&res[syzIndex]);
555  }
556  }
557 /*---creating the iterated weights for module components ---------*/
558  if ((hom == isHomog) && (res[syzIndex]!=NULL) && (!idIs0(res[syzIndex])))
559  {
560 //Print("die %d Modulegewichte sind:\n",w1->length());
561 //w1->show();
562 //PrintLn();
563  int max_comp = id_RankFreeModule(res[syzIndex],currRing);
564  k = max_comp - rGetCurrSyzLimit(currRing);
565  assume(w != NULL);
566  if (w != NULL)
567  w->resize(max_comp+IDELEMS(res[syzIndex]));
568  else
569  w = new intvec(max_comp+IDELEMS(res[syzIndex]));
570  (*weights)[syzIndex] = new intvec(k);
571  for (i=0;i<k;i++)
572  {
573  if (res[syzIndex-1]->m[i]!=NULL) // hs
574  {
575  (*w)[i + rGetCurrSyzLimit(currRing)] = p_FDeg(res[syzIndex-1]->m[i],currRing);
576  if (pGetComp(res[syzIndex-1]->m[i])>0)
577  (*w)[i + rGetCurrSyzLimit(currRing)]
578  += (*w)[pGetComp(res[syzIndex-1]->m[i])-1];
579  (*((*weights)[syzIndex]))[i] = (*w)[i+rGetCurrSyzLimit(currRing)];
580  }
581  }
582  for (i=k;i<k+IDELEMS(res[syzIndex]);i++)
583  {
584  if (res[syzIndex]->m[i-k]!=NULL)
585  (*w)[i+rGetCurrSyzLimit(currRing)] = p_FDeg(res[syzIndex]->m[i-k],currRing)
586  +(*w)[pGetComp(res[syzIndex]->m[i-k])-1];
587  }
588  }
589  }
590 /*--- end of the main loop --------------------------------------*/
591 /*--- deleting the temporare data structures --------------------*/
592  if ((syzIndex!=0) && (res[syzIndex]!=NULL) && (idIs0(res[syzIndex])))
593  idDelete(&res[syzIndex]);
594  if (w !=NULL) delete w;
595 
596  Kstd1_deg=Kstd1_OldDeg;
597  if (!oldDegBound)
599 
600  for (i=1; i<=syzIndex; i++)
601  {
602  if ((res[i]!=NULL) && ! idIs0(res[i]))
603  {
605  }
606  }
607 /*--- going back to the original ring -------------------------*/
608  if (origR != syz_ring)
609  {
610  rChangeCurrRing(origR); // should not be needed now?
611  for (i=0; i<=syzIndex; i++)
612  {
613  res[i] = idrMoveR_NoSort(res[i], syz_ring, origR);
614  }
615  rDelete(syz_ring);
616  }
617  SI_RESTORE_OPT1(save1);
618  return res;
619 }
#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:310
#define Print
Definition: emacs.cc:83
#define TEST_OPT_DEGBOUND
Definition: options.h:108
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:95
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:1834
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:711
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
#define TRUE
Definition: auxiliary.h:99
void * ADDRESS
Definition: auxiliary.h:116
#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:18
#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:10
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:265
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
int rGetMaxSyzComp(int i, const ring r)
return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit
Definition: ring.cc:5022
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition: ring.cc:4349
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:121
int i
Definition: cfEzgcd.cc:123
ideal kInterRedOld(ideal F, ideal Q)
Definition: kstd1.cc:3177
#define IDELEMS(i)
Definition: simpleideals.h:24
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal idCopy(ideal A)
Definition: ideals.h:60
void rSetSyzComp(int k, const ring r)
Definition: ring.cc:4954
void rChangeCurrRing(ring r)
Definition: polys.cc:12
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:477
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
const CanonicalForm & w
Definition: facAbsFact.cc:55
static bool rIsSCA(const ring r)
Definition: nc.h:206
ideal * resolvente
Definition: ideals.h:18
#define OPT_DEGBOUND
Definition: options.h:85
int Kstd1_deg
Definition: kutil.cc:236
int BOOLEAN
Definition: auxiliary.h:86
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg)
Definition: ideals.cc:515
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:96
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

§ sySchreyer()

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  {
1038  result->fullres[i] = fr[i];
1039  fr[i] = NULL;
1040  }
1041  }
1042  if (currRing->qideal!=NULL)
1043  {
1044  for (int i=0; i<rl; i++)
1045  {
1046  if (result->fullres[i]!=NULL)
1047  {
1048  ideal t=kNF(currRing->qideal,NULL,result->fullres[i]);
1049  idDelete(&result->fullres[i]);
1050  result->fullres[i]=t;
1051  if (i<rl-1)
1052  {
1053  for(int j=IDELEMS(t)-1;j>=0; j--)
1054  {
1055  if ((t->m[j]==NULL) && (result->fullres[i+1]!=NULL))
1056  {
1057  for(int k=IDELEMS(result->fullres[i+1])-1;k>=0; k--)
1058  {
1059  if (result->fullres[i+1]->m[k]!=NULL)
1060  {
1061  pDeleteComp(&(result->fullres[i+1]->m[k]),j+1);
1062  }
1063  }
1064  }
1065  }
1066  }
1067  idSkipZeroes(result->fullres[i]);
1068  }
1069  }
1070  if ((rl>maxlength) && (result->fullres[rl-1]!=NULL))
1071  {
1072  idDelete(&result->fullres[rl-1]);
1073  }
1074  }
1075  omFreeSize((ADDRESS)fr,(rl /*result->length*/)*sizeof(ideal));
1076  return result;
1077 }
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:2971
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:116
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:10
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:18
#define pDeleteComp(p, k)
Definition: polys.h:344
#define omAlloc0(size)
Definition: omAllocDecl.h:211
return result
Definition: facAbsBiFact.cc:76
ssyStrategy * syStrategy
Definition: syz.h:35

§ sySchreyerResolvente()

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:747
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:29
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:95
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:201
#define TRUE
Definition: auxiliary.h:99
void * ADDRESS
Definition: auxiliary.h:116
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:4632
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:10
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:210
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:5022
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:4577
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN syTestOrder(ideal M)
Definition: syz0.cc:835
ideal idCopy(ideal A)
Definition: ideals.h:60
short errorreported
Definition: feFopen.cc:23
void rChangeCurrRing(ring r)
Definition: polys.cc:12
#define NULL
Definition: omList.c:10
BOOLEAN rHasGlobalOrdering(const ring r)
Definition: ring.h:746
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:18
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
BOOLEAN rRing_has_CompLastBlock(ring r)
Definition: ring.cc:5068
BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:47
static ideal sySchreyersSyzygiesFB(ideal arg, intvec **modcomp, ideal mW, BOOLEAN redTail=TRUE)
Definition: syz0.cc:505

§ sySchreyersSyzygiesB()

void sySchreyersSyzygiesB ( polyset  F,
int  Fmax,
polyset Shdl,
int *  Smax,
BOOLEAN  noSort 
)

§ sySchreyersSyzygiesM()

void sySchreyersSyzygiesM ( polyset  F,
int  Fmax,
polyset Shdl,
int *  Smax,
BOOLEAN  noSort 
)

§ sySize()

int sySize ( syStrategy  syzstr)

Definition at line 1831 of file syz1.cc.

1832 {
1833  resolvente r=syzstr->res;
1834  if (r==NULL)
1835  r = syzstr->fullres;
1836  if (r==NULL)
1837  r = syzstr->minres;
1838  if (r==NULL)
1839  {
1840  WerrorS("No resolution found");
1841  return 0;
1842  }
1843  int i=syzstr->length;
1844  while ((i>0) && (r[i-1]==NULL)) i--;
1845  return i;
1846 }
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:18

§ syTestOrder()

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:95
#define TRUE
Definition: auxiliary.h:99
#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:10
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

§ currcomponents

int* currcomponents

Definition at line 39 of file syz1.cc.

§ currShiftedComponents

long* currShiftedComponents

Definition at line 40 of file syz1.cc.