My Project  debian-1:4.1.1-p2+ds-4
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
SchreyerSyzygyComputation Class Reference

#include <syzextra.h>

Public Member Functions

 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...
 
- Public Member Functions inherited from SchreyerSyzygyComputationFlags
 SchreyerSyzygyComputationFlags (idhdl rootRingHdl)
 
 SchreyerSyzygyComputationFlags (const SchreyerSyzygyComputationFlags &attr)
 
void nextSyzygyLayer () const
 

Protected Member Functions

ideal Compute1LeadingSyzygyTerms ()
 just leading terms More...
 
ideal Compute2LeadingSyzygyTerms ()
 leading + second terms More...
 

Private Member Functions

void CleanUp ()
 Clean up all the accumulated data. More...
 

Private Attributes

const ideal m_idLeads
 input leading terms More...
 
const ideal m_idTails
 input tails More...
 
ideal m_syzLeads
 output (syzygy) leading terms (+2nd terms?) More...
 
ideal m_syzTails
 output (syzygy) tails More...
 
ideal m_LS
 leading syzygy terms used for reducing syzygy tails More...
 
const CLCM m_lcm
 Bitmask for variables occuring in leading terms. More...
 
const CReducerFinder m_div
 Divisor finder. More...
 
CReducerFinder m_checker
 for checking tail-terms and makeing them irreducible (wrt m_LS!) More...
 
TCache m_cache
 
SBucketFactory m_sum_bucket_factory
 used for simple summing up More...
 
kBucket_pt m_spoly_bucket
 for S-Polynomial reductions More...
 
unsigned long m_stat [9]
 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. More...
 

Friends

class CLCM
 
class CReducerFinder
 

Additional Inherited Members

- Data Fields inherited from SchreyerSyzygyComputationFlags
const int OPT__DEBUG
 output all the intermediate states More...
 
const int OPT__LEAD2SYZ
 ? More...
 
const int OPT__TAILREDSYZ
 Reduce syzygy tails wrt the leading syzygy terms. More...
 
const int OPT__HYBRIDNF
 Use the usual NF's S-poly reduction while dropping lower order terms 2 means - smart selection! More...
 
const int OPT__IGNORETAILS
 ignore tails and compute the pure Schreyer frame More...
 
int OPT__SYZNUMBER
 Syzygy level (within a resolution) More...
 
const int OPT__TREEOUTPUT
 output lifting tree More...
 
const int OPT__SYZCHECK
 CheckSyzygyProperty: TODO. More...
 
const bool OPT__PROT
 TEST_OPT_PROT. More...
 
const int OPT__NOCACHING
 no caching/stores/lookups More...
 
const ring m_rBaseRing
 global base ring More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SchreyerSyzygyComputation() [1/2]

SchreyerSyzygyComputation::SchreyerSyzygyComputation ( const ideal  idLeads,
const ideal  idTails,
const SchreyerSyzygyComputationFlags  setting 
)
inline

Construct a global object for given input data (separated into leads & tails)

Definition at line 354 of file syzextra.h.

354  :
356  m_idLeads(idLeads), m_idTails(id_Copy(idTails, setting.m_rBaseRing)),
358  m_LS(NULL), m_lcm(m_idLeads, setting),
359  m_div(m_idLeads, setting), m_checker(NULL, setting), m_cache(),
362  {
363  if( UNLIKELY(OPT__PROT) ) memset( &m_stat, 0, sizeof(m_stat) );
364  }

◆ SchreyerSyzygyComputation() [2/2]

SchreyerSyzygyComputation::SchreyerSyzygyComputation ( const ideal  idLeads,
const ideal  idTails,
const ideal  syzLeads,
const SchreyerSyzygyComputationFlags  setting 
)
inline

Construct a global object for given input data (separated into leads & tails)

Definition at line 367 of file syzextra.h.

367  :
369  m_idLeads(idLeads), m_idTails(id_Copy(idTails, setting.m_rBaseRing)),
370  m_syzLeads(syzLeads), m_syzTails(NULL),
371  m_LS(syzLeads), m_lcm(m_idLeads, setting),
372  m_div(m_idLeads, setting), m_checker(NULL, setting), m_cache(),
375  {
376  if( UNLIKELY(OPT__PROT) ) memset( &m_stat, 0, sizeof(m_stat) );
377 
379  {
380  if (syzLeads != NULL)
381  m_checker.Initialize(syzLeads);
382 // if( idTails != NULL )
383 // SetUpTailTerms();
384  }
385  }

◆ ~SchreyerSyzygyComputation()

SchreyerSyzygyComputation::~SchreyerSyzygyComputation ( )
inline

Destructor should not destruct the resulting m_syzLeads, m_syzTails.

Definition at line 388 of file syzextra.h.

388 { CleanUp(); }

Member Function Documentation

◆ _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.

444  { return m_div.FindReducer(product, syzterm, m_checker); }

◆ CleanUp()

void SchreyerSyzygyComputation::CleanUp ( )
private

Clean up all the accumulated data.

Definition at line 363 of file syzextra.cc.

364 {
365  id_Delete(const_cast<ideal*>(&m_idTails), m_rBaseRing); // TODO!!!
366 
367 /*if( m_sum_bucket != NULL )
368  {
369  assume ( sIsEmpty(m_sum_bucket) );
370  sBucketDestroy(&m_sum_bucket);
371  m_sum_bucket = NULL;
372  }*/
373 
374  if( m_spoly_bucket != NULL )
375  {
378  }
379 
380  for( TCache::iterator it = m_cache.begin(); it != m_cache.end(); it++ )
381  {
382  TP2PCache& T = it->second;
383 
384  for(TP2PCache::iterator vit = T.begin(); vit != T.end(); vit++ )
385  {
386  p_Delete( (&(vit->second)), m_rBaseRing);
387  p_Delete( const_cast<poly*>(&(vit->first)), m_rBaseRing);
388  }
389  }
390 }

◆ Compute1LeadingSyzygyTerms()

ideal SchreyerSyzygyComputation::Compute1LeadingSyzygyTerms ( )
protected

just leading terms

Definition at line 544 of file syzextra.cc.

