29 int* Components,
long* ShiftedComponents);
55 (*so).isNotMinimal =
NULL;
74 (*so).isNotMinimal =
NULL;
94 (*argso).isNotMinimal =
NULL;
96 (*argso).reference = -1;
174 ec1 = p1->exp[
currRing->typ[1].data.syzcomp.place];
175 ec2 = p2->exp[
currRing->typ[1].data.syzcomp.place];
179 Warn(
"Shifted comp of p1 out of sync. should %d, is %d",
ccc1,
ec1);
184 Warn(
"Shifted comp of p2 out of sync. should %d, is %d",
ccc2,
ec2);
202 if (
o1 >
o2)
return 1;
203 if (
o1 <
o2)
return -1;
219 if (
o1==
o2)
return 0;
278 if ((
j<0) || ((*iv)[
i]<
j))
306 (resPairs[0])[
i].syz = (arg->m[(*iv)[
i]-1]);
307 arg->m[(*iv)[
i]-1] =
NULL;
322 (resPairs[0])[
i].syz = arg->m[
j];
324 (resPairs[0])[
i].order = (*iv)[
j];
328 if (iv!=
NULL)
delete iv;
363 long*
tc = (
long*)
omAlloc(n*
sizeof(
long));
506 WerrorS(
"orderedRes to small");
604 int ** bin=
syzstr->backcomponents;
720 (*result)[
i3] =
i2+1;
782 long * ShiftedComponents =
syzstr->ShiftedComponents[
index];
862 ShiftedComponents =
syzstr->ShiftedComponents[
index];
877 tso.isNotMinimal =
p;
1017 PrintS(
"Hier ist was faul!\n");
1074 int first,pos,
jj,
j1;
1083 long * ShiftedComponents =
syzstr->ShiftedComponents[
index];
1094 for (
i=first;
i<pos;
i++)
1127 for (
i=first;
i<pos;
i++)
1258 if ((resPairs[*
index])[
i].order > t)
1259 t = (resPairs[*
index])[
i].order;
1436 Print(
"In module %d: \n",
j);
1449 Print(
"%d elements of degree %ld\n",
i,deg);
1470 for (
int i=0;
i<init;
i++)
1497 if (
syzstr->references>0)
1597 delete syzstr->hilb_coeffs[
i];
1623 delete syzstr->resolution;
1733 fullres[
i-1] =
res[
i];
1769 if ((*weights)[
i]!=(*(
syzstr->weights[0]))[
i])
1787 if ((fullres==
NULL) && (minres==
NULL))
1812 syzstr->fullres = fullres;
1839 WerrorS(
"No resolution found");
1843 while ((
i>0) && (r[
i-1]==
NULL))
i--;
1859 if (
l==0)
return -1;
1942 PrintS(
"No resolution defined\n");
1948 if (resolution==
NULL)
1955 (*resolution)[0] =
syzstr->res[1]->rank;
1964 ((*resolution)[
k+1])++;
1995 if ((
k>=resolution->
length()) || ((*resolution)[
k]==0))
1997 Print(
"%d",(*resolution)[
k]);
2005 if ((
k>=resolution->
length()) || ((*resolution)[
k]==0))
2008 if (((
k+1)>=resolution->
length()) || ((*resolution)[(
k+1)]==0))
2018 if ((
k>=resolution->
length()) || ((*resolution)[
k]==0))
2028 PrintS(
"resolution not minimized yet\n");
2220 (*changes)[
j+
k+1] =
j+1;
2401 delete syzstr->resolution;
2462 for (
i=0;
i<=arg->rank;
i++)
2599 for (
i=0;
i<=arg->rank;
i++)
static int si_max(const int a, const int b)
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
static int max(int a, int b)
void WerrorS(const char *s)
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
#define idDelete(H)
delete an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
static BOOLEAN length(leftv result, leftv arg)
intvec * ivCopy(const intvec *o)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
void kBucketTakeOutComp(kBucket_pt bucket, long comp, poly *r_p, int *l)
void kBucketDestroy(kBucket_pt *bucket_pt)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
const poly kBucketGetLm(kBucket_pt bucket)
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define omFreeSize(addr, size)
#define omRealloc0Size(addr, o_size, size)
#define TEST_OPT_NO_SYZ_MINIM
static int index(p_Length length, p_Ord ord)
void pEnlargeSet(poly **p, int l, int increment)
static int pLength(poly a)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static void p_Delete(poly *p, const ring r)
void rChangeCurrRing(ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
static long pTotaldegree(poly p)
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
#define pGetComp(p)
Component.
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pGetOrder(p)
Order.
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
#define pGetExp(p, i)
Exponent.
#define pInit()
allocates a new monomial and initializes everything to 0
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 ...
#define pCopy(p)
return a copy of the poly
#define pSortCompCorrect(p)
Assume: If considered only as poly in any component of p (say, monomials of other components of p are...
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
poly prMoveR(poly &p, ring src_r, ring dest_r)
poly prHeadR(poly p, ring src_r, ring dest_r, prCopyProc_t prproc)
poly prCopyR(poly p, ring src_r, ring dest_r)
void PrintS(const char *s)
void rGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
void rDelete(ring r)
unconditionally deletes fields in r
ring rAssure_dp_S(const ring r)
void sBucketClearMerge(sBucket_pt bucket, poly *p, int *length)
void sBucketDestroy(sBucket_pt *bucket)
void sBucket_Add_m(sBucket_pt bucket, poly p)
sBucket_pt sBucketCreate(const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static int idElem(const ideal F)
number of non-zero polys in F
EXTERN_VAR omBin char_ptr_bin
static SSet syChosePairsPutIn(syStrategy syzstr, int *index, int *howmuch, int *actdeg, int an, int en)
poly syRedtail(poly p, syStrategy syzstr, int index)
void syCopyPair(SObject *argso, SObject *imso)
void syPrint(syStrategy syzstr, const char *sn)
void syEnterPair(SSet sPairs, SObject *so, int *sPlength, int)
void syKillComputation(syStrategy syzstr, ring r)
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw)
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
static poly syStripOutCopy(poly p, intvec *toStrip)
intvec * syBettiOfComputation(syStrategy syzstr, BOOLEAN minim, int *row_shift, intvec *weights)
static intvec * syOrdPairs(SSet sPairs, int length)
static poly syMinimizeP1(int toMin, syStrategy syzstr, intvec *ordn, int index, intvec *toStrip)
int syDim(syStrategy syzstr)
syStrategy syMinimize(syStrategy syzstr)
syStrategy syCopy(syStrategy syzstr)
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
int sySize(syStrategy syzstr)
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
static void syRedGenerOfCurrDeg(syStrategy syzstr, int deg, int index)
void syCompactify1(SSet sPairs, int *sPlength, int first)
int syInitSyzMod(syStrategy syzstr, int index, int init)
void syKillEmptyEntres(resolvente res, int length)
static int syLengthInt(int i)
static void syPrintEmptySpaces1(int i)
void syEnlargeFields(syStrategy syzstr, int index)
void p_Setm_Syz(poly p, ring r, int *Components, long *ShiftedComponents)
static void pResetSetm(poly p)
void syInitializePair(SObject *so)
static intvec * syToStrip(syStrategy syzstr, int index)
static int syChMin(intvec *iv)
long syReorderShiftedComponents(long *sc, int n)
static void syRedNextPairs(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
static BOOLEAN syOrder(poly p, syStrategy syzstr, int index, int realcomp)
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
void syDeletePair(SObject *so)
static intvec * syLinStrat(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
syStrategy syLaScala(ideal arg, int &maxlength, intvec *weights)
VAR long * currShiftedComponents
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
void syResetShiftedComponents(syStrategy syzstr, int index, int hilb)
syStrategy syLaScala3(ideal arg, int *length)
static void syPrintEmptySpaces(int i)
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
void syMinimizeResolvente(resolvente res, int length, int first)
#define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE
int F1(int a1, int &r1)
F1.