63 #ifndef RTIMER_BENCHMARKING 64 # define RTIMER_BENCHMARKING 0 95 assume( _IsBucketEmpty(bt) );
96 assume(
r == _GetBucketRing(bt) );
105 assume( _IsBucketEmpty(bt) );
190 return ((
int)(
long)(
atGet(rootRingHdl, attribute,
INT_CMD, (
void*)def)));
197 #if (defined(HAVE_QSORT_R) && (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || defined __FreeBSD__ || defined __BSD__ || defined OpenBSD3_1 || defined OpenBSD3_9)) 198 static int cmp_c_ds(
void *
R,
const void *p1,
const void *
p2){
199 #elif (defined(HAVE_QSORT_R) && (defined _GNU_SOURCE || defined __GNU__ || defined __linux__)) 200 static int cmp_c_ds(
const void *p1,
const void *
p2,
void *
R){
202 static int cmp_c_ds(
const void *p1,
const void *
p2){
void *
R =
currRing;
208 const ring
r = (
const ring)
R;
229 const int OPT__DEBUG = 0;
260 PrintS(
"cmp_c_ds: a & b have the same comp & deg! ");
PrintLn();
336 static void writeLatexTerm(
const poly t,
const ring
r,
const bool bCurrSyz =
true,
const bool bLTonly =
true)
364 PrintS( writePlus?
" + 0" :
" 0 " ); writePlus =
TRUE; writeMult =
TRUE;
395 for (
short i = 0;
i <
N;
i++)
421 writePlus = writePlus || wrotePP;
422 writeMult = writeMult || wrotePP;
444 PrintS( writePlus?
" + 1 " :
" 1 " );
450 }
while( (!bLTonly) && (
p !=
NULL) );
462 memcpy(np->exp,
p->exp,
r->ExpL_Size*
sizeof(
long));
529 const int sizeNew =
IDELEMS(
id);
531 #if ( (defined(HAVE_QSORT_R)) && (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || defined __FreeBSD__ || defined __BSD__ || defined OpenBSD3_1 || defined OpenBSD3_9) ) 532 #define qsort_my(m, s, ss, r, cmp) qsort_r(m, s, ss, r, cmp) 533 #elif ( (defined(HAVE_QSORT_R)) && (defined _GNU_SOURCE || defined __GNU__ || defined __linux__)) 534 #define qsort_my(m, s, ss, r, cmp) qsort_r(m, s, ss, cmp, r) 536 #define qsort_my(m, s, ss, r, cmp) qsort(m, s, ss, cmp) 565 for( TCache::iterator it =
m_cache.begin(); it !=
m_cache.end(); it++ )
569 for(TP2PCache::iterator vit =
T.begin(); vit !=
T.end(); vit++ )
605 CReducersHash::const_iterator itr =
m_hash.find(
comp);
607 if ( itr ==
m_hash.end() )
612 const bool bIdealCase = (
comp == 0);
613 const bool bSyzCheck = syzChecker.
IsNonempty();
621 for(TReducers::const_iterator vit =
v.begin(); (vit !=
v.end()) && coprime; ++vit )
625 const poly p = (*vit)->lt();
630 for(
int var =
N; var > 0; --var )
636 PrintS(
"CReducerFinder::PreProcessTerm, 't' is NOT co-prime with the following leading term: \n");
644 if( bSyzCheck && coprime )
656 PrintS(
"CReducerFinder::PreProcessTerm, 't' is co-prime with p but may lead to NOT divisible syz.term: \n");
670 PrintS(
"CReducerFinder::PreProcessTerm, the following 't' is 'co-prime' with all of leading terms! \n");
673 return coprime? 3: 0;
689 unsigned long pp[4] = {0,0,0,0};
694 PrintS(
"SchreyerSyzygyComputation::SetUpTailTerms(): Tails: \n");
699 for(
int p =
IDELEMS(idTails) - 1;
p >= 0; --
p )
700 for(
poly* tt = &(idTails->m[
p]); (*tt) !=
NULL; )
713 Print(
"SchreyerSyzygyComputation::SetUpTailTerms(): PP (%d) the following TT: \n",
k);
728 PrintS(
"SchreyerSyzygyComputation::SetUpTailTerms(): Preprocessed Tails: \n");
735 Print(
"(PP/ST: {c: %lu, C: %lu, P: %lu} + %lu)",
pp[1],
pp[2],
pp[3],
pp[0]);
767 Print(
"SchreyerSyzygyComputation Stats: (PP/ST: {c: %lu, C: %lu, P: %lu} + %lu, LOT: %lu, LCM: %lu, ST:%lu, LK: %lu {*: %lu})\n",
793 const ideal newid =
idInit(1, 0); newid->m[0] =
NULL;
814 for (
int i =
j - 1;
i >= 0;
i--)
899 const ideal newid =
idInit(1, 1); newid->m[0] =
NULL;
921 for (
int i =
j - 1;
i >= 0;
i--)
967 number
g =
n_Lcm( lc1, lc2,
r->cf );
1055 PrintS(
"SchreyerSyzygyComputation::TraverseNF(syz_lead, poly syz_2), \n");
1066 PrintS(
"{ \"proc\": \"TraverseNF\", \"nodelabel\": \"");
1068 PrintS(
"\", \"children\": [");
1086 PrintS(
"{ \"proc\": \"TraverseNF2\", \"nodelabel\": \"");
1088 PrintS(
"\", \"children\": [");
1103 PrintS(
"], \"noderesult\": \"");
1122 PrintS(
"], \"noderesult\": \"");
1130 PrintS(
"SchreyerSyzygyComputation::TraverseNF(syz_lead, poly syz_2), ==>>> \n");
1183 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n",
r, t,
r);
1193 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n",
getRTimer(), t,
r);
1205 if(
size == 1 && LL->m[0] ==
NULL )
1227 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n",
r, t,
r);
1237 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n",
getRTimer(), t,
r);
1247 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n",
r, t,
r);
1256 for(
int k =
size - 1;
k >= 0; --
k )
1307 Warn(
"SchreyerSyzygyComputation::ComputeSyzygy: failed syzygy property for syzygy [%d], non-zero image is as follows: ",
k);
1310 PrintS(
"SchreyerSyzygyComputation::ComputeSyzygy: Wrong syzygy is as follows: ");
1314 PrintS(
"SchreyerSyzygyComputation::ComputeSyzygy: Testing with the other method");
1322 PrintS(
"SchreyerSyzygyComputation::ComputeSyzygy: The other method gives the following syzygy: ");
1329 PrintS(
"SchreyerSyzygyComputation::ComputeSyzygy: .... which is correct!!! ");
1332 Warn(
"SchreyerSyzygyComputation::ComputeSyzygy: failed to compute syzygy tail[%d] with both methods!!! Non-zero image (2nd) is as follows: ",
k);
1357 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n",
getRTimer(), t,
r);
1378 if(
UNLIKELY(bComputeSecondTerms) )
1403 PrintS(
"SchreyerSyzygyComputation::ComputeLeadingSyzygyTerms: \n");
1404 PrintS(
"m_syzLeads: \n");
1406 PrintS(
"m_checker.Initialize(m_syzLeads) => \n");
1431 PrintS(
"SchreyerSyzygyComputation::SchreyerSyzygyNF(syz_lead, poly syz_2), \n");
1443 PrintS(
"\", \"children\": [");
1573 PrintS(
"SchreyerSyzygyComputation::SchreyerSyzygyNF(syz_lead, poly syz_2) =>>> \n");
1609 TCache::iterator top_itr =
m_cache.find(tail);
1611 if ( top_itr !=
m_cache.end() )
1613 assume( top_itr->first == tail );
1617 TP2PCache::iterator itr =
T.find(multiplier);
1619 if( itr !=
T.end() )
1623 if( itr->second ==
NULL )
1630 PrintS(
"{ \"proc\": \"TTLookup\", \"nodelabel\": \"");
1649 Print(
"\"recale\": \"%s\", ",
s);
1676 Print(
"{ \"proc\": \"TTStore%d\", \"nodelabel\": \"", tail + 1);
writeLatexTerm(multiplier,
r,
false);
Print(
" \\\\GEN{%d}\", \"children\": [", tail + 1);
1710 Print(
"{ \"proc\": \"TTStore%d\", \"nodelabel\": \"", 0);
writeLatexTerm(multiplier,
r,
false);
Print(
" \\\\GEN{%d}\", \"children\": [", tail + 1);
1724 m_cache.insert( TCache::value_type(tail,
T) );
1751 PrintS(
"{ \"proc\": \"ComputeImage\", \"nodelabel\": \"");
1753 Print(
" \\\\GEN{%d}\", \"edgelabel\": \"", tail + 1);
1755 PrintS(
"\", \"children\": [");
1842 Print(
"{ \"proc\": \"TTPoly\", \"nodelabel\": \"");
writeLatexTerm(multiplier,
r,
false);
Print(
" * \\\\ldots \", \"children\": [");
1997 PrintS(
"\", \"children\": [");
2004 PrintS(
"], \"noderesult\": \"");
2008 if( syztermCheck !=
NULL )
2010 PrintS(
", \"syztermCheck\":\"" );
2033 OPT__DEBUG(
atGetInt(rootRingHdl,
"DEBUG", 0) ),
2034 OPT__LEAD2SYZ(
atGetInt(rootRingHdl,
"LEAD2SYZ", 0) ),
2035 OPT__TAILREDSYZ(
atGetInt(rootRingHdl,
"TAILREDSYZ", 1) ),
2036 OPT__HYBRIDNF(
atGetInt(rootRingHdl,
"HYBRIDNF", 0) ),
2037 OPT__IGNORETAILS(
atGetInt(rootRingHdl,
"IGNORETAILS", 0) ),
2038 OPT__SYZNUMBER(
atGetInt(rootRingHdl,
"SYZNUMBER", 0) ),
2039 OPT__TREEOUTPUT(
atGetInt(rootRingHdl,
"TREEOUTPUT", 0) ),
2040 OPT__SYZCHECK(
atGetInt(rootRingHdl,
"SYZCHECK", 0) ),
2042 OPT__NOCACHING(
atGetInt(rootRingHdl,
"NOCACHING", 0) ),
2043 m_rBaseRing( rootRingHdl->data.uring )
2048 PrintS(
"SchreyerSyzygyComputationFlags: \n");
2081 CLeadingTerm::~CLeadingTerm()
2115 for( CReducersHash::const_iterator it =
m_hash.begin(); it !=
m_hash.end(); it++ )
2118 for(TReducers::const_iterator vit =
v.begin(); vit !=
v.end(); vit++ )
2119 delete const_cast<CLeadingTerm*>(*vit);
2150 m_L(const_cast<ideal>(L)),
2161 int i=
r->VarL_Size - 1;
2162 unsigned long divmask =
r->divmask;
2163 unsigned long la, lb;
2165 if (
r->VarL_LowIndex >= 0)
2167 i +=
r->VarL_LowIndex;
2171 lb =
b->exp[
i] + c->exp[
i];
2173 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
2180 while (
i>=
r->VarL_LowIndex);
2186 la =
a->exp[
r->VarL_Offset[
i]];
2187 lb =
b->exp[
r->VarL_Offset[
i]] + c->exp[
r->VarL_Offset[
i]];
2189 (((la & divmask) ^ (lb & divmask)) != ((lb - la) & divmask)))
2208 return ( L->m[
label()] ==
lt() );
2258 if (
sev() & not_sev)
2276 CReducerFinder::CReducersHash::const_iterator
m_itr;
2327 return *(*m_current);
2349 Print(
"CDivisorEnumerator::MoveNext::est LS: q is divisible by LS[%d] !:((, diviser is: ", 1 +
Current().label());
2426 void CReducerFinder::Verify()
const 2430 for( CReducersHash::const_iterator it =
m_hash.begin(); it !=
m_hash.end(); it++)
2434 for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )
2438 const poly p = (*vit)->lt();
2440 const unsigned long p_sev = (*vit)->sev();
2445 const int k = (*vit)->label();
2455 void CReducerFinder::DebugPrint()
const 2459 for( CReducersHash::const_iterator it =
m_hash.begin(); it !=
m_hash.end(); it++)
2461 Print(
"Hash Key: %ld, Values: \n", it->first);
2464 for(TReducers::const_iterator vit = reducers.begin(); vit != reducers.end(); vit++ )
2468 const int k = (*vit)->label();
2469 const poly p = (*vit)->lt();
2475 const unsigned long p_sev = (*vit)->sev();
2499 CReducerFinder::CReducersHash::const_iterator
m_itr;
2557 return *(*m_current);
2580 Print(
"CDivisorEnumerator::MoveNext::est LS: q is divisible by LS[%d] !:((, diviser is: ", 1 +
Current().label());
2607 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
2625 if (syzterm !=
NULL)
2648 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
2678 if (syzterm !=
NULL && (
k == c))
2684 PrintS(
"_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
2698 PrintS(
"_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
2719 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
2816 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
2831 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
2848 if (syzterm !=
NULL)
2855 const poly m = L->m[c];
2869 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
2891 if (syzterm !=
NULL && (
k == c))
2897 PrintS(
"_FindReducer::Test SYZTERM: q == syzterm !:((, syzterm is: ");
2911 PrintS(
"_FindReducer::Test LS: q is divisible by LS[?] !:((: ");
2929 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
3026 if(
OPT__DEBUG ) { Verify(); syz_checker.Verify(); }
3052 for(
int k =
l - 1;
k >= 0;
k-- )
3056 for (
unsigned int j =
m_N;
j > 0;
j--)
3075 for (
unsigned int j =
m_N;
j > 0;
j--)
3088 template class std::vector<bool>;
3089 template class std::vector<CLeadingTerm const*>;
3090 template class std::map< CReducerFinder::TComponentKey, CReducerFinder::TReducers >;
3092 template class std::map<TCacheKey, TCacheValue, struct CCacheCompare>;
3093 template class std::map<int, TP2PCache>;
3095 template class std::stack <sBucket_pt>;
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Computation attribute storage.
BOOLEAN kbTest(kBucket_pt bucket)
Tests
const unsigned long m_not_sev
const unsigned int m_label
index in the main L[] + 1
const CanonicalForm int s
void id_DelDiv(ideal id, const ring r)
delete id[j], if LT(j) == coeff*mon*LT(i) and vice versa, i.e., delete id[i], if LT(i) == coeff*mon*L...
int OPT__SYZNUMBER
Syzygy level (within a resolution)
const CReducerFinder & m_reds
const CLeadingTerm & Current() const
CReducerFinder::TReducers::const_iterator m_current
static poly p_LmDeleteAndNext(poly p, const ring r)
SBucketFactory & m_factory
ideal m_syzLeads
output (syzygy) leading terms (+2nd terms?)
poly SchreyerSyzygyNF(const poly syz_lead, poly syz_2=NULL) const
Main HybridNF == 1: poly reduce + LOT + LCM?
const int OPT__HYBRIDNF
Use the usual NF's S-poly reduction while dropping lower order terms 2 means - smart selection! ...
const int OPT__SYZCHECK
CheckSyzygyProperty: TODO.
const ideal m_idLeads
input leading terms
Compatiblity layer for legacy polynomial operations (over currRing)
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
static poly p_Mult_mm(poly p, poly m, const ring r)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Detailed print for debugging.
const poly m_lt
the leading term itself L[label-1]
CReducerFinder(const ideal L, const SchreyerSyzygyComputationFlags &flags)
goes over all leading terms
BOOLEAN p_DebugLmDivisibleByNoComp(poly a, poly b, ring r)
std::vector< const CLeadingTerm * > TReducers
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 poly pp_Mult_mm(poly p, poly m, const ring r)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
CDivisorEnumerator2(const CReducerFinder &self, const poly m, const poly t)
static long p_Totaldegree(poly p, const ring r)
poly FindReducer(const poly multiplier, const poly monom, const poly syzterm, const CReducerFinder &checker) const
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
ideal m_LS
leading syzygy terms used for reducing syzygy tails
void sBucket_Add_p(sBucket_pt bucket, poly p, int length)
adds poly p to bucket destroys p!
unsigned long sev() const
CDivisorEnumerator(const CReducerFinder &self, const poly product)
void PrintStats() const
print statistics about the used heuristics
ideal m_syzTails
output (syzygy) tails
#define UNLIKELY(expression)
#define LIKELY(expression)
kBucket_pt m_spoly_bucket
for S-Polynomial reductions
#define omTypeAllocBin(type, addr, bin)
const int OPT__DEBUG
output all the intermediate states
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
CReducerFinder m_checker
for checking tail-terms and makeing them irreducible (wrt m_LS!)
CReducerFinder::CReducersHash::const_iterator m_itr
#define BEGIN_NAMESPACE_SINGULARXX
ideal Compute2LeadingSyzygyTerms()
leading + second terms
static void p_LmFree(poly p, ring)
static FORCE_INLINE void n_WriteLong(number n, const coeffs r)
write to the output buffer of the currently used reporter
poly kBucketExtractLm(kBucket_pt bucket)
static poly p_Copy(poly p, const ring r)
returns a copy of p
poly ReduceTerm(poly multiplier, poly term4reduction, poly syztermCheck) const
TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ? ???
const int OPT__TAILREDSYZ
Reduce syzygy tails wrt the leading syzygy terms.
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
static BOOLEAN p_LmIsConstant(const poly p, const ring r)
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
void ComputeSyzygy()
The main driver function: computes.
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
poly TraverseNF(const poly syz_lead, const poly syz_2=NULL) const
CReducerFinder::TReducers::const_iterator m_current
Coefficient rings, fields and other domains suitable for Singular polynomials.
void kBucketDestroy(kBucket_pt *bucket_pt)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
const CanonicalForm CFMap CFMap & N
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
CLCM(const ideal &L, const SchreyerSyzygyComputationFlags &flags)
#define p_SetRingOfLm(p, r)
SBucketWrapper(const ring r, SBucketFactory &factory)
bool CheckLT(const ideal &L) const
void sBucketDestroy(sBucket_pt *bucket)
The main handler for Singular numbers which are suitable for Singular polynomials.
void StringSetS(const char *st)
#define END_NAMESPACE_SINGULARXX
static poly pp_Mult_qq(poly p, poly q, const ring r)
const bool OPT__PROT
TEST_OPT_PROT.
static void _DestroyBucket(Bucket &bt)
we only expect empty buckets to be left at the end for destructor bt will be set to NULL ...
#define pp_Test(p, lmRing, tailRing)
bool DivisibilityCheck(const poly multiplier, const poly t, const unsigned long not_sev, const ring r) const
as DivisibilityCheck(multiplier * t, ...) for monomial 'm' and a module term 't'
void CleanUp()
Clean up all the accumulated data.
sBucket_pt sBucketCreate(const ring r)
#define BEGIN_NAMESPACE_NONAME
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
CReducerFinder::TReducers::const_iterator m_finish
poly TraverseTail(poly multiplier, const int tail) const
High level caching function!!!
void SetUpTailTerms()
Convert the given ideal of tails into the internal representation (with reducers!) Preprocess m_idTai...
void ComputeLeadingSyzygyTerms(bool bComputeSecondTerms=true)
Computes Syz(leads) or only LEAD of it. The result is stored into m_syzLeads.
static int p_LmCmp(poly p, poly q, const ring r)
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
const CReducerFinder m_div
Divisor finder.
ideal Compute1LeadingSyzygyTerms()
just leading terms
void PrintS(const char *s)
static char * rRingVar(short i, const ring r)
static poly p_Mult_nn(poly p, number n, const ring r)
SBucketFactory::Bucket Bucket
void Add(poly p, const int l)
adds p to the internal bucket destroys p, l == length(p)
static BOOLEAN p_LmShortDivisibleByNoComp(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
#define p_LmCheckPolyRing1(p, r)
void Initialize(const ideal L)
static unsigned pLength(poly a)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
const CReducerFinder & m_reds
const unsigned int m_N
number of ring variables
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
const unsigned long m_sev
not short exp. vector
static FORCE_INLINE number n_Lcm(number a, number b, const coeffs r)
in Z: return the lcm of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
bool Check(const poly m) const
const CLeadingTerm & Current() const
static void p_Delete(poly *p, const ring r)
static Bucket _CreateBucket(const ring r)
inital allocation for new buckets
ring sBucketGetRing(const sBucket_pt bucket)
Returns bucket ring.
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
#define p_LmEqual(p1, p2, r)
const Variable & v
< [in] a sqrfree bivariate poly
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, const 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 : VarOffset encodes the position in p->exp
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
static BOOLEAN rField_is_Ring(const ring r)
#define FROM_NAMESPACE(a, s)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
void kBucket_Plus_mm_Mult_pp(kBucket_pt bucket, poly m, poly p, int l)
Bpoly == Bpoly + m*p; where m is a monom Does not destroy p and m assume (l <= 0 || pLength(p) == l)...
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
const unsigned long m_not_sev
SchreyerSyzygyComputationFlags(idhdl rootRingHdl)
const int OPT__TREEOUTPUT
output lifting tree
poly ComputeImage(poly multiplier, const int tail) const
low level computation...
const ring m_rBaseRing
global base ring
SBucketFactory m_sum_bucket_factory
TODO: look into m_idTailTerms!!!!!!!!!!!!!!!!!!!!!!!! map? heaps???
void putBucket(const Bucket &bt, const bool replace=false)
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
static poly p_LmInit(poly p, const ring r)
static void p_Setm(poly p, const ring r)
unsigned int label() const
CReducerFinder::CReducersHash::const_iterator m_itr
unsigned long m_stat[9]
Statistics: 0..3: as in SetUpTailTerms()::PreProcessTerm() // TODO!!?? 4: number of terms discarded d...
bool IsDivisible(const poly q) const
const int OPT__IGNORETAILS
ignore tails and compute the pure Schreyer frame
static void p_LmDelete(poly p, const ring r)
#define p_SetCoeff0(p, n, r)
void Add(poly p)
adds p to the internal bucket destroys p
const CLCM m_lcm
Bitmask for variables occuring in leading terms.
CReducerFinder::TReducers::const_iterator m_finish
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE BOOLEAN n_IsMOne(number n, const coeffs r)
TRUE iff 'n' represents the additive inverse of the one element, i.e. -1.
static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
ordered fields: TRUE iff 'n' is positive; in Z/pZ: TRUE iff 0 < m <= roundedBelow(p/2), where m is the long representing n in C: TRUE iff (Im(n) != 0 and Im(n) >= 0) or (Im(n) == 0 and Re(n) >= 0) in K(a)/<p(a)>: TRUE iff (n != 0 and (LC(n) > 0 or deg(n) > 0)) in K(t_1, ..., t_n): TRUE iff (LC(numerator(n) is a constant and > 0) or (LC(numerator(n) is not a constant) in Z/2^kZ: TRUE iff 0 < n <= 2^(k-1) in Z/mZ: TRUE iff the internal mpz is greater than zero in Z: TRUE iff n > 0
static void p_ExpVectorSum(poly pr, poly p1, poly p2, const ring r)
static BOOLEAN p_ExpVectorEqual(poly p1, poly p2, const ring r1, const ring r2)
bool sIsEmpty(const sBucket_pt bucket)
Test whether bucket is empty!?
const ideal m_idTails
input tails
static poly p_Add_q(poly p, poly q, const ring r)
int status int void size_t count int const void size_t count const char int flags
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets
static poly p_New(const ring, omBin bin)
void dPrint(const ideal id, const ring lmRing=currRing, const ring tailRing=currRing, const int nTerms=0)
prints an ideal, optionally with details
static poly p_Init(const ring r, omBin bin)
#define SI_RESTORE_OPT1(A)
int PreProcessTerm(const poly t, CReducerFinder &syzChecker) const
is the term to be "preprocessed" as lower order term or lead to only reducible syzygies...
static poly p_Mult_q(poly p, poly q, const ring r)
void sBucketClearAdd(sBucket_pt bucket, poly *p, int *length)
const int OPT__NOCACHING
no caching/stores/lookups