545 {
546  const ideal& id = m_idLeads;
547  const ring& r = m_rBaseRing;
548 // const SchreyerSyzygyComputationFlags& attributes = m_atttributes;
549 
551 
552  // 1. set of components S?
553  // 2. for each component c from S: set of indices of leading terms
554  // with this component?
555  // 3. short exp. vectors for each leading term?
556 
557  const int size = IDELEMS(id);
558 
559  if( size < 2 )
560  {
561  const ideal newid = idInit(1, 0); newid->m[0] = NULL; // zero ideal...
562  return newid;
563  }
564 
565  // TODO/NOTE: input is supposed to be (reverse-) sorted wrt "(c,ds)"!??
566 
567  // components should come in groups: count elements in each group
568  // && estimate the real size!!!
569 
570 
571  // use just a vector instead???
572  const ideal newid = idInit( (size * (size-1))/2, size); // maximal size: ideal case!
573 
574  int k = 0;
575 
576  for (int j = 0; j < size; j++)
577  {
578  const poly p = id->m[j];
579  assume( p != NULL );
580  const int c = p_GetComp(p, r);
581 
582  for (int i = j - 1; i >= 0; i--)
583  {
584  const poly pp = id->m[i];
585  assume( pp != NULL );
586  const int cc = p_GetComp(pp, r);
587 
588  if( c != cc )
589  continue;
590 
591  const poly m = p_Init(r); // p_New???
592 
593  // m = LCM(p, pp) / p! // TODO: optimize: knowing the ring structure: (C/lp)!
594  for (int v = rVar(r); v > 0; v--)
595  {
596  assume( v > 0 );
597  assume( v <= rVar(r) );
598 
599  const short e1 = p_GetExp(p , v, r);
600  const short e2 = p_GetExp(pp, v, r);
601 
602  if( e1 >= e2 )
603  p_SetExp(m, v, 0, r);
604  else
605  p_SetExp(m, v, e2 - e1, r);
606 
607  }
608 
609  assume( (j > i) && (i >= 0) );
610 
611  p_SetComp(m, j + 1, r);
612  pNext(m) = NULL;
613  p_SetCoeff0(m, n_Init(1, r->cf), r); // for later...
614 
615  p_Setm(m, r); // should not do anything!!!
616 
617  newid->m[k++] = m;
618  }
619  }
620 
621  // the rest of newid is assumed to be zeroes...
622 
623  // simplify(newid, 2 + 32)??
624  // sort(newid, "C,ds")[1]???
625  id_DelDiv(newid, r); // #define SIMPL_LMDIV 32
626 
627  idSkipZeroes(newid); // #define SIMPL_NULL 2
628 
629  Sort_c_ds(newid, r);
630 
631  return newid;
632 }

◆ Compute2LeadingSyzygyTerms()

ideal SchreyerSyzygyComputation::Compute2LeadingSyzygyTerms ( )
protected

leading + second terms

Definition at line 634 of file syzextra.cc.

635 {
636  const ideal& id = m_idLeads;
637  const ring& r = m_rBaseRing;
638 // const SchreyerSyzygyComputationFlags& attributes = m_atttributes;
639 
640  // 1. set of components S?
641  // 2. for each component c from S: set of indices of leading terms
642  // with this component?
643  // 3. short exp. vectors for each leading term?
644 
645  const int size = IDELEMS(id);
646 
647  if( size < 2 )
648  {
649  const ideal newid = idInit(1, 1); newid->m[0] = NULL; // zero module...
650  return newid;
651  }
652 
653 
654  // TODO/NOTE: input is supposed to be sorted wrt "C,ds"!??
655 
656  // components should come in groups: count elements in each group
657  // && estimate the real size!!!
658 
659 
660  // use just a vector instead???
661  ideal newid = idInit( (size * (size-1))/2, size); // maximal size: ideal case!
662 
663  int k = 0;
664 
665  for (int j = 0; j < size; j++)
666  {
667  const poly p = id->m[j];
668  assume( p != NULL );
669  const int c = p_GetComp(p, r);
670 
671  for (int i = j - 1; i >= 0; i--)
672  {
673  const poly pp = id->m[i];
674  assume( pp != NULL );
675  const int cc = p_GetComp(pp, r);
676 
677  if( c != cc )
678  continue;
679 
680  // allocate memory & zero it out!
681  const poly m = p_Init(r); const poly mm = p_Init(r);
682 
683 
684  // m = LCM(p, pp) / p! mm = LCM(p, pp) / pp!
685  // TODO: optimize: knowing the ring structure: (C/lp)!
686 
687  for (int v = rVar(r); v > 0; v--)
688  {
689  assume( v > 0 );
690  assume( v <= rVar(r) );
691 
692  const short e1 = p_GetExp(p , v, r);
693  const short e2 = p_GetExp(pp, v, r);
694 
695  if( e1 >= e2 )
696  p_SetExp(mm, v, e1 - e2, r); // p_SetExp(m, v, 0, r);
697  else
698  p_SetExp(m, v, e2 - e1, r); // p_SetExp(mm, v, 0, r);
699 
700  }
701 
702  assume( (j > i) && (i >= 0) );
703 
704  p_SetComp(m, j + 1, r);
705  p_SetComp(mm, i + 1, r);
706 
707  const number& lc1 = p_GetCoeff(p , r);
708  const number& lc2 = p_GetCoeff(pp, r);
709 
710 #if NODIVISION
711  assume( n_IsOne(lc1, r->cf) );
712  assume( n_IsOne(lc2, r->cf) );
713 
714  p_SetCoeff0( m, n_Init( 1, r->cf), r );
715  p_SetCoeff0(mm, n_Init(-1, r->cf), r );
716 #else
717  number g = n_Lcm( lc1, lc2, r->cf );
718  p_SetCoeff0(m , n_Div(g, lc1, r), r);
719  p_SetCoeff0(mm, n_InpNeg(n_Div(g, lc2, r), r), r);
720  n_Delete(&g, r);
721 #endif
722 
723  p_Setm(m, r); // should not do anything!!!
724  p_Setm(mm, r); // should not do anything!!!
725 
726  pNext(m) = mm; // pNext(mm) = NULL;
727 
728  newid->m[k++] = m;
729  }
730  }
731 
732  if( UNLIKELY(!OPT__TAILREDSYZ) )
733  {
734  // simplify(newid, 2 + 32)??
735  // sort(newid, "C,ds")[1]???
736  id_DelDiv(newid, r); // #define SIMPL_LMDIV 32
737  }
738  else
739  {
740  // option(redSB); option(redTail);
741  // TEST_OPT_REDSB
742  // TEST_OPT_REDTAIL
743  assume( r == currRing );
744 
745  BITSET _save_test; SI_SAVE_OPT1(_save_test);
747 
748  intvec* w=new intvec(IDELEMS(newid));
749  ideal tmp = kStd(newid, currRing->qideal, isHomog, &w);
750  delete w;
751 
752  SI_RESTORE_OPT1(_save_test)
753 
754  id_Delete(&newid, r);
755  newid = tmp;
756  }
757 
758  idSkipZeroes(newid);
759 
760  Sort_c_ds(newid, r);
761 
762  return newid;
763 }

