Data Structures | Macros | Typedefs | Functions | Variables
syzextra.h File Reference

Computation of Syzygies. More...

#include <vector>
#include <map>
#include <string.h>
#include <stack>
#include "singularxx_defs.h"

Go to the source code of this file.

Data Structures

class  SBucketFactory
 sBucket Factory More...
 
struct  SchreyerSyzygyComputationFlags
 Computation attribute storage. More...
 
class  CLCM
 
class  CLeadingTerm
 
class  CReducerFinder
 
struct  CCacheCompare
 
class  SchreyerSyzygyComputation
 Computing syzygies after Schreyer. More...
 

Macros

#define NOPRODUCT   1
 
#define NODIVISION   1
 

Typedefs

typedef polyrec * poly
 
typedef idrecidhdl
 
typedef kBucketkBucket_pt
 
typedef sBucketsBucket_pt
 
typedef poly TCacheKey
 
typedef poly TCacheValue
 
typedef std::map< TCacheKey, TCacheValue, CCacheCompareTP2PCache
 
typedef std::map< int, TP2PCacheTCache
 

Functions

BEGIN_NAMESPACE_SINGULARXX BEGIN_NAMESPACE (SYZEXTRA) poly leadmonom(const poly p
 
poly p_Tail (const poly p, const ring r)
 return the tail of a given polynomial or vector returns NULL if input is NULL, otherwise the result is a new polynomial/vector in the ring r More...
 
ideal id_Tail (const ideal id, const ring r)
 return the tail of a given ideal or module returns NULL if input is NULL, otherwise the result is a new ideal/module in the ring r NOTE: the resulting rank is autocorrected More...
 
void Sort_c_ds (const ideal id, const ring r)
 inplace sorting of the module (ideal) id wrt <_(c,ds) More...
 
ideal id_Copy (const ideal, const ring)
 copy an ideal More...
 
bool my_p_LmCmp (poly, poly, const ring)
 
static void ComputeSyzygy (const ideal L, const ideal T, ideal &LL, ideal &TT, const SchreyerSyzygyComputationFlags A)
 
static ideal ComputeLeadingSyzygyTerms (const ideal &L, const SchreyerSyzygyComputationFlags A)
 
static ideal Compute2LeadingSyzygyTerms (const ideal &L, const SchreyerSyzygyComputationFlags A)
 
static poly FindReducer (poly product, poly syzterm, ideal L, ideal LS, const SchreyerSyzygyComputationFlags A)
 
static poly TraverseTail (poly multiplier, poly tail, ideal L, ideal T, ideal LS, const SchreyerSyzygyComputationFlags A)
 
static poly ReduceTerm (poly multiplier, poly term4reduction, poly syztermCheck, ideal L, ideal T, ideal LS, const SchreyerSyzygyComputationFlags A)
 
static poly SchreyerSyzygyNF (poly syz_lead, poly syz_2, ideal L, ideal T, ideal LS, const SchreyerSyzygyComputationFlags A)
 

Variables

BEGIN_NAMESPACE_SINGULARXX const ring r
 
BEGIN_NAMESPACE_SINGULARXX const ring const bool bSetZeroComp = true)
 

Detailed Description

Computation of Syzygies.

ABSTRACT: Computation of Syzygies due to Schreyer

Author
Oleksandr Motsak

Definition in file syzextra.h.

Macro Definition Documentation

#define NODIVISION   1

Definition at line 42 of file syzextra.h.

#define NOPRODUCT   1

Definition at line 36 of file syzextra.h.

Typedef Documentation

typedef idrec* idhdl

Definition at line 31 of file syzextra.h.

typedef kBucket* kBucket_pt

Definition at line 33 of file syzextra.h.

typedef polyrec* poly

Definition at line 27 of file syzextra.h.

typedef sBucket* sBucket_pt

Definition at line 65 of file syzextra.h.

typedef std::map<int, TP2PCache> TCache

