 |
My Project
debian-1:4.1.1-p2+ds-4build1
|
#include <syzextra.h>
|
| SchreyerSyzygyComputation (const ideal idLeads, const ideal idTails, const SchreyerSyzygyComputationFlags setting) |
| Construct a global object for given input data (separated into leads & tails) More...
|
|
| SchreyerSyzygyComputation (const ideal idLeads, const ideal idTails, const ideal syzLeads, const SchreyerSyzygyComputationFlags setting) |
| Construct a global object for given input data (separated into leads & tails) More...
|
|
| ~SchreyerSyzygyComputation () |
| Destructor should not destruct the resulting m_syzLeads, m_syzTails. More...
|
|
void | SetUpTailTerms () |
| Convert the given ideal of tails into the internal representation (with reducers!) Preprocess m_idTails as well...? More...
|
|
void | PrintStats () const |
| print statistics about the used heuristics More...
|
|
void | ReadOffResult (ideal &syzL, ideal &syzT) |
| Read off the results while detaching them from this object NOTE: no copy! More...
|
|
void | ComputeSyzygy () |
| The main driver function: computes. More...
|
|
void | ComputeLeadingSyzygyTerms (bool bComputeSecondTerms=true) |
| Computes Syz(leads) or only LEAD of it. The result is stored into m_syzLeads. More...
|
|
poly | SchreyerSyzygyNF (const poly syz_lead, poly syz_2=NULL) const |
| Main HybridNF == 1: poly reduce + LOT + LCM? More...
|
|
poly | TraverseNF (const poly syz_lead, const poly syz_2=NULL) const |
|
poly | TraverseTail (poly multiplier, const int tail) const |
| High level caching function!!! More...
|
|
poly | TraverseTail (poly multiplier, poly tail) const |
| called only from above and from outside (for testing) More...
|
|
poly | ReduceTerm (poly multiplier, poly term4reduction, poly syztermCheck) const |
| TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ? ??? More...
|
|
poly | ComputeImage (poly multiplier, const int tail) const |
| low level computation... More...
|
|
poly | _FindReducer (const poly product, const poly syzterm) const |
| just for testing via the wrapper below More...
|
|
| SchreyerSyzygyComputationFlags (idhdl rootRingHdl) |
|
| SchreyerSyzygyComputationFlags (const SchreyerSyzygyComputationFlags &attr) |
|
void | nextSyzygyLayer () const |
|
Computing syzygies after Schreyer
Storing/accumulating data during the computation requires some global object, like this class. Ideally the above global functions should not be used in favour of this class.
- See also
- Schreyer Syzygy Computation Paper & Talk & Python prototype
Definition at line 347 of file syzextra.h.
◆ SchreyerSyzygyComputation() [1/2]
Construct a global object for given input data (separated into leads & tails)
Definition at line 354 of file syzextra.h.
◆ SchreyerSyzygyComputation() [2/2]
Construct a global object for given input data (separated into leads & tails)
Definition at line 367 of file syzextra.h.
380 if (syzLeads !=
NULL)
◆ ~SchreyerSyzygyComputation()
SchreyerSyzygyComputation::~SchreyerSyzygyComputation |
( |
| ) |
|
|
inline |
Destructor should not destruct the resulting m_syzLeads, m_syzTails.
Definition at line 388 of file syzextra.h.
◆ _FindReducer()
poly SchreyerSyzygyComputation::_FindReducer |
( |
const poly |
product, |
|
|
const poly |
syzterm |
|
) |
| const |
|
inline |
just for testing via the wrapper below
Definition at line 443 of file syzextra.h.
◆ CleanUp()
void SchreyerSyzygyComputation::CleanUp |
( |
| ) |
|
|
private |
Clean up all the accumulated data.
Definition at line 363 of file syzextra.cc.
380 for( TCache::iterator it =
m_cache.begin(); it !=
m_cache.end(); it++ )
384 for(TP2PCache::iterator vit =
T.begin(); vit !=
T.end(); vit++ )
◆ Compute1LeadingSyzygyTerms()
ideal SchreyerSyzygyComputation::Compute1LeadingSyzygyTerms |
( |
| ) |
|
|
protected |
just leading terms
Definition at line 544 of file syzextra.cc.
561 const ideal newid =
idInit(1, 0); newid->m[0] =
NULL;
578 const poly
p =
id->m[
j];
582 for (
int i =
j - 1;
i >= 0;
i--)
584 const poly
pp =
id->m[
i];
594 for (
int v =
rVar(r);
v > 0;
v--)
◆ Compute2LeadingSyzygyTerms()
ideal SchreyerSyzygyComputation::Compute2LeadingSyzygyTerms |
( |
| ) |
|
|
protected |
leading + second terms
Definition at line 634 of file syzextra.cc.
649 const ideal newid =
idInit(1, 1); newid->m[0] =
NULL;
667 const poly
p =
id->m[
j];
671 for (
int i =
j - 1;
i >= 0;
i--)
673 const poly
pp =
id->m[
i];
687 for (
int v =
rVar(r);
v > 0;
v--)
717 number
g =
n_Lcm( lc1, lc2, r->cf );
◆ ComputeImage()
poly SchreyerSyzygyComputation::ComputeImage |
( |
poly |
multiplier, |
|
|
const int |
tail |
|
) |
| const |
◆ ComputeLeadingSyzygyTerms()
void SchreyerSyzygyComputation::ComputeLeadingSyzygyTerms |
( |
bool |
bComputeSecondTerms = true | ) |
|
Computes Syz(leads) or only LEAD of it. The result is stored into m_syzLeads.
Definition at line 976 of file syzextra.cc.
◆ ComputeSyzygy()
void SchreyerSyzygyComputation::ComputeSyzygy |
( |
| ) |
|
The main driver function: computes.
Definition at line 806 of file syzextra.cc.
842 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r);
852 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n",
getRTimer(), t, r);
886 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", r, t, r);
896 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n",
getRTimer(), t, r);
906 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", r, t, r);
911 for(
int k =
size - 1;
k >= 0; --
k )
964 Print(
"\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n",
getRTimer(), t, r);
◆ PrintStats()
void SchreyerSyzygyComputation::PrintStats |
( |
| ) |
const |
print statistics about the used heuristics
Definition at line 533 of file syzextra.cc.
535 Print(
"SchreyerSyzygyComputation Stats: (PP/ST: {c: %lu, C: %lu, P: %lu} + %lu, LOT: %lu, LCM: %lu, ST:%lu, LK: %lu {*: %lu})\n",
◆ ReadOffResult()
void SchreyerSyzygyComputation::ReadOffResult |
( |
ideal & |
syzL, |
|
|
ideal & |
syzT |
|
) |
| |
|
inline |
Read off the results while detaching them from this object NOTE: no copy!
Definition at line 399 of file syzextra.h.
◆ ReduceTerm()
poly SchreyerSyzygyComputation::ReduceTerm |
( |
poly |
multiplier, |
|
|
poly |
term4reduction, |
|
|
poly |
syztermCheck |
|
) |
| const |
TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ? ???
Definition at line 1353 of file syzextra.cc.
1389 poly product =
pp_Mult_mm(multiplier, term4reduction, r);
1428 PrintS(
"\", \"children\": [");
◆ SchreyerSyzygyNF()
poly SchreyerSyzygyComputation::SchreyerSyzygyNF |
( |
const poly |
syz_lead, |
|
|
poly |
syz_2 = NULL |
|
) |
| const |
Main HybridNF == 1: poly reduce + LOT + LCM?
Definition at line 1013 of file syzextra.cc.
1025 const int rr =
p_GetComp(syz_lead, r) - 1;
1119 const poly
result = tail.ClearAdd();
◆ SetUpTailTerms()
void SchreyerSyzygyComputation::SetUpTailTerms |
( |
| ) |
|
Convert the given ideal of tails into the internal representation (with reducers!) Preprocess m_idTails as well...?
Definition at line 474 of file syzextra.cc.
481 unsigned long pp[4] = {0,0,0,0};
483 for(
int p =
IDELEMS(idTails) - 1;
p >= 0; --
p )
484 for( poly* tt = &(idTails->m[
p]); (*tt) !=
NULL; )
503 Print(
"(PP/ST: {c: %lu, C: %lu, P: %lu} + %lu)",
pp[1],
pp[2],
pp[3],
pp[0]);
◆ TraverseNF()
poly SchreyerSyzygyComputation::TraverseNF |
( |
const poly |
syz_lead, |
|
|
const poly |
syz_2 = NULL |
|
) |
| const |
◆ TraverseTail() [1/2]
poly SchreyerSyzygyComputation::TraverseTail |
( |
poly |
multiplier, |
|
|
const int |
tail |
|
) |
| const |
High level caching function!!!
Definition at line 1144 of file syzextra.cc.
1157 TCache::iterator top_itr =
m_cache.find(tail);
1159 if ( top_itr !=
m_cache.end() )
1161 assume( top_itr->first == tail );
1165 TP2PCache::iterator itr =
T.find(multiplier);
1167 if( itr !=
T.end() )
1171 if( itr->second ==
NULL )
1174 poly
p =
p_Copy(itr->second, r);
1187 Print(
"\"recale\": \"%s\", ",
s);
1212 T.insert( TP2PCache::value_type(
myp_Head(multiplier, (
p==
NULL), r),
p) );
1228 T.insert( TP2PCache::value_type(
myp_Head(multiplier, (
p==
NULL), r),
p) );
1230 m_cache.insert( TCache::value_type(tail,
T) );
◆ TraverseTail() [2/2]
poly SchreyerSyzygyComputation::TraverseTail |
( |
poly |
multiplier, |
|
|
poly |
tail |
|
) |
| const |
called only from above and from outside (for testing)
Definition at line 1261 of file syzextra.cc.
1333 const poly
s = sum.ClearAdd();
◆ CLCM
◆ CReducerFinder
◆ m_cache
TCache SchreyerSyzygyComputation::m_cache |
|
mutableprivate |
◆ m_checker
for checking tail-terms and makeing them irreducible (wrt m_LS!)
Definition at line 481 of file syzextra.h.
◆ m_div
◆ m_idLeads
const ideal SchreyerSyzygyComputation::m_idLeads |
|
private |
◆ m_idTails
const ideal SchreyerSyzygyComputation::m_idTails |
|
private |
◆ m_lcm
Bitmask for variables occuring in leading terms.
Definition at line 475 of file syzextra.h.
◆ m_LS
ideal SchreyerSyzygyComputation::m_LS |
|
private |
leading syzygy terms used for reducing syzygy tails
Definition at line 471 of file syzextra.h.
◆ m_spoly_bucket
kBucket_pt SchreyerSyzygyComputation::m_spoly_bucket |
|
mutableprivate |
for S-Polynomial reductions
Definition at line 489 of file syzextra.h.
◆ m_stat
unsigned long SchreyerSyzygyComputation::m_stat[9] |
|
mutableprivate |
Statistics: 0..3: as in SetUpTailTerms()::PreProcessTerm() // TODO!!?? 4: number of terms discarded due to LOT heuristics 5: number of terms discarded due to LCM heuristics 6, 7: lookups without & with rescale, 8: stores.
Definition at line 497 of file syzextra.h.
◆ m_sum_bucket_factory
used for simple summing up
Definition at line 486 of file syzextra.h.
◆ m_syzLeads
ideal SchreyerSyzygyComputation::m_syzLeads |
|
private |
output (syzygy) leading terms (+2nd terms?)
Definition at line 466 of file syzextra.h.
◆ m_syzTails
ideal SchreyerSyzygyComputation::m_syzTails |
|
private |
The documentation for this class was generated from the following files:
const ring m_rBaseRing
global base ring
static poly p_LmDeleteAndNext(poly p, const ring r)
const CReducerFinder m_div
Divisor finder.
ideal Compute1LeadingSyzygyTerms()
just leading terms
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
#define p_SetCoeff0(p, n, r)
const int OPT__HYBRIDNF
Use the usual NF's S-poly reduction while dropping lower order terms 2 means - smart selection!
SBucketFactory m_sum_bucket_factory
used for simple summing up
SchreyerSyzygyComputationFlags(idhdl rootRingHdl)
ideal m_LS
leading syzygy terms used for reducing syzygy tails
static poly p_Mult_mm(poly p, poly m, const ring r)
CReducerFinder m_checker
for checking tail-terms and makeing them irreducible (wrt m_LS!)
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...
const ideal m_idTails
input tails
void PrintStats() const
print statistics about the used heuristics
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
ideal m_syzTails
output (syzygy) tails
static poly pp_Mult_mm(poly p, poly m, const ring r)
const bool OPT__PROT
TEST_OPT_PROT.
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
poly FindReducer(const poly multiplier, const poly monom, const poly syzterm, const CReducerFinder &checker) const
#define p_LmEqual(p1, p2, 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 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 ...
void CleanUp()
Clean up all the accumulated data.
poly SchreyerSyzygyNF(const poly syz_lead, poly syz_2=NULL) const
Main HybridNF == 1: poly reduce + LOT + LCM?
static short rVar(const ring r)
#define rVar(r) (r->N)
poly kBucketExtractLm(kBucket_pt bucket)
const ideal m_idLeads
input leading terms
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
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 int OPT__TAILREDSYZ
Reduce syzygy tails wrt the leading syzygy terms.
bool Check(const poly m) const
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
void ComputeLeadingSyzygyTerms(bool bComputeSecondTerms=true)
Computes Syz(leads) or only LEAD of it. The result is stored into m_syzLeads.
void PrintS(const char *s)
int PreProcessTerm(const poly t, CReducerFinder &syzChecker) const
is the term to be "preprocessed" as lower order term or lead to only reducible syzygies....
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
const int OPT__IGNORETAILS
ignore tails and compute the pure Schreyer frame
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
poly TraverseNF(const poly syz_lead, const poly syz_2=NULL) const
poly TraverseTail(poly multiplier, const int tail) const
High level caching function!!!
static void p_LmDelete(poly p, const ring r)
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)
poly ReduceTerm(poly multiplier, poly term4reduction, poly syztermCheck) const
TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ? ???
const int OPT__SYZCHECK
CheckSyzygyProperty: TODO.
poly ComputeImage(poly multiplier, const int tail) const
low level computation...
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static poly p_Init(const ring r, omBin bin)
const int OPT__NOCACHING
no caching/stores/lookups
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
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)
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,...
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
ideal Compute2LeadingSyzygyTerms()
leading + second terms
void StringSetS(const char *st)
ideal idInit(int idsize, int rank)
initialise an ideal / module
unsigned long m_stat[9]
Statistics: 0..3: as in SetUpTailTerms()::PreProcessTerm() // TODO!!?? 4: number of terms discarded d...
kBucket_pt m_spoly_bucket
for S-Polynomial reductions
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
int OPT__SYZNUMBER
Syzygy level (within a resolution)
void Initialize(const ideal L)
static void p_Setm(poly p, const ring r)
const Variable & v
< [in] a sqrfree bivariate poly
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.
void SetUpTailTerms()
Convert the given ideal of tails into the internal representation (with reducers!) Preprocess m_idTai...
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
const CanonicalForm int s
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...
#define SI_RESTORE_OPT1(A)
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
const CLCM m_lcm
Bitmask for variables occuring in leading terms.
static poly p_Mult_nn(poly p, number n, const ring r)
ideal m_syzLeads
output (syzygy) leading terms (+2nd terms?)
const int OPT__TREEOUTPUT
output lifting tree