◆ ComputeImage()

poly SchreyerSyzygyComputation::ComputeImage ( poly  multiplier,
const int  tail 
) const

low level computation...

Definition at line 1238 of file syzextra.cc.

1239 {
1240  const ring& r = m_rBaseRing;
1241 
1242  assume(m_idTails != NULL && m_idTails->m != NULL);
1243  assume( tail >= 0 && tail < IDELEMS(m_idTails) );
1244 
1245  p_Test(multiplier, r);
1246 
1247  const poly t = m_idTails->m[tail]; // !!!
1248 
1249  if(t != NULL)
1250  {
1251  const poly p = TraverseTail(multiplier, t);
1252 
1253  p_Test(multiplier, r);
1254  return p;
1255  }
1256 
1257  return NULL;
1258 }

◆ 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.

977 {
978 // const SchreyerSyzygyComputationFlags& attributes = m_atttributes;
979 
980 // const BOOLEAN OPT__LEAD2SYZ = attributes.OPT__LEAD2SYZ;
981 // const BOOLEAN OPT__TAILREDSYZ = attributes.OPT__TAILREDSYZ;
982 
983  assume( m_syzLeads == NULL );
984 
985  if( UNLIKELY(bComputeSecondTerms) )
986  {
988 // m_syzLeads = FROM_NAMESPACE(INTERNAL, _Compute2LeadingSyzygyTerms(m_idLeads, m_rBaseRing, m_atttributes));
990  }
991  else
992  {
993  assume( !OPT__LEAD2SYZ );
994 
996  }
997 // m_syzLeads = FROM_NAMESPACE(INTERNAL, _ComputeLeadingSyzygyTerms(m_idLeads, m_rBaseRing, m_atttributes));
998 
999  // NOTE: set m_LS if tails are to be reduced!
1000  assume( m_syzLeads!= NULL );
1001 
1002  if ( LIKELY( OPT__TAILREDSYZ && !OPT__IGNORETAILS && (IDELEMS(m_syzLeads) > 0) && !((IDELEMS(m_syzLeads) == 1) && (m_syzLeads->m[0] == NULL)) ) )
1003  {
1004  m_LS = m_syzLeads;
1006  assume( m_checker.IsNonempty() ); // TODO: this always fails... BUG????
1007  }
1008 
1009  if( UNLIKELY( OPT__PROT ) ) Print("(L%dS:%d)", bComputeSecondTerms ? 2 : 1, IDELEMS(m_syzLeads));
1010 
1011 }

◆ ComputeSyzygy()

void SchreyerSyzygyComputation::ComputeSyzygy ( )

The main driver function: computes.

Definition at line 806 of file syzextra.cc.

807 {
808  assume( m_idLeads != NULL );
809  assume( m_idTails != NULL );
810 
811  const ideal& L = m_idLeads;
812  const ideal& T = m_idTails;
813 
814  ideal& TT = m_syzTails;
815  const ring& R = m_rBaseRing;
816 
817 // if( m_sum_bucket == NULL )
818 // m_sum_bucket = sBucketCreate(R);
819 // assume ( sIsEmpty(m_sum_bucket) );
820 
821  if( m_spoly_bucket == NULL )
823 
824 
825  assume( IDELEMS(L) == IDELEMS(T) );
826 
827 #ifdef SING_NDEBUG
828  int t, r; // for rtimer benchmarking in prot realease mode
829 #endif
830 
832  Print("\n{ \"syzygylayer\": \"%d\", \"hybridnf\": \"%d\", \"diagrams\": \n[", OPT__SYZNUMBER, OPT__HYBRIDNF );
833 
834  if( UNLIKELY(OPT__PROT) ) Print("\n[%d]", OPT__SYZNUMBER );
835 
836  if( m_syzLeads == NULL )
837  {
838 #ifdef SING_NDEBUG
840  {
841  t = getTimer(); r = getRTimer();
842  Print("\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: t: %d, r: %d\n", r, t, r);
843  }
844 #endif
845 
846  ComputeLeadingSyzygyTerms( OPT__LEAD2SYZ && !OPT__IGNORETAILS ); // 2 terms OR 1 term!
847 
848 #ifdef SING_NDEBUG
850  {
851  t = getTimer() - t; r = getRTimer() - r;
852  Print("\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::ComputeLeadingSyzygyTerms: dt: %d, dr: %d\n", getRTimer(), t, r);
853  }
854 #endif
855 
856  }
857 
858  assume( m_syzLeads != NULL );
859  ideal& LL = m_syzLeads;
860  const int size = IDELEMS(LL);
861 
862  TT = idInit(size, 0);
863 
864  if( size == 1 && LL->m[0] == NULL )
865  {
867  PrintS("]},");
868  return;
869  }
870 
871 
872  // use hybrid (Schreyer NF) method?
873  const bool method = (OPT__HYBRIDNF == 1); // || (OPT__HYBRIDNF == 2 && OPT__SYZNUMBER < 3);
874 
875  if( UNLIKELY(OPT__PROT) ) Print("[%s NF|%s]",(method) ? "PR" : "TT", (NOPRODUCT == 1)? "_,_": "^*^" );
876 
877 
878  if( LIKELY(!OPT__IGNORETAILS) )
879  {
880  if( T != NULL )
881  {
882 #ifdef SING_NDEBUG
884  {
885  t = getTimer(); r = getRTimer();
886  Print("\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): t: %d, r: %d\n", r, t, r);
887  }
888 #endif
889 
890  SetUpTailTerms();
891 
892 #ifdef SING_NDEBUG
894  {
895  t = getTimer() - t; r = getRTimer() - r;
896  Print("\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SetUpTailTerms(): dt: %d, dr: %d\n", getRTimer(), t, r);
897  }
898 #endif
899  }
900  }
901 
902 #ifdef SING_NDEBUG
904  {
905  t = getTimer(); r = getRTimer();
906  Print("\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: t: %d, r: %d\n", r, t, r);
907  }
908 #endif
909 
910 // for( int k = 0; k < size; ++k ) // TODO: should be fine now!
911  for( int k = size - 1; k >= 0; --k )
912  {
913  const poly a = LL->m[k]; assume( a != NULL );
914 
915  poly a2 = pNext(a);
916 
917  // Splitting 2-terms Leading syzygy module
918  if( a2 != NULL )
919  pNext(a) = NULL;
920 
922  {
923  TT->m[k] = NULL;
924 
925  assume( a2 != NULL );
926 
927  if( a2 != NULL )
928  p_Delete(&a2, R);
929 
930  continue;
931  }
932 
933  // TT->m[k] = a2;
934 
935  poly nf;
936 
937  if( method )
938  nf = SchreyerSyzygyNF(a, a2);
939  else
940  nf = TraverseNF(a, a2);
941 
942  TT->m[k] = nf;
943 
944  if( UNLIKELY(OPT__SYZCHECK) )
945  {
946  // TODO: check the correctness (syzygy property): a + TT->m[k] should be a syzygy!!!
947 
948  poly s = pp_Add_qq( a, TT->m[k], R); // current syzygy
949 
950  poly vp = p_VectorProductLT(s, L, T, R);
951 
952  assume( vp == NULL );
953 
954  if( UNLIKELY( OPT__PROT && (vp != NULL) ) ) Warn("ERROR: SyzCheck failed, wrong tail: [%d]\n\n", k); // check k'th syzygy failed
955 
956  p_Delete(&vp, R);
957  }
958  }
959 
960 #ifdef SING_NDEBUG
962  {
963  t = getTimer() - t; r = getRTimer() - r;
964  Print("\n%% %5d **!TIME4!** SchreyerSyzygyComputation::ComputeSyzygy::SyzygyLift: dt: %d, dr: %d\n", getRTimer(), t, r);
965  }
966 #endif
967 
968  TT->rank = id_RankFreeModule(TT, R);
969 
971  PrintS("\n]},");
972 
973  if( UNLIKELY(OPT__PROT) ) PrintLn();
974 }