Definition at line 384 of file syzextra.h.

typedef poly TCacheKey

Definition at line 366 of file syzextra.h.

typedef poly TCacheValue

Definition at line 367 of file syzextra.h.

Definition at line 383 of file syzextra.h.

Function Documentation

BEGIN_NAMESPACE_SINGULARXX BEGIN_NAMESPACE ( SYZEXTRA  ) const
static ideal Compute2LeadingSyzygyTerms ( const ideal &  L,
const SchreyerSyzygyComputationFlags  A 
)
inlinestatic

Definition at line 592 of file syzextra.h.

593 {
594  SchreyerSyzygyComputation syz(L, NULL, A);
595  syz.ComputeLeadingSyzygyTerms(true);
596  ideal LL, TT;
597  syz.ReadOffResult(LL, TT);
598  return LL; // assume TT is NULL!
599 }
#define NULL
Definition: omList.c:10
Computing syzygies after Schreyer.
Definition: syzextra.h:397
static ideal ComputeLeadingSyzygyTerms ( const ideal &  L,
const SchreyerSyzygyComputationFlags  A 
)
inlinestatic

Definition at line 583 of file syzextra.h.

584 {
585  SchreyerSyzygyComputation syz(L, NULL, A);
586  syz.ComputeLeadingSyzygyTerms(false);
587  ideal LL, TT;
588  syz.ReadOffResult(LL, TT);
589  return LL; // assume TT is NULL!
590 }
#define NULL
Definition: omList.c:10
Computing syzygies after Schreyer.
Definition: syzextra.h:397
static void ComputeSyzygy ( const ideal  L,
const ideal  T,
ideal &  LL,
ideal &  TT,
const SchreyerSyzygyComputationFlags  A 
)
inlinestatic

Definition at line 576 of file syzextra.h.

577 {
578  SchreyerSyzygyComputation syz(L, T, A);
579  syz.ComputeSyzygy();
580  syz.ReadOffResult(LL, TT);
581 }
Computing syzygies after Schreyer.
Definition: syzextra.h:397
static jList * T
Definition: janet.cc:37
static poly FindReducer ( poly  product,
poly  syzterm,
ideal  L,
ideal  LS,
const SchreyerSyzygyComputationFlags  A 
)
inlinestatic

Definition at line 601 of file syzextra.h.

603 {
604  SchreyerSyzygyComputation syz(L, NULL, LS, A);
605  return syz._FindReducer(product, syzterm);
606 }
#define NULL
Definition: omList.c:10
Computing syzygies after Schreyer.
Definition: syzextra.h:397
ideal id_Copy ( const ideal  ,
const ring   
)

copy an ideal

Definition at line 409 of file simpleideals.cc.

410 {
411  id_Test(h1, r);
412 
413  ideal h2 = idInit(IDELEMS(h1), h1->rank);
414  for (int i=IDELEMS(h1)-1; i>=0; i--)
415  h2->m[i] = p_Copy(h1->m[i],r);
416  return h2;
417 }
#define id_Test(A, lR)
Definition: simpleideals.h:80
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:810
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
ideal id_Tail ( const ideal  id,
const ring  r 
)

return the tail of a given ideal or module returns NULL if input is NULL, otherwise the result is a new ideal/module in the ring r NOTE: the resulting rank is autocorrected

Definition at line 510 of file syzextra.cc.

511 {
512  if( UNLIKELY(id == NULL) )
513  return NULL;
514 
515  const ideal newid = idInit(IDELEMS(id),id->rank);
516 
517  for (int i=IDELEMS(id) - 1; i >= 0; i--)
518  newid->m[i] = p_Tail( id->m[i], r );
519 
520  newid->rank = id_RankFreeModule(newid, currRing);
521 
522  return newid;
523 }
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
poly p_Tail(const poly p, const ring r)
return the tail of a given polynomial or vector returns NULL if input is NULL, otherwise the result i...
Definition: syzextra.cc:501
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const ring r
Definition: syzextra.cc:208
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
bool my_p_LmCmp ( poly  ,
poly  ,
const ring   
)

