60 WarnS(
"minbase applies only to the local or homogeneous case over coefficient fields");
69 WarnS(
"minbase applies only to the local or homogeneous case over coefficient fields");
92 while ((
k > 0) && (
h3->m[
k-1] ==
NULL))
k--;
95 while ((
l > 0) && (
h2->m[
l-1] ==
NULL))
l--;
96 for (
i=
l-1;
i>=0;
i--)
153 for (
j=0;
j<r->N-1;
j++) names[
j]=r->names[
j];
238 Werror(
"error %d in >>groebner<<",err);
253 Werror(
"error %d in >>modStd<<",err);
304 Werror(
"error %d in >>satstd<<",err);
361 while ((
j>0) && (first->m[
j-1]==
NULL))
j--;
366 if (first->m[
i]!=
NULL)
402 WarnS(
"wrong algorithm for GB");
557 WarnS(
"wrong algorithm for GB");
637 Warn(
"syzcomp too low, should be %d instead of %d",
k,syzcomp);
641 h2->rank = syzcomp+
i;
693 PrintS(
" --------------before std------------------------\n");
705 WarnS(
"wrong algorithm for GB");
726 Print(
"after std: --------------syzComp=%d------------------------\n",syzComp);
773 PrintS(
"T: ----------------------------------------\n");
1139 WerrorS(
"2nd module does not lie in the first");
1240 WarnS(
"first module not a standardbasis\n"
1241 "// ** or second not a proper submodule");
1244 WerrorS(
"2nd module does not lie in the first");
1429 if (weights!=
NULL)
delete weights;
1616 int *block0,*block1;
1630 WerrorS(
"cannot eliminate in a qring");
1643 WerrorS(
"no elimination is possible: subalgebra is not admissible");
1658 block0[
k+1] =
origR->block0[
k];
1659 block1[
k+1] =
origR->block1[
k];
1676 for (sl = (
currRing->N); sl!=0; sl--)
1693 block0=(
int*)
omAlloc0(4*
sizeof(
int));
1694 block1=(
int*)
omAlloc0(4*
sizeof(
int));
1696 block0[0] = block0[1] = 1;
1720 block0=(
int*)
omAlloc0(4*
sizeof(
int));
1721 block1=(
int*)
omAlloc0(4*
sizeof(
int));
1723 block0[0] = block0[1] = 1;
1747 block0[
k+1] =
origR->block0[
k];
1748 block1[
k+1] =
origR->block1[
k];
1776 tmpR->block0 = block0;
1777 tmpR->block1 = block1;
1787 WerrorS(
"no elimination is possible: ordering condition is violated");
1806 WarnS(
"eliminate in q-ring: experimental");
1821 WarnS(
"wrong algorithm for GB");
1828 while ((
i >= 0) && (
hh->m[
i] ==
NULL))
i--;
1831 for (
k=0;
k<=
i;
k++)
1855#ifdef WITH_OLD_MINOR
1881 for (
i=1;
i<=
ar;
i++)
1883 for (
j=1;
j<=
ar;
j++)
1899 for (
i=1;
i<=
ar;
i++)
1943 for (
i=1;
i<=
ar;
i++)
1945 for (
j=1;
j<=
ar;
j++)
1972 for (
i=1;
i<=
ar;
i++)
2000 const int r = a->
nrows;
2001 const int c = a->
ncols;
2003 if((
ar<=0) || (
ar>r) || (
ar>c))
2005 Werror(
"%d-th minor, matrix is %dx%d",
ar,r,c);
2017 for (
int i=r*c-1;
i>=0;
i--)
2099 if (
w->length()+1 <
cmax)
2395 }
while (q !=
NULL);
2568 if (
j==0)
return -1;
2577 if (
j==0)
return -1;
2642 while ((
j>0) && (arg->m[
j-1]==
NULL))
j--;
2646 while ((
j>0) && (arg->m[
j-1]==
NULL))
j--;
2699 int i=0,
j, generator=-1;
2704 while ((generator<0) && (
i<
IDELEMS(arg)))
2807 int nl=
si_max((*w)->length()-del,1);
2844 for(
int i=0;
i<arg->rank;
i++)
g[
i]=
i+1;
2852 for(
int i=1;
i<=arg->rank;
i++)
2867 const int rk=a->rank;
2911 if(changed)
continue;
2920 while(a->m[
i]!=
NULL)
3000 for(
i=cnt-1;
i>=0;
i--)
3006 for(
j=
rl-1;
j>=0;
j--)
3015 for(
j=
rl-1;
j>=0;
j--)
3030 for(
j=
rl-1;
j>=0;
j--)
3074 for(
i=cnt-1;
i>=0;
i--)
3217 if (strat->
P.t_p==
NULL)
3272 poly
p=strat->
P.t_p;
3335 for (
int i=0;
i<
k;
i++)
3344 WerrorS(
"ideal generators must be variables");
3354 Werror(
"generator must be a monomial");
3358 for (
int i=1;
i<=r->N;
i++)
3366 Werror(
"exponent(x(%d)^%d) must be 0 or 1",
i,li);
3381 int *block0,*block1;
3386 block0=(
int*)
omAlloc0(4*
sizeof(
int));
3387 block1=(
int*)
omAlloc0(4*
sizeof(
int));
3390 block0[0] = block0[1] = 1;
3410 char **names=(
char**)
omAlloc0((
origR->N+1) *
sizeof(
char *));
3594 for(
int i=
rVar(r)-1;
i>0;
i--) perm[
i]=
i;
3639 for(
int i=
rVar(r)-1;
i>0;
i--) perm[
i]=
i;
3671 else Warn(
">>%s<< is an unknown algorithm",n);
3683 WarnS(
"requires: coef:field, commutative, global ordering, not qring");
3694 WarnS(
"requires: coef:domain, commutative, global ordering");
3704 WarnS(
">>modStd<< not found");
3713 WarnS(
"requires: coef:QQ, commutative, global ordering");
3719 WarnS(
">>satstd<< not found");
static int si_max(const int a, const int b)
static int si_min(const int a, const int b)
const CanonicalForm CFMap CFMap & N
static CanonicalForm bound(const CFMatrix &M)
poly singclap_pdivide(poly f, poly g, const ring r)
Class used for (list of) interpreter objects.
Coefficient rings, fields and other domains suitable for Singular polynomials.
number ndCopyMap(number a, const coeffs src, const coeffs dst)
static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
TRUE iff n has a multiplicative inverse in the given coeff field/ring r.
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
const CanonicalForm int s
CanonicalForm divide(const CanonicalForm &ff, const CanonicalForm &f, const CFList &as)
const Variable & v
< [in] a sqrfree bivariate poly
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
char name(const Variable &v)
void WerrorS(const char *s)
GbVariant syGetAlgorithm(char *n, const ring r, const ideal)
static ideal idMinEmbedding1(ideal arg, BOOLEAN inPlace, intvec **w, int *red_comp, int &del)
static void idPrepareStd(ideal s_temp, int k)
matrix idCoeffOfKBase(ideal arg, ideal kbase, poly how)
void idLiftW(ideal P, ideal Q, int n, matrix &T, ideal &R, int *w)
static void idLift_setUnit(int e_mod, matrix *unit)
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
matrix idDiff(matrix i, int k)
ideal id_Sat_principal(ideal I, ideal J, const ring origR)
ideal idSaturateGB(ideal I, ideal J, int &k, BOOLEAN isIdeal)
static ideal idGroebner(ideal temp, int syzComp, GbVariant alg, bigintmat *hilb=NULL, intvec *w=NULL, tHomog hom=testHomog)
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
ideal id_Homogenize(ideal I, int var_num, const ring r)
ideal idLiftStd(ideal h1, matrix *T, tHomog hi, ideal *S, GbVariant alg, ideal h11)
void idDelEquals(ideal id)
int pCompare_qsort(const void *a, const void *b)
ideal idQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN resultIsIdeal)
ideal id_HomogenizeW(ideal I, int var_num, intvec *w, const ring r)
ideal idMinors(matrix a, int ar, ideal R)
compute all ar-minors of the matrix a the caller of mpRecMin the elements of the result are not in R ...
ideal idSaturate(ideal I, ideal J, int &k, BOOLEAN isIdeal)
void ipPrint_MA0(matrix m, const char *name)
BOOLEAN idIsSubModule(ideal id1, ideal id2)
ideal idSeries(int n, ideal M, matrix U, intvec *w)
ideal idMinEmbedding_with_map_v(ideal arg, intvec **w, ideal &trans, int *g)
ideal idCreateSpecialKbase(ideal kBase, intvec **convert)
static ideal idPrepare(ideal h1, ideal h11, tHomog hom, int syzcomp, intvec **w, GbVariant alg)
poly id_GCD(poly f, poly g, const ring r)
int idIndexOfKBase(poly monom, ideal kbase)
poly idDecompose(poly monom, poly how, ideal kbase, int *pos)
ideal idSaturate_intern(ideal I, ideal J, int &k, BOOLEAN isIdeal, BOOLEAN isSB)
matrix idDiffOp(ideal I, ideal J, BOOLEAN multiply)
ideal idElimination(ideal h1, poly delVar, bigintmat *hilb, GbVariant alg)
void idSort_qsort(poly_sort *id_sort, int idsize)
static ideal idInitializeQuot(ideal h1, ideal h2, BOOLEAN h1IsStb, BOOLEAN *addOnlyOne, int *kkmax)
static ideal idSectWithElim(ideal h1, ideal h2, GbVariant alg)
ideal idSect(ideal h1, ideal h2, GbVariant alg)
ideal idMultSect(resolvente arg, int length, GbVariant alg)
void idKeepFirstK(ideal id, const int k)
keeps the first k (>= 1) entries of the given ideal (Note that the kept polynomials may be zero....
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
STATIC_VAR int * id_satstdSaturatingVariables
ideal idExtractG_T_S(ideal s_h3, matrix *T, ideal *S, long syzComp, int h1_size, BOOLEAN inputIsIdeal, const ring oring, const ring sring)
static void idDeleteComps(ideal arg, int *red_comp, int del)
ideal idModulo(ideal h2, ideal h1, tHomog hom, intvec **w, matrix *T, GbVariant alg)
ideal idMinEmbedding_with_map(ideal arg, intvec **w, ideal &trans)
ideal idMinBase(ideal h1, ideal *SB)
ideal id_Farey(ideal x, number N, const ring r)
ideal id_Satstd(const ideal I, ideal J, const ring r)
static int id_ReadOutPivot(ideal arg, int *comp, const ring r)
ideal idModuloLP(ideal h2, ideal h1, tHomog, intvec **w, matrix *T, GbVariant alg)
static BOOLEAN id_sat_vars_sp(kStrategy strat)
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
#define idDelete(H)
delete an ideal
#define idSimpleAdd(A, B)
void idGetNextChoise(int r, int end, BOOLEAN *endch, int *choise)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
static BOOLEAN idHomIdeal(ideal id, ideal Q=NULL)
static ideal idMult(ideal h1, ideal h2)
hh := h1 * h2
#define idMaxIdeal(D)
initialise the maximal ideal (at 0)
void idInitChoise(int r, int beg, int end, BOOLEAN *endch, int *choise)
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
ideal idFreeModule(int i)
static BOOLEAN length(leftv result, leftv arg)
intvec * ivCopy(const intvec *o)
idhdl ggetid(const char *n)
EXTERN_VAR omBin sleftv_bin
leftv ii_CallLibProcM(const char *n, void **args, int *arg_types, const ring R, BOOLEAN &err)
args: NULL terminated array of arguments arg_types: 0 terminated array of corresponding types
void * iiCallLibProc1(const char *n, void *arg, int arg_type, BOOLEAN &err)
void p_TakeOutComp(poly *p, long comp, poly *q, int *lq, const ring r)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
ideal kMin_std(ideal F, ideal Q, tHomog h, intvec **w, ideal &M, bigintmat *hilb, int syzComp, int reduced)
ideal kSba(ideal F, ideal Q, tHomog h, intvec **w, int sbaOrder, int arri, bigintmat *hilb, int syzComp, int newIdeal, intvec *vw)
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
static nc_type & ncRingType(nc_struct *p)
BOOLEAN nc_CheckSubalgebra(poly PolyVar, ring r)
matrix mpNew(int r, int c)
create a r x c zero-matrix
matrix mp_MultP(matrix a, poly p, const ring R)
multiply a matrix 'a' by a poly 'p', destroy the args
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
void mp_MinorToResult(ideal result, int &elems, matrix a, int r, int c, ideal R, const ring)
entries of a are minors and go to result (only if not in R)
void mp_RecMin(int ar, ideal result, int &elems, matrix a, int lr, int lc, poly barDiv, ideal R, const ring r)
produces recursively the ideal of all arxar-minors of a
poly mp_DetBareiss(matrix a, const ring r)
returns the determinant of the matrix m; uses Bareiss algorithm
#define MATELEM(mat, i, j)
1-based access to matrix
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define __p_GetComp(p, r)
#define omFreeSize(addr, size)
#define omFreeBin(addr, bin)
#define SI_SAVE_OPT(A, B)
#define SI_RESTORE_OPT1(A)
#define SI_RESTORE_OPT2(A)
#define TEST_OPT_RETURN_SB
#define TEST_V_INTERSECT_ELIM
#define TEST_V_INTERSECT_SYZ
#define TEST_OPT_NOTREGULARITY
#define SI_RESTORE_OPT(A, B)
static int index(p_Length length, p_Ord ord)
poly p_DivideM(poly a, poly b, const ring r)
poly p_Farey(poly p, number N, const ring r)
int p_Weight(int i, const ring r)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
poly p_Div_nn(poly p, const number n, const ring r)
void p_Norm(poly p1, const ring r)
int p_Compare(const poly a, const poly b, const ring R)
long p_DegW(poly p, const int *w, const ring R)
poly p_Vec2Poly(poly v, int k, const ring r)
void p_SetModDeg(intvec *w, ring r)
int p_Var(poly m, const ring r)
poly p_Sub(poly p1, poly p2, const ring r)
void pEnlargeSet(poly **p, int l, int increment)
long p_Deg(poly a, const ring r)
static poly p_Neg(poly p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static void p_LmDelete(poly p, const ring r)
static poly p_Mult_q(poly p, poly q, const ring r)
static long p_SubExp(poly p, int v, long ee, ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static long p_MinComp(poly p, ring lmRing, ring tailRing)
static void p_Setm(poly p, const ring r)
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
static number p_SetCoeff(poly p, number n, ring r)
static poly pReverse(poly p)
static BOOLEAN p_LmIsConstantComp(const poly p, const ring r)
static poly p_Head(const poly p, const ring r)
copy the (leading) term of p
static int p_LmCmp(poly p, poly q, const ring r)
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)
static void p_GetExpV(poly p, int *ev, const ring r)
static poly p_LmFreeAndNext(poly p, ring)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_Totaldegree(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)
#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 pSeries(n, p, u, w)
#define pGetExp(p, i)
Exponent.
#define pSetmComp(p)
TODO:
#define pEqualPolys(p1, p2)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
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
poly prMoveR(poly &p, ring src_r, ring dest_r)
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
poly prCopyR(poly p, ring src_r, ring dest_r)
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
poly prMoveR_NoSort(poly &p, ring src_r, ring dest_r)
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
void PrintS(const char *s)
void Werror(const char *fmt,...)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
BOOLEAN nc_rComplete(const ring src, ring dest, bool bSetupQuotient)
ring rAssure_Wp_C(const ring r, intvec *w)
ring rAssure_Dp_C(const ring r)
BOOLEAN rOrd_is_Totaldegree_Ordering(const ring r)
ring rAssure_SyzOrder(const ring r, BOOLEAN complete)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDelete(ring r)
unconditionally deletes fields in r
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
void rSetSyzComp(int k, const ring r)
ring rAssure_dp_C(const ring r)
static BOOLEAN rHasGlobalOrdering(const ring r)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static int rBlocks(const ring r)
static BOOLEAN rField_is_Domain(const ring r)
static BOOLEAN rIsLPRing(const ring r)
@ ringorder_a64
for int64 weights
@ ringorder_aa
for idElimination, like a, except pFDeg, pWeigths ignore it
static BOOLEAN rField_is_Q(const ring r)
static BOOLEAN rIsNCRing(const ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
#define rField_is_Ring(R)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
ideal id_Homogen(ideal h, int varnum, const ring r)
matrix id_Module2Matrix(ideal mod, const ring R)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void id_DelMultiples(ideal id, const ring r)
ideal id = (id[i]), c any unit if id[i] = c*id[j] then id[j] is deleted for j > i
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
ideal id_SimpleAdd(ideal h1, ideal h2, const ring R)
concat the lists h1 and h2 without zeros
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void id_Shift(ideal M, int s, const ring r)
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
static int idElem(const ideal F)
number of non-zero polys in F
long sm_ExpBound(ideal m, int di, int ra, int t, const ring currRing)
ring sm_RingChange(const ring origR, long bound)
void sm_KillModifiedRing(ring r)
void syGaussForOne(ideal syz, int elnum, int ModComp, int from, int till)
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
ideal t_rep_gb(const ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
THREAD_VAR double(* wFunctional)(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)
void wCall(poly *s, int sl, int *x, double wNsqr, const ring R)
double wFunctionalBuch(int *degw, int *lpol, int npol, double *rel, double wx, double wNsqr)