◆ PrintStats()

void SchreyerSyzygyComputation::PrintStats ( ) const

print statistics about the used heuristics

Definition at line 533 of file syzextra.cc.

534 {
535  Print("SchreyerSyzygyComputation Stats: (PP/ST: {c: %lu, C: %lu, P: %lu} + %lu, LOT: %lu, LCM: %lu, ST:%lu, LK: %lu {*: %lu})\n",
536  m_stat[1], m_stat[2], m_stat[3], m_stat[0],
537  m_stat[4], m_stat[5],
538  m_stat[8],
539  m_stat[6] + m_stat[7], m_stat[7]
540  );
541 }

◆ 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.

400  {
401  syzL = m_syzLeads; syzT = m_syzTails;
402 
403  m_syzLeads = m_syzTails = NULL; // m_LS ?
404 
405  if ( UNLIKELY(OPT__PROT) )
406  PrintStats();
407  }

◆ 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.

1354 {
1356 
1357  const ideal& L = m_idLeads;
1358  const ideal& T = m_idTails;
1359  const ring& r = m_rBaseRing;
1360 
1361  assume( multiplier != NULL );
1362  assume( term4reduction != NULL );
1363 
1364 
1365  assume( L != NULL );
1366  assume( T != NULL );
1367 
1368  p_Test(multiplier, r);
1369 
1370  // simple implementation with FindReducer:
1371  poly s = NULL;
1372 
1373  if( (!OPT__TAILREDSYZ) || m_lcm.Check(multiplier) ) // TODO: UNLIKELY / LIKELY ????
1374  {
1375 #if NOPRODUCT
1376  s = m_div.FindReducer(multiplier, term4reduction, syztermCheck, m_checker); // s ????
1377  p_Test(s, r);
1378 
1379  p_Test(multiplier, r);
1380 
1381  if( s == NULL ) // No Reducer?
1382  {
1383  if( UNLIKELY(OPT__PROT) ) ++ m_stat[4]; // PrintS("$"); // LOT
1384  return NULL;
1385  }
1386 
1387 #else
1388  // NOTE: only LT(term4reduction) should be used in the following:
1389  poly product = pp_Mult_mm(multiplier, term4reduction, r);
1390  p_Test(product, r);
1391 
1392  s = m_div.FindReducer(product, syztermCheck, m_checker); // ??
1393  p_Test(s, r);
1394 
1395  p_Test(multiplier, r);
1396 
1397  if( s == NULL ) // No Reducer?
1398  {
1399  if( UNLIKELY(OPT__PROT) ) ++ m_stat[4]; // PrintS("$"); // LOT
1400  return NULL;
1401  }
1402 
1403  p_Delete(&product, r);
1404 #endif
1405  }
1406 
1407  if( s == NULL ) // No Reducer?
1408  {
1410  {
1411  ++ m_stat[5]; // PrintS("%"); // check LCM !
1412  }
1413  return NULL;
1414  }
1415 
1416  p_Test(multiplier, r);
1417  p_Test(s, r);
1418 
1419  poly b = leadmonom(s, r);
1420 
1421  p_Test(b, r);
1422 
1423  const int c = p_GetComp(s, r) - 1;
1424  assume( c >= 0 && c < IDELEMS(T) );
1425 
1426 
1427  if( UNLIKELY( OPT__TREEOUTPUT ) )
1428  PrintS("\", \"children\": [");
1429 
1430  const poly t = TraverseTail(b, c); // T->m[c];
1431 
1432  p_Test(multiplier, r);
1433 
1434  if( t != NULL )
1435  s = p_Add_q(s, t, r);
1436 
1437  p_Test(multiplier, r);
1438 
1439  return s;
1440 }

◆ 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.

