40 #if GOOGLE_PROFILE_ENABLED
41 #include <google/profiler.h>
59 if( id->rank != 1 )
return TRUE;
65 for (
int j=0;
j<
l;
j++)
89 const char *usage =
"'ClearContent' needs a (non-zero!) poly or vector argument...";
107 poly ph =
reinterpret_cast<poly
>(
h->Data());
135 const char *usage =
"'ClearDenominators' needs a (non-zero!) poly or vector argument...";
153 poly ph =
reinterpret_cast<poly
>(
h->Data());
183 int n = (int)(
long)(
h->Data());
186 Warn(
"Negative (%d) optional integer argument", n);
205 Print (
"intvec: {rows: %d, cols: %d, length: %d, Values: \n",
v->rows(),
v->cols(),
v->length());
207 for (
int i = 0;
i <
v->rows();
i++)
210 for (
int j = 0;
j <
v->cols();
j++)
211 Print (
" %5d", (*
v)[
j +
i * (
v->cols())] );
228 WarnS(
"Tail needs a poly/vector/ideal/module argument...");
238 res->data =
p_Tail( (
const poly)
h->Data(), r );
239 res->rtyp =
h->Typ();
249 res->rtyp =
h->Typ();
256 WarnS(
"Tail needs a single poly/vector/ideal/module argument...");
270 const char* usage =
"`SchreyerSyzygyNF(<vector>, <vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
283 const poly syz_lead = (poly)
h->Data();
assume (syz_lead !=
NULL);
293 const poly syz_2 = (poly)
h->Data();
assume (syz_2 !=
NULL);
312 const ideal
T = (ideal)
h->Data();
321 LS = (ideal)
h->Data();
326 if(
LIKELY( OPT__TAILREDSYZ) )
334 (syz_2!=
NULL)?
p_Copy(syz_2, r): syz_2, L,
T, LS, attributes);
351 const char* usage =
"`ReduceTerm(<poly>, <poly/vector>, <vector/0>, <ideal/module>, <ideal/module>[,<module>])` expected";
362 const poly multiplier = (poly)
h->Data();
assume (multiplier !=
NULL);
372 const poly term4reduction = (poly)
h->Data();
assume( term4reduction !=
NULL );
375 poly syztermCheck =
NULL;
385 syztermCheck = (poly)
h->Data();
405 const ideal
T = (ideal)
h->Data();
414 LS = (ideal)
h->Data();
419 if(
LIKELY( OPT__TAILREDSYZ) )
426 res->data =
ReduceTerm(multiplier, term4reduction, syztermCheck, L,
T, LS, attributes);
444 const char* usage =
"`TraverseTail(<poly>, <poly/vector>, <ideal/module>, <ideal/module>[,<module>])` expected";
455 const poly multiplier = (poly)
h->Data();
assume (multiplier !=
NULL);
464 const poly tail = (poly)
h->Data();
474 const ideal L = (ideal)
h->Data();
485 const ideal
T = (ideal)
h->Data();
495 LS = (ideal)
h->Data();
500 if(
LIKELY( OPT__TAILREDSYZ) )
517 const char* usage =
"`ComputeResolution(<ideal/module>, <same as before>, <same as before>[,int])` expected";
529 const int type =
h->Typ();
530 ideal
M = (ideal)(
h->CopyD());
538 if ((
h==
NULL) || (
h->Typ()!=type) || (
h->Data() ==
NULL))
544 ideal L = (ideal)(
h->CopyD());
548 if ((
h==
NULL) || (
h->Typ()!=type) || (
h->Data() ==
NULL))
554 ideal
T = (ideal)(
h->CopyD());
603 for(
int i =
size-1;
i >= 0;
i-- )
638 const char* usage =
"`ComputeSyzygy(<ideal/module>, <ideal/module>)` expected";
649 const ideal L = (ideal)
h->Data();
660 const ideal
T = (ideal)
h->Data();
672 l->m[0].rtyp =
MODUL_CMD;
l->m[0].data =
reinterpret_cast<void *
>(LL);
674 l->m[1].rtyp =
MODUL_CMD;
l->m[1].data =
reinterpret_cast<void *
>(TT);
691 const poly
p = (poly)(
h->Data());
702 res->data =
reinterpret_cast<void *
>(
jjLONG2N(iComp));
711 WerrorS(
"`leadcomp(<poly/vector>)` expected");
724 const int s = (int)((
long)(
h->Data()));
726 if(
s != -1 &&
s != 1 )
728 WerrorS(
"`MakeInducedSchreyerOrdering(<int>)` called with wrong integer argument (must be +-1)!");
754 p = (int)((
long)(
h->Data()));
h=
h->next;
762 WerrorS(
"`GetInducedData([int])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)");
767 const int iLimit = r->typ[pos].data.is.limit;
768 const ideal F = r->typ[pos].data.is.F;
776 l->m[0].data =
reinterpret_cast<void *
>(iLimit);
792 l->m[1].data =
reinterpret_cast<void *
>(FF);
795 res->data =
reinterpret_cast<void *
>(
l);
810 WerrorS(
"`SetInducedReferrence(<ideal/module>, [int[, int]])` expected");
814 const ideal F = (ideal)
h->Data(); ;
821 rank = (int)((
long)(
h->Data()));
h=
h->next;
830 p = (int)((
long)(
h->Data()));
h=
h->next;
838 WerrorS(
"`SetInducedReferrence(<ideal/module>, [int[, int]])` called on incompatible ring (not created by 'MakeInducedSchreyerOrdering'!)");
863 WerrorS(
"`idPrepare(<module>)` expected");
867 const ideal I =
reinterpret_cast<ideal
>(
h->Data());
877 iComp = (int)((
long)(
h->Data()));
881 if( (!isSyz) && (-1 == posIS) )
883 WerrorS(
"`idPrepare(<...>)` called on incompatible ring (not created by 'MakeSyzCompOrdering' or 'MakeInducedSchreyerOrdering'!)");
938 res->data =
reinterpret_cast<void *
>(J);
946 psModulFunctions->iiAddCproc((currPack->libname? currPack->libname: ""), (char*)C, D, E);
Concrete implementation of enumerators over polynomials.
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
void atSet(idhdl root, char *name, void *data, int typ)
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
Class used for (list of) interpreter objects.
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &d, const coeffs r)
(inplace) Clears denominators on a collection of numbers number d is the LCM of all the coefficient d...
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs r)
Computes the content and (inplace) divides it out on a collection of numbers number c is the content ...
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
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 length(leftv result, leftv arg)
intvec * ivCopy(const intvec *o)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
#define rRing_has_Comp(r)
The main handler for Singular numbers which are suitable for Singular polynomials.
static int index(p_Length length, p_Ord ord)
static poly p_Add_q(poly p, poly q, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatiblity layer for legacy polynomial operations (over currRing)
void PrintS(const char *s)
ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete, int sgn)
int rGetISPos(const int p, const ring r)
Finds p^th IS ordering, and returns its position in r->typ[] returns -1 if something went wrong!...
BOOLEAN rSetISReference(const ring r, const ideal F, const int i, const int p)
Changes r by setting induced ordering parameters: limit and reference leading terms F belong to r,...
static int rGetCurrSyzLimit(const ring r)
static BOOLEAN rIsSyzIndexRing(const ring r)
static short rVar(const ring r)
#define rVar(r) (r->N)
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
Computation attribute storage.
const int OPT__HYBRIDNF
Use the usual NF's S-poly reduction while dropping lower order terms 2 means - smart selection!
const ring m_rBaseRing
global base ring
void nextSyzygyLayer() const
const int OPT__TAILREDSYZ
Reduce syzygy tails wrt the leading syzygy terms.
static BOOLEAN GetInducedData(leftv res, leftv h)
?
static BOOLEAN idPrepare(leftv res, leftv h)
Get raw syzygies (idPrepare)
static BOOLEAN leadcomp(leftv res, leftv h)
Get leading component.
static void view(const intvec *v)
static BOOLEAN id_IsModule(ideal id, ring r)
test whether this input has vectors among entries or no enties result must be FALSE for only 0-entrie...
static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h)
int SI_MOD_INIT() syzextra(SModulFunctions *psModulFunctions)
static BOOLEAN _ClearDenominators(leftv res, leftv h)
wrapper around n_ClearDenominators
static BOOLEAN SetInducedReferrence(leftv res, leftv h)
Returns old SyzCompLimit, can set new limit.
static BOOLEAN MakeInducedSchreyerOrdering(leftv res, leftv h)
Same for Induced Schreyer ordering (ordering on components is defined by sign!)
static BOOLEAN _ComputeResolution(leftv res, leftv h)
static BOOLEAN _ClearContent(leftv res, leftv h)
wrapper around n_ClearContent
static BOOLEAN _TraverseTail(leftv res, leftv h)
static void NoReturn(leftv &res)
static number jjLONG2N(long d)
static BOOLEAN _ReduceTerm(leftv res, leftv h)
proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #)
static BOOLEAN Tail(leftv res, leftv h)
wrapper around p_Tail and id_Tail
static int getOptionalInteger(const leftv &h, const int _n)
try to get an optional (simple) integer argument out of h or return the default value
static BOOLEAN _ComputeSyzygy(leftv res, leftv h)
module (LL, TT) = SSComputeSyzygy(L, T); Compute Syz(L ++ T) = N = LL ++ TT