Definition at line 1590 of file syzextra.cc.

1590 { return p_LmCmp(a, b, r) == -1; } // TODO: change to simple lex. memory compare!
const poly a
Definition: syzextra.cc:212
const ring r
Definition: syzextra.cc:208
static int p_LmCmp(poly p, poly q, const ring r)
Definition: p_polys.h:1473
const poly b
Definition: syzextra.cc:213
poly p_Tail ( const poly  p,
const ring  r 
)

return the tail of a given polynomial or vector returns NULL if input is NULL, otherwise the result is a new polynomial/vector in the ring r

Definition at line 501 of file syzextra.cc.

502 {
503  if( UNLIKELY(p == NULL) )
504  return NULL;
505  else
506  return p_Copy( pNext(p), r );
507 }
return P p
Definition: myNF.cc:203
#define UNLIKELY(expression)
Definition: tgb_internal.h:838
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:810
const ring r
Definition: syzextra.cc:208
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static poly ReduceTerm ( poly  multiplier,
poly  term4reduction,
poly  syztermCheck,
ideal  L,
ideal  T,
ideal  LS,
const SchreyerSyzygyComputationFlags  A 
)
inlinestatic

Definition at line 615 of file syzextra.h.

617 {
618  SchreyerSyzygyComputation syz(L, T, LS, A);
619  return syz.ReduceTerm(multiplier, term4reduction, syztermCheck);
620 }
Computing syzygies after Schreyer.
Definition: syzextra.h:397
static jList * T
Definition: janet.cc:37
static poly SchreyerSyzygyNF ( poly  syz_lead,
poly  syz_2,
ideal  L,
ideal  T,
ideal  LS,
const SchreyerSyzygyComputationFlags  A 
)
inlinestatic

Definition at line 623 of file syzextra.h.

625 {
626  SchreyerSyzygyComputation syz(L, T, LS, A);
627  return syz.SchreyerSyzygyNF(syz_lead, syz_2);
628 }
Computing syzygies after Schreyer.
Definition: syzextra.h:397
static jList * T
Definition: janet.cc:37
void Sort_c_ds ( const ideal  id,
const ring  r 
)

inplace sorting of the module (ideal) id wrt <_(c,ds)

Definition at line 527 of file syzextra.cc.

528 {
529  const int sizeNew = IDELEMS(id);
530 
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)
535 #else
536 #define qsort_my(m, s, ss, r, cmp) qsort(m, s, ss, cmp)
537 #endif
538 
539  if( sizeNew >= 2 )
540  qsort_my(id->m, sizeNew, sizeof(poly), r, FROM_NAMESPACE(SORT_c_ds, cmp_c_ds));
541 
542 #undef qsort_my
543 
544  id->rank = id_RankFreeModule(id, r);
545 }
#define qsort_my(m, s, ss, r, cmp)
const ring r
Definition: syzextra.cc:208
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define IDELEMS(i)
Definition: simpleideals.h:24
#define FROM_NAMESPACE(a, s)
polyrec * poly
Definition: hilb.h:10
static poly TraverseTail ( poly  multiplier,
poly  tail,
ideal  L,
ideal  T,
ideal  LS,
const SchreyerSyzygyComputationFlags  A 
)
inlinestatic

Definition at line 608 of file syzextra.h.

610 {
611  SchreyerSyzygyComputation syz(L, T, LS, A);
612  return syz.TraverseTail(multiplier, tail);
613 }
Computing syzygies after Schreyer.
Definition: syzextra.h:397
static jList * T
Definition: janet.cc:37

Variable Documentation

BEGIN_NAMESPACE_SINGULARXX const ring const bool bSetZeroComp = true)

Definition at line 47 of file syzextra.h.

Definition at line 47 of file syzextra.h.