1014 {
1016 
1017  const ideal& L = m_idLeads;
1018  const ideal& T = m_idTails;
1019  const ring& r = m_rBaseRing;
1020 
1021  assume( syz_lead != NULL );
1022 
1023  if( syz_2 == NULL )
1024  {
1025  const int rr = p_GetComp(syz_lead, r) - 1;
1026 
1027  assume( rr >= 0 && rr < IDELEMS(T) );
1028  assume( rr >= 0 && rr < IDELEMS(L) );
1029 
1030 #if NOPRODUCT
1031  syz_2 = m_div.FindReducer(syz_lead, L->m[rr], syz_lead, m_checker);
1032  p_Test(syz_2, r);
1033 
1034 #else
1035  poly aa = leadmonom(syz_lead, r); assume( aa != NULL); // :(
1036  aa = p_Mult_mm(aa, L->m[rr], r);
1037 
1038  syz_2 = m_div.FindReducer(aa, syz_lead, m_checker);
1039  p_Test(syz_2, r);
1040 
1041  p_Delete(&aa, r);
1042 #endif
1043 
1044  }
1045 
1046  assume( syz_2 != NULL ); // by construction of S-Polynomial
1047 
1048  assume( L != NULL );
1049  assume( T != NULL );
1050 
1051  assume( IDELEMS(L) == IDELEMS(T) );
1052 
1053  int c = p_GetComp(syz_lead, r) - 1;
1054 
1055  assume( c >= 0 && c < IDELEMS(T) );
1056 
1057  if( m_spoly_bucket == NULL )
1059 
1061 
1062 
1063  kBucket_pt bucket = m_spoly_bucket; assume( bucket != NULL ); kbTest(bucket); m_spoly_bucket = NULL;
1064 
1065 // kBucketInit(bucket, NULL, 0); // not needed!?
1066 
1067  poly p = leadmonom(syz_lead, r); // :(
1068 // poly spoly = pp_Mult_qq(p, T->m[c], r);
1069  kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // TODO: store pLength(T->m[c]) separately!?
1070  p_Delete(&p, r);
1071 
1072  kbTest(bucket);
1073 
1074  c = p_GetComp(syz_2, r) - 1;
1075  assume( c >= 0 && c < IDELEMS(T) );
1076 
1077  p = leadmonom(syz_2, r); // :(
1078 // spoly = p_Add_q(spoly, pp_Mult_qq(p, T->m[c], r), r);
1079  kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // pLength(T->m[c])?!
1080  kbTest(bucket);
1081  p_Delete(&p, r);
1082 
1083 // const bool bUsePolynomial = TEST_OPT_NOT_BUCKETS; // || (pLength(spoly) < MIN_LENGTH_BUCKET);
1084 // CPolynomialSummator tail(r, bUsePolynomial);
1085  tail.Add(syz_2, 1);
1086 
1087  kbTest(bucket);
1088  for( poly spoly = kBucketExtractLm(bucket); spoly != NULL; p_LmDelete(&spoly, r), spoly = kBucketExtractLm(bucket))
1089  {
1090  kbTest(bucket);
1091  poly t = m_div.FindReducer(spoly, NULL, m_checker);
1092  p_Test(t, r);
1093 
1094  if( t != NULL )
1095  {
1096  p = leadmonom(t, r); // :(
1097  c = p_GetComp(t, r) - 1;
1098 
1099  assume( c >= 0 && c < IDELEMS(T) );
1100 
1101  kBucket_Plus_mm_Mult_pp(bucket, p, T->m[c], 0); // pLength(T->m[c])?
1102 // spoly = p_Add_q(spoly, pp_Mult_qq(p, T->m[c], r), r);
1103 
1104  p_Delete(&p, r);
1105 
1106  tail.Add(t, 1);
1107  } // otherwise discard that leading term altogether!
1108  else
1109  if( UNLIKELY(OPT__PROT) ) ++ m_stat[4]; // PrintS("$"); // LOT
1110 
1111  kbTest(bucket);
1112  }
1113 
1114  kbTest(bucket);
1115 
1116  // now bucket must be empty!
1117  assume( kBucketClear(bucket) == NULL );
1118 
1119  const poly result = tail.ClearAdd(); // TODO: use Merge with sBucket???
1120 
1121 
1122  if( m_spoly_bucket == NULL )
1123  m_spoly_bucket = bucket;
1124  else
1125  kBucketDestroy(&bucket);
1126 
1127 
1128  if( UNLIKELY(OPT__TREEOUTPUT) )
1129  {
1130  PrintS("]},");
1131  }
1132  return result;
1133 }

◆ 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.

475 {
476  const ideal idTails = m_idTails;
477  assume( idTails != NULL );
478  assume( idTails->m != NULL );
479  const ring r = m_rBaseRing;
480 
481  unsigned long pp[4] = {0,0,0,0}; // count preprocessed terms...
482 
483  for( int p = IDELEMS(idTails) - 1; p >= 0; --p )
484  for( poly* tt = &(idTails->m[p]); (*tt) != NULL; )
485  {
486  const poly t = *tt;
487  const int k = m_div.PreProcessTerm(t, m_checker); // 0..3
488  assume( 0 <= k && k <= 3 );
489 
490  pp[k]++; // collect stats
491 
492  if( k )
493  {
494  (*tt) = p_LmDeleteAndNext(t, r); // delete the lead and next...
495  }
496  else
497  tt = &pNext(t); // go next?
498 
499  }
500 
501  if( UNLIKELY(OPT__PROT) )
502  {
503  Print("(PP/ST: {c: %lu, C: %lu, P: %lu} + %lu)", pp[1], pp[2], pp[3], pp[0]);
504  m_stat[0] += pp [0]; m_stat[1] += pp [1]; m_stat[2] += pp [2]; m_stat[3] += pp [3];
505  }
506 }

◆ TraverseNF()

poly SchreyerSyzygyComputation::TraverseNF ( const poly  syz_lead,
const poly  syz_2 = NULL 
) const

Definition at line 765 of file syzextra.cc.

766 {
767  const ideal& L = m_idLeads;
768  const ideal& T = m_idTails;
769 
770  const ring& R = m_rBaseRing;
771 
772  const int r = p_GetComp(a, R) - 1;
773 
774  assume( r >= 0 && r < IDELEMS(T) );
775  assume( r >= 0 && r < IDELEMS(L) );
776 
777  assume( a != NULL );
778 
779  poly aa = leadmonom(a, R); assume( aa != NULL); // :(
780 
781  poly t = TraverseTail(aa, r);
782 
783  if( a2 != NULL )
784  {
786 
787  // replace the following... ?
788  const int r2 = p_GetComp(a2, R) - 1; poly aa2 = leadmonom(a2, R); // :(
789 
790  assume( r2 >= 0 && r2 < IDELEMS(T) );
791 
792  poly s = TraverseTail(aa2, r2);
793 
794  p_Delete(&aa2, R);
795 
796  t = p_Add_q(a2, p_Add_q(t, s, R), R);
797 
798  } else
799  t = p_Add_q(t, ReduceTerm(aa, L->m[r], a), R); // should be identical to bove with a2
800 
801  p_Delete(&aa, R);
802 
803  return t;
804 }

◆ TraverseTail() [1/2]

poly SchreyerSyzygyComputation::TraverseTail ( poly  multiplier,
const int  tail 
) const

