40 #if GOOGLE_PROFILE_ENABLED 41 #include <google/profiler.h> 42 #endif // #if GOOGLE_PROFILE_ENABLED 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++)
228 WarnS(
"Tail needs a poly/vector/ideal/module argument...");
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);
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());
544 ideal L = (ideal)(h->
CopyD());
554 ideal
T = (ideal)(h->
CopyD());
564 length = (long)(h->
Data());
571 length = 1 +
rVar(r);
578 _res->
length = length + 1;
586 while( (!
idIs0(L)) && (index < length))
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();
691 const poly
p = (poly)(h->
Data());
698 const unsigned long iComp =
p_GetComp(p, r);
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)!");
735 assume( sign == 1 || sign == -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);
Computation attribute storage.
const CanonicalForm int s
static void view(const intvec *v)
Class used for (list of) interpreter objects.
static BOOLEAN idPrepare(leftv res, leftv h)
Get raw syzygies (idPrepare)
static number jjLONG2N(long d)
static void NoReturn(leftv &res)
const int OPT__HYBRIDNF
Use the usual NF's S-poly reduction while dropping lower order terms 2 means - smart selection! ...
Compatiblity layer for legacy polynomial operations (over currRing)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
void nextSyzygyLayer() const
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 rIsSyzIndexRing(const ring r)
static int rGetCurrSyzLimit(const ring r)
static BOOLEAN _ClearContent(leftv res, leftv h)
wrapper around n_ClearContent
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static short rVar(const ring r)
#define rVar(r) (r->N)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
static BOOLEAN Tail(leftv res, leftv h)
wrapper around p_Tail and id_Tail
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)
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 ...
void WerrorS(const char *s)
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! p - ...
static BOOLEAN _ComputeResolution(leftv res, leftv h)
static BOOLEAN GetInducedData(leftv res, leftv h)
?
static BOOLEAN leadcomp(leftv res, leftv h)
Get leading component.
static poly p_Copy(poly p, const ring r)
returns a copy of p
const int OPT__TAILREDSYZ
Reduce syzygy tails wrt the leading syzygy terms.
ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete, int sgn)
static BOOLEAN _SchreyerSyzygyNF(leftv res, leftv h)
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 ...
Coefficient rings, fields and other domains suitable for Singular polynomials.
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
Concrete implementation of enumerators over polynomials.
static BOOLEAN _TraverseTail(leftv res, leftv h)
int SI_MOD_INIT() syzextra(SModulFunctions *psModulFunctions)
This is a polynomial enumerator for simple iteration over coefficients of polynomials.
The main handler for Singular numbers which are suitable for Singular polynomials.
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!)
void atSet(idhdl root, char *name, void *data, int typ)
void PrintS(const char *s)
static int index(p_Length length, p_Ord ord)
INLINE_THIS void Init(int l=0)
#define rRing_has_Comp(r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
const Variable & v
< [in] a sqrfree bivariate poly
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
static BOOLEAN _ClearDenominators(leftv res, leftv h)
wrapper around n_ClearDenominators
static BOOLEAN _ReduceTerm(leftv res, leftv h)
proc SSReduceTerm(poly m, def t, def syzterm, def L, def T, list #)
static BOOLEAN length(leftv result, leftv arg)
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...
const ring m_rBaseRing
global base ring
static BOOLEAN _ComputeSyzygy(leftv res, leftv h)
module (LL, TT) = SSComputeSyzygy(L, T); Compute Syz(L ++ T) = N = LL ++ TT
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static poly p_Add_q(poly p, poly q, const ring r)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
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...