High level caching function!!!

Definition at line 1144 of file syzextra.cc.

1145 {
1146  const ring& r = m_rBaseRing;
1147 
1148  assume(m_idTails != NULL && m_idTails->m != NULL);
1149  assume( tail >= 0 && tail < IDELEMS(m_idTails) );
1150 
1151  p_Test(multiplier, r);
1152 
1153  if( UNLIKELY(OPT__NOCACHING) )
1154  return ComputeImage(multiplier, tail);
1155 
1156  // TODO: store (multiplier, tail) -.-^-.-^-.--> !
1157  TCache::iterator top_itr = m_cache.find(tail);
1158 
1159  if ( top_itr != m_cache.end() )
1160  {
1161  assume( top_itr->first == tail );
1162 
1163  TP2PCache& T = top_itr->second;
1164 
1165  TP2PCache::iterator itr = T.find(multiplier);
1166 
1167  if( itr != T.end() ) // Yey - Reuse!!!
1168  {
1169  assume( p_LmEqual(itr->first, multiplier, r) );
1170 
1171  if( itr->second == NULL ) // leadcoeff plays no role if value is NULL!
1172  return (NULL);
1173 
1174  poly p = p_Copy(itr->second, r); // COPY!!!
1175 
1176  p_Test(multiplier, r);
1177 
1178  if( !n_Equal( pGetCoeff(multiplier), pGetCoeff(itr->first), r->cf) ) // normalize coeffs!?
1179  {
1180  number n = n_Div( pGetCoeff(multiplier), pGetCoeff(itr->first), r->cf); // new number
1181 
1182  if( UNLIKELY( OPT__TREEOUTPUT ) )
1183  {
1184  StringSetS("");
1185  n_Write(n, r->cf);
1186  char* s = StringEndS();
1187  Print("\"recale\": \"%s\", ", s);
1188  omFree(s);
1189  }
1190 
1191  if( UNLIKELY( OPT__PROT ) ) ++ m_stat[7]; // PrintS("l*"); // lookup & rescale
1192 
1193  p = p_Mult_nn(p, n, r); // !
1194  n_Delete(&n, r->cf);
1195  } else
1196  if( UNLIKELY( OPT__PROT ) ) ++ m_stat[6]; // PrintS("l"); // lookup no rescale
1197 
1198  p_Test(multiplier, r);
1199 
1200  return p;
1201  }
1202 
1203 
1204  p_Test(multiplier, r);
1205 
1206  const poly p = ComputeImage(multiplier, tail);
1207 
1208  if( UNLIKELY(OPT__PROT) ) ++ m_stat[8]; // PrintS("S"); // store
1209 
1210  p_Test(multiplier, r);
1211 
1212  T.insert( TP2PCache::value_type(myp_Head(multiplier, (p==NULL), r), p) ); // T[ multiplier ] = p;
1213 
1214  p_Test(multiplier, r);
1215 
1216 // if( p == NULL )
1217 // return (NULL);
1218 
1219  return p_Copy(p, r);
1220  }
1221 
1222  CCacheCompare o(r); TP2PCache T(o);
1223 
1224  const poly p = ComputeImage(multiplier, tail);
1225 
1226  if( UNLIKELY( OPT__PROT ) ) ++ m_stat[8]; // PrintS("S"); // store // %d", tail + 1);
1227 
1228  T.insert( TP2PCache::value_type(myp_Head(multiplier, (p==NULL), r), p) );
1229 
1230  m_cache.insert( TCache::value_type(tail, T) );
1231 
1232 // if( p == NULL )
1233 // return (NULL);
1234 
1235  return p_Copy(p, r);
1236 }

◆ 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.

1262 {
1264 
1265  const ideal& L = m_idLeads;
1266  const ideal& T = m_idTails;
1267  const ring& r = m_rBaseRing;
1268 
1269  assume( multiplier != NULL );
1270 
1271  assume( L != NULL );
1272  assume( T != NULL );
1273 
1274  p_Test(multiplier, r);
1275 
1276  if( UNLIKELY( !( (!OPT__TAILREDSYZ) || m_lcm.Check(multiplier) )) )
1277  {
1279  {
1280  ++ m_stat[5]; // PrintS("%"); // check LCM !
1281  }
1282  return NULL;
1283  }
1284 
1285  // const bool bUsePolynomial = TEST_OPT_NOT_BUCKETS; // || (pLength(tail) < MIN_LENGTH_BUCKET);
1286 
1288 /*
1289  sBucket_pt sum;
1290 
1291  if( m_sum_bucket == NULL )
1292  sum = sBucketCreate(r);
1293  else
1294  {
1295  if( !sIsEmpty(m_sum_bucket) )
1296  sum = sBucketCreate(r);
1297  else
1298  {
1299  sum = m_sum_bucket;
1300  m_sum_bucket = NULL;
1301  }
1302  }
1303 
1304 
1305  assume( sum != NULL ); assume ( sIsEmpty(sum) );
1306  assume( r == sBucketGetRing(sum) );
1307 */
1308 
1309 // poly s; int len;
1310 
1311  // CPolynomialSummator sum(r, bUsePolynomial);
1312  // poly s = NULL;
1313 
1314  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1315  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1316  for(poly p = tail; p != NULL; p = pNext(p)) // iterate over the tail
1317  {
1318  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1319  const poly rt = ReduceTerm(multiplier, p, NULL); // TODO: also return/store length?
1320  sum.Add(rt);
1321  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1322  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1323  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1324 
1325 // const int lp = pLength(rt);
1326 // if( rt != NULL && lp != 0 )
1327 // sBucket_Add_p(sum, rt, lp);
1328  }
1329  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1330  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1331 
1332 // sBucketClearAdd(sum, &s, &len); // Will Not Clear?!?
1333  const poly s = sum.ClearAdd();
1334 
1335 // assume( sum != NULL ); assume ( sIsEmpty(sum) );
1336 /*
1337  if( m_sum_bucket == NULL )
1338  m_sum_bucket = sum;
1339  else
1340  sBucketDestroy(&sum);
1341 
1342  assume( pLength(s) == len );
1343 */
1344 
1345  p_Test(multiplier, r);
1346 
1347  return s;
1348 }

Friends And Related Function Documentation

◆ CLCM

friend class CLCM
friend

Definition at line 349 of file syzextra.h.

◆ CReducerFinder

friend class CReducerFinder
friend

Definition at line 350 of file syzextra.h.

Field Documentation

◆ m_cache

TCache SchreyerSyzygyComputation::m_cache
mutableprivate

Definition at line 483 of file syzextra.h.

◆ m_checker

CReducerFinder SchreyerSyzygyComputation::m_checker
private

for checking tail-terms and makeing them irreducible (wrt m_LS!)

Definition at line 481 of file syzextra.h.

◆ m_div

const CReducerFinder SchreyerSyzygyComputation::m_div
private

Divisor finder.

Definition at line 478 of file syzextra.h.

◆ m_idLeads

const ideal SchreyerSyzygyComputation::m_idLeads
private

input leading terms

Definition at line 460 of file syzextra.h.

◆ m_idTails

const ideal SchreyerSyzygyComputation::m_idTails
private

input tails

Definition at line 463 of file syzextra.h.

◆ m_lcm

const CLCM SchreyerSyzygyComputation::m_lcm
private

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

SBucketFactory SchreyerSyzygyComputation::m_sum_bucket_factory
mutableprivate

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

output (syzygy) tails

Definition at line 469 of file syzextra.h.


The documentation for this class was generated from the following files:
SchreyerSyzygyComputationFlags::m_rBaseRing
const ring m_rBaseRing
global base ring
Definition: syzextra.h:214
p_LmDeleteAndNext
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:712
OPT_REDSB
#define OPT_REDSB
Definition: options.h:74
p_GetCoeff
#define p_GetCoeff(p, r)
Definition: monomials.h:54
NOPRODUCT
#define NOPRODUCT
Definition: syzextra.h:33
p_GetComp
#define p_GetComp(p, r)
Definition: monomials.h:68
SchreyerSyzygyComputation::m_div
const CReducerFinder m_div
Divisor finder.
Definition: syzextra.h:478
SchreyerSyzygyComputation::Compute1LeadingSyzygyTerms
ideal Compute1LeadingSyzygyTerms()
just leading terms
Definition: syzextra.cc:544
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:457
j
int j
Definition: facHensel.cc:105
omFree
#define omFree(addr)
Definition: omAllocDecl.h:259
p_SetCoeff0
#define p_SetCoeff0(p, n, r)
Definition: monomials.h:64
SchreyerSyzygyComputationFlags::OPT__HYBRIDNF
const int OPT__HYBRIDNF
Use the usual NF's S-poly reduction while dropping lower order terms 2 means - smart selection!
Definition: syzextra.h:187
k
int k
Definition: cfEzgcd.cc:92
SchreyerSyzygyComputation::m_sum_bucket_factory
SBucketFactory m_sum_bucket_factory
used for simple summing up
Definition: syzextra.h:486
result
return result
Definition: facAbsBiFact.cc:76
SchreyerSyzygyComputationFlags::SchreyerSyzygyComputationFlags
SchreyerSyzygyComputationFlags(idhdl rootRingHdl)
Definition: syzextra.cc:1442
SchreyerSyzygyComputation::m_LS
ideal m_LS
leading syzygy terms used for reducing syzygy tails
Definition: syzextra.h:471
p_Mult_mm
static poly p_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:982
SchreyerSyzygyComputation::m_checker
CReducerFinder m_checker
for checking tail-terms and makeing them irreducible (wrt m_LS!)
Definition: syzextra.h:481
BITSET
#define BITSET
Definition: structs.h:17
id_DelDiv
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...
Definition: simpleideals.cc:341
SchreyerSyzygyComputation::m_idTails
const ideal m_idTails
input tails
Definition: syzextra.h:463
SchreyerSyzygyComputation::PrintStats
void PrintStats() const
print statistics about the used heuristics
Definition: syzextra.cc:533
SI_SAVE_OPT1
#define SI_SAVE_OPT1(A)
Definition: options.h:21
g
g
Definition: cfModGcd.cc:4031
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
LIKELY
#define LIKELY
Definition: auxiliary.h:420
p_Test
#define p_Test(p, r)
Definition: p_polys.h:155
SchreyerSyzygyComputation::m_syzTails
ideal m_syzTails
output (syzygy) tails
Definition: syzextra.h:469
pp_Mult_mm
static poly pp_Mult_mm(poly p, poly m, const ring r)
Definition: p_polys.h:972
StringEndS
char * StringEndS()
Definition: reporter.cc:150
SchreyerSyzygyComputationFlags::OPT__PROT
const bool OPT__PROT
TEST_OPT_PROT.
Definition: syzextra.h:208
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:468
CReducerFinder::FindReducer
poly FindReducer(const poly multiplier, const poly monom, const poly syzterm, const CReducerFinder &checker) const
Definition: syzextra.cc:1823
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
b
CanonicalForm b
Definition: cfModGcd.cc:4044
leadmonom
poly leadmonom(const poly p, const ring r, const bool bSetZeroComp)
return a new term: leading coeff * leading monomial of p with 0 leading component!
Definition: syzextra.cc:288
nf
Definition: gnumpfl.cc:26
TP2PCache
std::map< TCacheKey, TCacheValue, CCacheCompare > TP2PCache
Definition: syzextra.h:333
p_LmEqual
#define p_LmEqual(p1, p2, r)
Definition: p_polys.h:1638
p_SetExp
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
Definition: p_polys.h:476
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:797
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
SchreyerSyzygyComputation::CleanUp
void CleanUp()
Clean up all the accumulated data.
Definition: syzextra.cc:363
SchreyerSyzygyComputation::SchreyerSyzygyNF
poly SchreyerSyzygyNF(const poly syz_lead, poly syz_2=NULL) const
Main HybridNF == 1: poly reduce + LOT + LCM?
Definition: syzextra.cc:1013
rVar
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:582
kBucketExtractLm
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:492
SchreyerSyzygyComputation::m_idLeads
const ideal m_idLeads
input leading terms
Definition: syzextra.h:460
i
int i
Definition: cfEzgcd.cc:125
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition: simpleideals.cc:113
p_VectorProductLT
static FORCE_INLINE poly p_VectorProductLT(poly s, const ideal &L, const ideal &T, const ring &R)
Definition: syzextra.cc:128
kBucketDestroy
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:212
id_RankFreeModule
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
Definition: simpleideals.cc:781
SchreyerSyzygyComputationFlags::OPT__TAILREDSYZ
const int OPT__TAILREDSYZ
Reduce syzygy tails wrt the leading syzygy terms.
Definition: syzextra.h:183
CLCM::Check
bool Check(const poly m) const
Definition: syzextra.cc:2093
n_Write
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:591
Sy_bit
#define Sy_bit(x)
Definition: options.h:31
SchreyerSyzygyComputation::ComputeLeadingSyzygyTerms
void ComputeLeadingSyzygyTerms(bool bComputeSecondTerms=true)
Computes Syz(leads) or only LEAD of it. The result is stored into m_syzLeads.
Definition: syzextra.cc:976
Sort_c_ds
void Sort_c_ds(const ideal id, const ring r)
inplace sorting of the module (ideal) id wrt <_(c,ds)
Definition: syzextra.cc:342
PrintS
void PrintS(const char *s)
Definition: reporter.cc:283
CReducerFinder::PreProcessTerm
int PreProcessTerm(const poly t, CReducerFinder &syzChecker) const
is the term to be "preprocessed" as lower order term or lead to only reducible syzygies....
Definition: syzextra.cc:402
kbTest
BOOLEAN kbTest(kBucket_pt bucket)
Tests.
Definition: kbuckets.cc:193
SchreyerSyzygyComputationFlags::OPT__IGNORETAILS
const int OPT__IGNORETAILS
ignore tails and compute the pure Schreyer frame
Definition: syzextra.h:191
getTimer
int getTimer()
Definition: timer.cc:96
T
static jList * T
Definition: janet.cc:31
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition: simpleideals.cc:171
SchreyerSyzygyComputation::TraverseNF
poly TraverseNF(const poly syz_lead, const poly syz_2=NULL) const
Definition: syzextra.cc:765
SchreyerSyzygyComputation::TraverseTail
poly TraverseTail(poly multiplier, const int tail) const
High level caching function!!!
Definition: syzextra.cc:1144
p_LmDelete
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:698
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
OPT_REDTAIL
#define OPT_REDTAIL
Definition: options.h:89
kBucket_Plus_mm_Mult_pp
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)
Definition: kbuckets.cc:802
SchreyerSyzygyComputation::ReduceTerm
poly ReduceTerm(poly multiplier, poly term4reduction, poly syztermCheck) const
TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ? ???
Definition: syzextra.cc:1353
intvec
Definition: intvec.h:16
isHomog
Definition: structs.h:39
SchreyerSyzygyComputationFlags::OPT__SYZCHECK
const int OPT__SYZCHECK
CheckSyzygyProperty: TODO.
Definition: syzextra.h:205
SchreyerSyzygyComputation::ComputeImage
poly ComputeImage(poly multiplier, const int tail) const
low level computation...
Definition: syzextra.cc:1238
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:538
p_Init
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1249
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:253
SchreyerSyzygyComputationFlags::OPT__NOCACHING
const int OPT__NOCACHING
no caching/stores/lookups
Definition: syzextra.h:211
kBucketClear
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:502
n_InpNeg
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)
Definition: coeffs.h:557
pp_Add_qq
static FORCE_INLINE poly pp_Add_qq(const poly a, const poly b, const ring R)
Definition: syzextra.cc:123
SchreyerSyzygyComputation::m_cache
TCache m_cache
Definition: syzextra.h:483
n_Lcm
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,...
Definition: coeffs.h:712
CCacheCompare
Definition: syzextra.h:319
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:842
p_Add_q
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
SchreyerSyzygyComputation::Compute2LeadingSyzygyTerms
ideal Compute2LeadingSyzygyTerms()
leading + second terms
Definition: syzextra.cc:634
getRTimer
int getRTimer()
Definition: timer.cc:171
StringSetS
void StringSetS(const char *st)
Definition: reporter.cc:127
SchreyerSyzygyComputationFlags::OPT__LEAD2SYZ
const int OPT__LEAD2SYZ
?
Definition: syzextra.h:180
Print
#define Print
Definition: emacs.cc:79
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:36
myp_Head
static FORCE_INLINE poly myp_Head(const poly p, const bool bIgnoreCoeff, const ring r)
Definition: syzextra.cc:271
UNLIKELY
#define UNLIKELY
Definition: auxiliary.h:421
m
int m
Definition: cfEzgcd.cc:121
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:9
SchreyerSyzygyComputation::m_stat
unsigned long m_stat[9]
Statistics: 0..3: as in SetUpTailTerms()::PreProcessTerm() // TODO!!?? 4: number of terms discarded d...
Definition: syzextra.h:497
SBucketWrapper
Definition: syzextra.cc:81
SchreyerSyzygyComputation::m_spoly_bucket
kBucket_pt m_spoly_bucket
for S-Polynomial reductions
Definition: syzextra.h:489
CReducerFinder::IsNonempty
bool IsNonempty() const
Definition: syzextra.h:299
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:238
kBucket
Definition: kbuckets.h:174
R
#define R
Definition: sirandom.c:26
SchreyerSyzygyComputationFlags::OPT__SYZNUMBER
int OPT__SYZNUMBER
Syzygy level (within a resolution)
Definition: syzextra.h:194
CReducerFinder::Initialize
void Initialize(const ideal L)
Definition: syzextra.cc:1481
p_Setm
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:224
Warn
#define Warn
Definition: emacs.cc:76
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
n_Equal
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.
Definition: coeffs.h:460
p
int p
Definition: cfModGcd.cc:4019
SchreyerSyzygyComputation::SetUpTailTerms
void SetUpTailTerms()
Convert the given ideal of tails into the internal representation (with reducers!) Preprocess m_idTai...
Definition: syzextra.cc:474
kBucketCreate
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:205
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
n_Div
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...
Definition: coeffs.h:615
SI_RESTORE_OPT1
#define SI_RESTORE_OPT1(A)
Definition: options.h:24
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:24
kStd
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2095
id_Copy
ideal id_Copy(ideal h1, const ring r)
copy an ideal
Definition: simpleideals.cc:403
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:48
PrintLn
void PrintLn()
Definition: reporter.cc:309
RTIMER_BENCHMARKING
#define RTIMER_BENCHMARKING
Definition: syzextra.cc:61
SchreyerSyzygyComputation::m_lcm
const CLCM m_lcm
Bitmask for variables occuring in leading terms.
Definition: syzextra.h:475
pNext
#define pNext(p)
Definition: monomials.h:40
p_Mult_nn
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:899
SchreyerSyzygyComputation::m_syzLeads
ideal m_syzLeads
output (syzygy) leading terms (+2nd terms?)
Definition: syzextra.h:466
SchreyerSyzygyComputationFlags::OPT__TREEOUTPUT
const int OPT__TREEOUTPUT
output lifting tree
Definition: syzextra.h:202