Public Member Functions | Data Fields
slimgb_alg Class Reference

#include <tgb_internal.h>

Public Member Functions

 slimgb_alg (ideal I, int syz_comp, BOOLEAN F4, int deg_pos)
 
void introduceDelayedPairs (poly *pa, int s)
 
virtual ~slimgb_alg ()
 
void cleanDegs (int lower, int upper)
 
unsigned long pTotaldegree (poly p)
 
int pTotaldegree_full (poly p)
 

Data Fields

char ** states
 
ideal add_later
 
ideal S
 
ring r
 
int * lengths
 
wlen_typeweighted_lengths
 
long * short_Exps
 
kStrategy strat
 
int * T_deg
 
int * T_deg_full
 
poly tmp_lm
 
polytmp_pair_lm
 
sorted_pair_node ** tmp_spn
 
polyexpandS
 
polygcd_of_terms
 
int_pair_nodesoon_free
 
sorted_pair_node ** apairs
 
poly_list_nodeto_destroy
 
mp_array_listF
 
poly_array_listF_minus
 
unsigned int reduction_steps
 
int n
 
int syz_comp
 array_lengths should be greater equal n; More...
 
int array_lengths
 
int normal_forms
 
int current_degree
 
int Rcounter
 
int last_index
 
int max_pairs
 
int pair_top
 
int easy_product_crit
 
int extended_product_crit
 
int average_length
 
int lastDpBlockStart
 
int lastCleanedDeg
 
int deg_pos
 
BOOLEAN use_noro
 
BOOLEAN use_noro_last_block
 
BOOLEAN isDifficultField
 
BOOLEAN completed
 
BOOLEAN is_homog
 
BOOLEAN tailReductions
 
BOOLEAN eliminationProblem
 
BOOLEAN F4_mode
 
BOOLEAN nc
 

Detailed Description

Definition at line 210 of file tgb_internal.h.

Constructor & Destructor Documentation

◆ slimgb_alg()

slimgb_alg::slimgb_alg ( ideal  I,
int  syz_comp,
BOOLEAN  F4,
int  deg_pos 
)

Definition at line 3175 of file tgb.cc.

3176 {
3177  this->deg_pos = deg_pos;
3178  lastCleanedDeg = -1;
3179  completed = FALSE;
3180  this->syz_comp = syz_comp;
3181  r = currRing;
3182  nc = rIsPluralRing (r);
3184  //Print("last dp Block start: %i\n", this->lastDpBlockStart);
3185  is_homog = TRUE;
3186  {
3187  int hzz;
3188  for(hzz = 0; hzz < IDELEMS (I); hzz++)
3189  {
3190  assume (I->m[hzz] != NULL);
3191  int d = this->pTotaldegree (I->m[hzz]);
3192  poly t = I->m[hzz]->next;
3193  while(t)
3194  {
3195  if(d != this->pTotaldegree (t))
3196  {
3197  is_homog = FALSE;
3198  break;
3199  }
3200  t = t->next;
3201  }
3202  if(!(is_homog))
3203  break;
3204  }
3205  }
3206  eliminationProblem = ((!(is_homog)) && ((currRing->pLexOrder) || (I->rank > 1)));
3207  tailReductions = ((is_homog) || ((TEST_OPT_REDTAIL) && (!(I->rank > 1))));
3208  // Print("is homog:%d",c->is_homog);
3209  void *h;
3210  int i;
3211  to_destroy = NULL;
3212  easy_product_crit = 0;
3214  if(rField_is_Zp (r))
3216  else
3218  //not fully correct
3219  //(rChar()==0);
3220  F4_mode = F4;
3221 
3222  reduction_steps = 0;
3223  last_index = -1;
3224 
3225  F = NULL;
3226  F_minus = NULL;
3227 
3228  Rcounter = 0;
3229 
3230  soon_free = NULL;
3231 
3232  tmp_lm = pOne ();
3233 
3234  normal_forms = 0;
3235  current_degree = 1;
3236 
3237  max_pairs = 5 * IDELEMS (I);
3238 
3239  apairs =
3240  (sorted_pair_node **) omalloc (sizeof (sorted_pair_node *) * max_pairs);
3241  pair_top = -1;
3242 
3243  int n = IDELEMS (I);
3244  array_lengths = n;
3245 
3246 
3247  i = 0;
3248  this->n = 0;
3249  T_deg = (int *) omalloc (n * sizeof (int));
3250  if(eliminationProblem)
3251  T_deg_full = (int *) omalloc (n * sizeof (int));
3252  else
3253  T_deg_full = NULL;
3254  tmp_pair_lm = (poly *) omalloc (n * sizeof (poly));
3255  tmp_spn = (sorted_pair_node **) omalloc (n * sizeof (sorted_pair_node *));
3256  lm_bin = omGetSpecBin (POLYSIZE + (r->ExpL_Size) * sizeof (long));
3257 #ifdef HEAD_BIN
3258  HeadBin = omGetSpecBin (POLYSIZE + (currRing->ExpL_Size) * sizeof (long));
3259 #endif
3260  /* omUnGetSpecBin(&(c->HeadBin)); */
3261 #ifndef HAVE_BOOST
3262 #ifdef USE_STDVECBOOL
3263 #else
3264  h = omalloc (n * sizeof (char *));
3265 
3266  states = (char **) h;
3267 #endif
3268 #endif
3269  h = omalloc (n * sizeof (int));
3270  lengths = (int *) h;
3271  weighted_lengths = (wlen_type *) omAllocAligned (n * sizeof (wlen_type));
3272  gcd_of_terms = (poly *) omAlloc (n * sizeof (poly));
3273 
3274  short_Exps = (long *) omalloc (n * sizeof (long));
3275  if(F4_mode)
3276  S = idInit (n, I->rank);
3277  else
3278  S = idInit (1, I->rank);
3279  strat = new skStrategy;
3280  if(eliminationProblem)
3281  strat->honey = TRUE;
3282  strat->syzComp = 0;
3286  strat->tailRing = r;
3287  strat->enterS = enterSBba;
3288  strat->sl = -1;
3289  i = n;
3290  i = 1; //some strange bug else
3291  /* initS(c->S,NULL,c->strat); */
3292  /* intS start: */
3293  // i=((i+IDELEMS(c->S)+15)/16)*16;
3294  strat->ecartS = (intset) omAlloc (i * sizeof (int)); /*initec(i); */
3295  strat->sevS = (unsigned long *) omAlloc0 (i * sizeof (unsigned long));
3296  /*initsevS(i); */
3297  strat->S_2_R = (int *) omAlloc0 (i * sizeof (int)); /*initS_2_R(i); */
3298  strat->fromQ = NULL;
3299  strat->Shdl = idInit (1, 1);
3300  strat->S = strat->Shdl->m;
3301  strat->lenS = (int *) omAlloc0 (i * sizeof (int));
3303  strat->lenSw = (wlen_type *) omAlloc0 (i * sizeof (wlen_type));
3304  else
3305  strat->lenSw = NULL;
3306  assume (n > 0);
3307  add_to_basis_ideal_quotient (I->m[0], this, NULL);
3308 
3309  assume (strat->sl == IDELEMS (strat->Shdl) - 1);
3310  if(!(F4_mode))
3311  {
3312  poly *array_arg = I->m;
3313  array_arg++;
3314  introduceDelayedPairs (array_arg, n - 1);
3315  /*
3316  for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis
3317  {
3318  // add_to_basis(I->m[i],-1,-1,c);
3319  si=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
3320  si->i=-1;
3321  si->j=-2;
3322  si->expected_length=pQuality(I->m[i],this,pLength(I->m[i]));
3323  si->deg=pTotaldegree(I->m[i]);
3324  if (!rField_is_Zp(r))
3325  {
3326  p_Cleardenom(I->m[i], r);
3327  }
3328  si->lcm_of_lm=I->m[i];
3329 
3330  // c->apairs[n-1-i]=si;
3331  apairs[n-i-1]=si;
3332  ++(pair_top);
3333  } */
3334  }
3335  else
3336  {
3337  for(i = 1; i < n; i++) //the 1 is wanted, because first element is added to basis
3338  add_to_basis_ideal_quotient (I->m[i], this, NULL);
3339  }
3340  for(i = 0; i < IDELEMS (I); i++)
3341  {
3342  I->m[i] = NULL;
3343  }
3344  idDelete (&I);
3345  add_later = idInit (ADD_LATER_SIZE, S->rank);
3346 #ifdef USE_NORO
3347  use_noro = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3348  && (!(eliminationProblem)) && (n_GetChar(currRing->cf) <= 32003));
3349  use_noro_last_block = false;
3350  if((!(use_noro)) && (lastDpBlockStart <= (currRing->N)))
3351  {
3352  use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3353  && (n_GetChar(currRing->cf) <= 32003));
3354  }
3355 #else
3356  use_noro = false;
3357  use_noro_last_block = false;
3358 #endif
3359  //Print("NORO last block %i",use_noro_last_block);
3360  memset (add_later->m, 0, ADD_LATER_SIZE * sizeof (poly));
3361 }
#define TEST_OPT_REDTAIL
Definition: options.h:111
void introduceDelayedPairs(poly *pa, int s)
Definition: tgb.cc:3139
unsigned int reduction_steps
Definition: tgb_internal.h:257
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
BOOLEAN honey
Definition: kutil.h:366
int syzComp
Definition: kutil.h:342
sorted_pair_node ** add_to_basis_ideal_quotient(poly h, slimgb_alg *c, int *ip)
Definition: tgb.cc:1426
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:9919
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
wlen_set lenSw
Definition: kutil.h:306
#define FALSE
Definition: auxiliary.h:94
int * S_2_R
Definition: kutil.h:330
static int get_last_dp_block_start(ring r)
Definition: tgb.cc:427
sorted_pair_node ** tmp_spn
Definition: tgb_internal.h:237
wlen_type * weighted_lengths
Definition: tgb_internal.h:230
BOOLEAN tailReductions
Definition: tgb_internal.h:279
BOOLEAN use_noro_last_block
Definition: tgb_internal.h:275
#define omAllocAligned
Definition: omAllocDecl.h:273
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:448
int * T_deg_full
Definition: tgb_internal.h:234
#define TRUE
Definition: auxiliary.h:98
int normal_forms
Definition: tgb_internal.h:262
#define POLYSIZE
Definition: monomials.h:241
int_pair_node * soon_free
Definition: tgb_internal.h:240
#define omAlloc(size)
Definition: omAllocDecl.h:210
BOOLEAN F4_mode
Definition: tgb_internal.h:281
ideal add_later
Definition: tgb_internal.h:226
void(* initEcart)(TObject *L)
Definition: kutil.h:266
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
long * short_Exps
Definition: tgb_internal.h:231
BOOLEAN nc
Definition: tgb_internal.h:282
#define ADD_LATER_SIZE
Definition: tgb.cc:39
#define assume(x)
Definition: mod2.h:394
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
intset fromQ
Definition: kutil.h:307
void initEcartBBA(TObject *h)
Definition: kutil.cc:1259
kStrategy strat
Definition: tgb_internal.h:232
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:272
int extended_product_crit
Definition: tgb_internal.h:269
BOOLEAN isDifficultField
Definition: tgb_internal.h:276
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9768
static omBin lm_bin
Definition: tgb.cc:41
int i
Definition: cfEzgcd.cc:123
mp_array_list * F
Definition: tgb_internal.h:250
#define pOne()
Definition: polys.h:297
polyset S
Definition: kutil.h:292
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN is_homog
Definition: tgb_internal.h:278
intset lenS
Definition: kutil.h:305
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
#define omGetSpecBin(size)
Definition: omBin.h:11
int lastCleanedDeg
Definition: tgb_internal.h:272
intset ecartS
Definition: kutil.h:295
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int current_degree
Definition: tgb_internal.h:263
int lastDpBlockStart
Definition: tgb_internal.h:271
#define omalloc(size)
Definition: omAllocDecl.h:228
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:48
char ** states
Definition: tgb_internal.h:221
ring tailRing
Definition: kutil.h:331
BOOLEAN use_noro
Definition: tgb_internal.h:274
int * lengths
Definition: tgb_internal.h:229
BOOLEAN completed
Definition: tgb_internal.h:277
poly * tmp_pair_lm
Definition: tgb_internal.h:236
unsigned long * sevS
Definition: kutil.h:308
BOOLEAN eliminationProblem
Definition: tgb_internal.h:280
int array_lengths
Definition: tgb_internal.h:261
int * intset
Definition: kutil.h:47
poly * gcd_of_terms
Definition: tgb_internal.h:239
int sl
Definition: kutil.h:336
poly_array_list * F_minus
Definition: tgb_internal.h:251
int easy_product_crit
Definition: tgb_internal.h:268
polyrec * poly
Definition: hilb.h:10
int syz_comp
array_lengths should be greater equal n;
Definition: tgb_internal.h:260
ideal Shdl
Definition: kutil.h:289
static Poly * h
Definition: janet.cc:978
#define omAlloc0(size)
Definition: omAllocDecl.h:211
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
Definition: kutil.cc:9229
poly_list_node * to_destroy
Definition: tgb_internal.h:248

◆ ~slimgb_alg()

slimgb_alg::~slimgb_alg ( )
virtual

Definition at line 3363 of file tgb.cc.

3364 {
3365 
3366  if(!(completed))
3367  {
3368  poly *add = (poly *) omalloc ((pair_top + 2) * sizeof (poly));
3369  int piter;
3370  int pos = 0;
3371  for(piter = 0; piter <= pair_top; piter++)
3372  {
3373  sorted_pair_node *s = apairs[piter];
3374  if(s->i < 0)
3375  {
3376  //delayed element
3377  if(s->lcm_of_lm != NULL)
3378  {
3379  add[pos] = s->lcm_of_lm;
3380  pos++;
3381  }
3382  }
3383  free_sorted_pair_node (s, r);
3384  apairs[piter] = NULL;
3385  }
3386  pair_top = -1;
3387  add[pos] = NULL;
3388  pos = 0;
3389  while(add[pos] != NULL)
3390  {
3391  add_to_basis_ideal_quotient (add[pos], this, NULL);
3392  pos++;
3393  }
3394  for(piter = 0; piter <= pair_top; piter++)
3395  {
3396  sorted_pair_node *s = apairs[piter];
3397  assume (s->i >= 0);
3398  free_sorted_pair_node (s, r);
3399  apairs[piter] = NULL;
3400  }
3401  pair_top = -1;
3402  }
3403  id_Delete (&add_later, r);
3404  int i, j;
3405  slimgb_alg *c = this;
3406  while(c->to_destroy)
3407  {
3408  pDelete (&(c->to_destroy->p));
3409  poly_list_node *old = c->to_destroy;
3410  c->to_destroy = c->to_destroy->next;
3411  omfree (old);
3412  }
3413  while(c->F)
3414  {
3415  for(i = 0; i < c->F->size; i++)
3416  {
3417  pDelete (&(c->F->mp[i].m));
3418  }
3419  omfree (c->F->mp);
3420  c->F->mp = NULL;
3421  mp_array_list *old = c->F;
3422  c->F = c->F->next;
3423  omfree (old);
3424  }
3425  while(c->F_minus)
3426  {
3427  for(i = 0; i < c->F_minus->size; i++)
3428  {
3429  pDelete (&(c->F_minus->p[i]));
3430  }
3431  omfree (c->F_minus->p);
3432  c->F_minus->p = NULL;
3433  poly_array_list *old = c->F_minus;
3434  c->F_minus = c->F_minus->next;
3435  omfree (old);
3436  }
3437 #ifndef HAVE_BOOST
3438 #ifndef USE_STDVECBOOL
3439  for(int z = 1 /* zero length at 0 */ ; z < c->n; z++)
3440  {
3441  omfree (c->states[z]);
3442  }
3443  omfree (c->states);
3444 #endif
3445 #endif
3446 
3447  omfree (c->lengths);
3448  omfree (c->weighted_lengths);
3449  for(int z = 0; z < c->n; z++)
3450  {
3451  pDelete (&c->tmp_pair_lm[z]);
3452  omfree (c->tmp_spn[z]);
3453  }
3454  omfree (c->tmp_pair_lm);
3455  omfree (c->tmp_spn);
3456 
3457  omfree (c->T_deg);
3458  if(c->T_deg_full)
3459  omfree (c->T_deg_full);
3460 
3461  omFree (c->strat->ecartS);
3462  omFree (c->strat->sevS);
3463 // initsevS(i);
3464  omFree (c->strat->S_2_R);
3465 
3466 
3467  omFree (c->strat->lenS);
3468 
3469  if(c->strat->lenSw)
3470  omFree (c->strat->lenSw);
3471 
3472  for(i = 0; i < c->n; i++)
3473  {
3474  if(c->gcd_of_terms[i])
3475  pDelete (&(c->gcd_of_terms[i]));
3476  }
3477  omfree (c->gcd_of_terms);
3478 
3479  omfree (c->apairs);
3480  if(TEST_OPT_PROT)
3481  {
3482  //Print("calculated %d NFs\n",c->normal_forms);
3483  Print ("\nNF:%i product criterion:%i, ext_product criterion:%i \n",
3485  }
3486 
3487  for(i = 0; i <= c->strat->sl; i++)
3488  {
3489  if(!c->strat->S[i])
3490  continue;
3491  BOOLEAN found = FALSE;
3492  for(j = 0; j < c->n; j++)
3493  {
3494  if(c->S->m[j] == c->strat->S[i])
3495  {
3496  found = TRUE;
3497  break;
3498  }
3499  }
3500  if(!found)
3501  pDelete (&c->strat->S[i]);
3502  }
3503 // for(i=0;i<c->n;i++)
3504 // {
3505 // if (c->rep[i]!=i)
3506 // {
3507 // // for(j=0;j<=c->strat->sl;j++)
3508 // {
3509 // // if(c->strat->S[j]==c->S->m[i])
3510 // {
3511 // // c->strat->S[j]=NULL;
3512 // // break;
3513 // // }
3514 // // }
3515 // // PrintS("R_delete");
3516 // pDelete(&c->S->m[i]);
3517 // }
3518 // }
3519 
3520  if(completed)
3521  {
3522  for(i = 0; i < c->n; i++)
3523  {
3524  assume (c->S->m[i] != NULL);
3525  if(p_GetComp (c->S->m[i], currRing) > this->syz_comp)
3526  continue;
3527  for(j = 0; j < c->n; j++)
3528  {
3529  if((c->S->m[j] == NULL) || (i == j))
3530  continue;
3531  assume (p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3532  c->S->m[i], ~c->short_Exps[i],
3533  c->r) == p_LmDivisibleBy (c->S->m[j],
3534  c->S->m[i],
3535  c->r));
3536  if(p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3537  c->S->m[i], ~c->short_Exps[i], c->r))
3538  {
3539  pDelete (&c->S->m[i]);
3540  break;
3541  }
3542  }
3543  }
3544  }
3545  omfree (c->short_Exps);
3546 
3547  ideal I = c->S;
3548  IDELEMS (I) = c->n;
3549  idSkipZeroes (I);
3550  for(i = 0; i <= c->strat->sl; i++)
3551  c->strat->S[i] = NULL;
3552  id_Delete (&c->strat->Shdl, c->r);
3553  pDelete (&c->tmp_lm);
3555  delete c->strat;
3556 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define Print
Definition: emacs.cc:83
sorted_pair_node ** add_to_basis_ideal_quotient(poly h, slimgb_alg *c, int *ip)
Definition: tgb.cc:1426
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
#define TEST_OPT_PROT
Definition: options.h:98
wlen_set lenSw
Definition: kutil.h:306
#define FALSE
Definition: auxiliary.h:94
int * S_2_R
Definition: kutil.h:330
static unsigned add[]
Definition: misc_ip.cc:83
sorted_pair_node ** tmp_spn
Definition: tgb_internal.h:237
wlen_type * weighted_lengths
Definition: tgb_internal.h:230
#define p_GetComp(p, r)
Definition: monomials.h:72
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void free_sorted_pair_node(sorted_pair_node *s, ring r)
Definition: tgb.cc:3954
#define omUnGetSpecBin(bin_ptr)
Definition: omBin.h:14
int * T_deg_full
Definition: tgb_internal.h:234
#define TRUE
Definition: auxiliary.h:98
int normal_forms
Definition: tgb_internal.h:262
bool found
Definition: facFactorize.cc:56
ideal add_later
Definition: tgb_internal.h:226
mp_array_list * next
Definition: tgb_internal.h:200
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
long * short_Exps
Definition: tgb_internal.h:231
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:394
kStrategy strat
Definition: tgb_internal.h:232
poly_array_list * next
Definition: tgb_internal.h:208
#define omfree(addr)
Definition: omAllocDecl.h:237
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
Definition: p_polys.h:1802
int extended_product_crit
Definition: tgb_internal.h:269
static omBin lm_bin
Definition: tgb.cc:41
int i
Definition: cfEzgcd.cc:123
mp_array_list * F
Definition: tgb_internal.h:250
polyset S
Definition: kutil.h:292
#define IDELEMS(i)
Definition: simpleideals.h:24
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1768
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
intset lenS
Definition: kutil.h:305
intset ecartS
Definition: kutil.h:295
#define omalloc(size)
Definition: omAllocDecl.h:228
#define NULL
Definition: omList.c:10
char ** states
Definition: tgb_internal.h:221
int * lengths
Definition: tgb_internal.h:229
BOOLEAN completed
Definition: tgb_internal.h:277
#define pDelete(p_ptr)
Definition: polys.h:169
poly * tmp_pair_lm
Definition: tgb_internal.h:236
unsigned long * sevS
Definition: kutil.h:308
poly * gcd_of_terms
Definition: tgb_internal.h:239
int sl
Definition: kutil.h:336
poly_list_node * next
Definition: tgb_internal.h:182
poly_array_list * F_minus
Definition: tgb_internal.h:251
int easy_product_crit
Definition: tgb_internal.h:268
polyrec * poly
Definition: hilb.h:10
ideal Shdl
Definition: kutil.h:289
int BOOLEAN
Definition: auxiliary.h:85
poly_list_node * to_destroy
Definition: tgb_internal.h:248
monom_poly * mp
Definition: tgb_internal.h:198

Member Function Documentation

◆ cleanDegs()

void slimgb_alg::cleanDegs ( int  lower,
int  upper 
)

Definition at line 3794 of file tgb.cc.

3795 {
3796  assume (is_homog);
3797  int deg;
3798  if(TEST_OPT_PROT)
3799  {
3800  PrintS ("C");
3801  }
3802  for(deg = lower; deg <= upper; deg++)
3803  {
3804  int i;
3805  for(i = 0; i < n; i++)
3806  {
3807  if(T_deg[i] == deg)
3808  {
3809  poly h;
3810  h = S->m[i];
3811  h = redNFTail (h, strat->sl, strat, lengths[i]);
3812  if(!rField_is_Zp (r))
3813  {
3814  p_Cleardenom (h, r); //includes p_Content(h,r);
3815  }
3816  else
3817  pNorm (h);
3818  //TODO:GCD of TERMS
3819  poly got =::gcd_of_terms (h, r);
3820  p_Delete (&gcd_of_terms[i], r);
3821  gcd_of_terms[i] = got;
3822  int len = pLength (h);
3823  wlen_type wlen = pQuality (h, this, len);
3824  if(weighted_lengths)
3825  weighted_lengths[i] = wlen;
3826  lengths[i] = len;
3827  assume (h == S->m[i]);
3828  int j;
3829  for(j = 0; j <= strat->sl; j++)
3830  {
3831  if(h == strat->S[j])
3832  {
3833  int new_pos = simple_posInS (strat, h, len, wlen);
3834  if(strat->lenS)
3835  {
3836  strat->lenS[j] = len;
3837  }
3838  if(strat->lenSw)
3839  {
3840  strat->lenSw[j] = wlen;
3841  }
3842  if(new_pos < j)
3843  {
3844  move_forward_in_S (j, new_pos, strat);
3845  }
3846  else
3847  {
3848  if(new_pos > j)
3849  new_pos = new_pos - 1; //is identical with one element
3850  if(new_pos > j)
3851  move_backward_in_S (j, new_pos, strat);
3852  }
3853  break;
3854  }
3855  }
3856  }
3857  }
3858  }
3859  {
3860  int i, j;
3861  for(i = 0; i < this->n; i++)
3862  {
3863  for(j = 0; j < i; j++)
3864  {
3865  if(T_deg[i] + T_deg[j] <= upper)
3866  {
3867  now_t_rep (i, j, this);
3868  }
3869  }
3870  }
3871  }
3872  //TODO resort and update strat->S,strat->lenSw
3873  //TODO mark pairs
3874 }
static void move_backward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1064
#define TEST_OPT_PROT
Definition: options.h:98
wlen_set lenSw
Definition: kutil.h:306
wlen_type * weighted_lengths
Definition: tgb_internal.h:230
static void move_forward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1027
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:394
kStrategy strat
Definition: tgb_internal.h:232
static poly redNFTail(poly h, const int sl, kStrategy strat, int len)
Definition: tgb.cc:2972
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
static unsigned pLength(poly a)
Definition: p_polys.h:189
polyset S
Definition: kutil.h:292
BOOLEAN is_homog
Definition: tgb_internal.h:278
intset lenS
Definition: kutil.h:305
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
int64 wlen_type
Definition: kutil.h:48
int * lengths
Definition: tgb_internal.h:229
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:345
static int simple_posInS(kStrategy strat, poly p, int len, wlen_type wlen)
Definition: tgb.cc:1308
poly * gcd_of_terms
Definition: tgb_internal.h:239
int sl
Definition: kutil.h:336
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2755
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
Definition: tgb.cc:3661

◆ introduceDelayedPairs()

void slimgb_alg::introduceDelayedPairs ( poly pa,
int  s 
)

Definition at line 3139 of file tgb.cc.

3140 {
3141  if(s == 0)
3142  return;
3143  sorted_pair_node **si_array =
3144  (sorted_pair_node **) omalloc (s * sizeof (sorted_pair_node *));
3145 
3146  for(int i = 0; i < s; i++)
3147  {
3148  sorted_pair_node *si =
3149  (sorted_pair_node *) omalloc (sizeof (sorted_pair_node));
3150  si->i = -1;
3151  si->j = -2;
3152  poly p = pa[i];
3153  simplify_poly (p, r);
3154  si->expected_length = pQuality (p, this, pLength (p));
3155  p_Test (p, r);
3156  si->deg = this->pTotaldegree_full (p);
3157  /*if (!rField_is_Zp(r))
3158  {
3159  p_Content(p,r);
3160  p_Cleardenom(p,r);
3161  } */
3162 
3163  si->lcm_of_lm = p;
3164 
3165  // c->apairs[n-1-i]=si;
3166  si_array[i] = si;
3167  }
3168 
3169  qsort (si_array, s, sizeof (sorted_pair_node *), tgb_pair_better_gen2);
3170  apairs = spn_merge (apairs, pair_top + 1, si_array, s, this);
3171  pair_top += s;
3172  omfree (si_array);
3173 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
return P p
Definition: myNF.cc:203
int pTotaldegree_full(poly p)
Definition: tgb_internal.h:294
int tgb_pair_better_gen2(const void *ap, const void *bp)
Definition: tgb.cc:680
#define omfree(addr)
Definition: omAllocDecl.h:237
int i
Definition: cfEzgcd.cc:123
static unsigned pLength(poly a)
Definition: p_polys.h:189
#define p_Test(p, r)
Definition: p_polys.h:160
wlen_type expected_length
Definition: tgb_internal.h:158
#define omalloc(size)
Definition: omAllocDecl.h:228
static void simplify_poly(poly p, ring r)
Definition: tgb.cc:59
sorted_pair_node ** spn_merge(sorted_pair_node **p, int pn, sorted_pair_node **q, int qn, slimgb_alg *c)
Definition: tgb.cc:751
polyrec * poly
Definition: hilb.h:10
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544

◆ pTotaldegree()

unsigned long slimgb_alg::pTotaldegree ( poly  p)
inline

Definition at line 286 of file tgb_internal.h.

287  {
288  pTest(p);
289  //assume(pDeg(p,r)==::p_Totaldegree(p,r));
290  assume(((unsigned long)::p_Totaldegree(p,r))==p->exp[deg_pos]);
291  return p->exp[deg_pos];
292  //return ::pTotaldegree(p,this->r);
293  }
return P p
Definition: myNF.cc:203
#define pTest(p)
Definition: polys.h:398
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1430
#define assume(x)
Definition: mod2.h:394

◆ pTotaldegree_full()

int slimgb_alg::pTotaldegree_full ( poly  p)
inline

Definition at line 294 of file tgb_internal.h.

295  {
296  int rr=0;
297  while(p)
298  {
299  int d=this->pTotaldegree(p);
300  rr=si_max(rr,d);
301  pIter(p);
302  }
303  return rr;
304  }
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
return P p
Definition: myNF.cc:203
#define pIter(p)
Definition: monomials.h:44
static int si_max(const int a, const int b)
Definition: auxiliary.h:120

Field Documentation

◆ add_later

ideal slimgb_alg::add_later

Definition at line 226 of file tgb_internal.h.

◆ apairs

sorted_pair_node** slimgb_alg::apairs

Definition at line 241 of file tgb_internal.h.

◆ array_lengths

int slimgb_alg::array_lengths

Definition at line 261 of file tgb_internal.h.

◆ average_length

int slimgb_alg::average_length

Definition at line 270 of file tgb_internal.h.

◆ completed

BOOLEAN slimgb_alg::completed

Definition at line 277 of file tgb_internal.h.

◆ current_degree

int slimgb_alg::current_degree

Definition at line 263 of file tgb_internal.h.

◆ deg_pos

int slimgb_alg::deg_pos

Definition at line 273 of file tgb_internal.h.

◆ easy_product_crit

int slimgb_alg::easy_product_crit

Definition at line 268 of file tgb_internal.h.

◆ eliminationProblem

BOOLEAN slimgb_alg::eliminationProblem

Definition at line 280 of file tgb_internal.h.

◆ expandS

poly* slimgb_alg::expandS

Definition at line 238 of file tgb_internal.h.

◆ extended_product_crit

int slimgb_alg::extended_product_crit

Definition at line 269 of file tgb_internal.h.

◆ F

mp_array_list* slimgb_alg::F

Definition at line 250 of file tgb_internal.h.

◆ F4_mode

BOOLEAN slimgb_alg::F4_mode

Definition at line 281 of file tgb_internal.h.

◆ F_minus

poly_array_list* slimgb_alg::F_minus

Definition at line 251 of file tgb_internal.h.

◆ gcd_of_terms

poly* slimgb_alg::gcd_of_terms

Definition at line 239 of file tgb_internal.h.

◆ is_homog

BOOLEAN slimgb_alg::is_homog

Definition at line 278 of file tgb_internal.h.

◆ isDifficultField

BOOLEAN slimgb_alg::isDifficultField

Definition at line 276 of file tgb_internal.h.

◆ last_index

int slimgb_alg::last_index

Definition at line 265 of file tgb_internal.h.

◆ lastCleanedDeg

int slimgb_alg::lastCleanedDeg

Definition at line 272 of file tgb_internal.h.

◆ lastDpBlockStart

int slimgb_alg::lastDpBlockStart

Definition at line 271 of file tgb_internal.h.

◆ lengths

int* slimgb_alg::lengths

Definition at line 229 of file tgb_internal.h.

◆ max_pairs

int slimgb_alg::max_pairs

Definition at line 266 of file tgb_internal.h.

◆ n

int slimgb_alg::n

Definition at line 258 of file tgb_internal.h.

◆ nc

BOOLEAN slimgb_alg::nc

Definition at line 282 of file tgb_internal.h.

◆ normal_forms

int slimgb_alg::normal_forms

Definition at line 262 of file tgb_internal.h.

◆ pair_top

int slimgb_alg::pair_top

Definition at line 267 of file tgb_internal.h.

◆ r

ring slimgb_alg::r

Definition at line 228 of file tgb_internal.h.

◆ Rcounter

int slimgb_alg::Rcounter

Definition at line 264 of file tgb_internal.h.

◆ reduction_steps

unsigned int slimgb_alg::reduction_steps

Definition at line 257 of file tgb_internal.h.

◆ S

ideal slimgb_alg::S

Definition at line 227 of file tgb_internal.h.

◆ short_Exps

long* slimgb_alg::short_Exps

Definition at line 231 of file tgb_internal.h.

◆ soon_free

int_pair_node* slimgb_alg::soon_free

Definition at line 240 of file tgb_internal.h.

◆ states

char** slimgb_alg::states

Definition at line 221 of file tgb_internal.h.

◆ strat

kStrategy slimgb_alg::strat

Definition at line 232 of file tgb_internal.h.

◆ syz_comp

int slimgb_alg::syz_comp

array_lengths should be greater equal n;

Definition at line 260 of file tgb_internal.h.

◆ T_deg

int* slimgb_alg::T_deg

Definition at line 233 of file tgb_internal.h.

◆ T_deg_full

int* slimgb_alg::T_deg_full

Definition at line 234 of file tgb_internal.h.

◆ tailReductions

BOOLEAN slimgb_alg::tailReductions

Definition at line 279 of file tgb_internal.h.

◆ tmp_lm

poly slimgb_alg::tmp_lm

Definition at line 235 of file tgb_internal.h.

◆ tmp_pair_lm

poly* slimgb_alg::tmp_pair_lm

Definition at line 236 of file tgb_internal.h.

◆ tmp_spn

sorted_pair_node** slimgb_alg::tmp_spn

Definition at line 237 of file tgb_internal.h.

◆ to_destroy

poly_list_node* slimgb_alg::to_destroy

Definition at line 248 of file tgb_internal.h.

◆ use_noro

BOOLEAN slimgb_alg::use_noro

Definition at line 274 of file tgb_internal.h.

◆ use_noro_last_block

BOOLEAN slimgb_alg::use_noro_last_block

Definition at line 275 of file tgb_internal.h.

◆ weighted_lengths

wlen_type* slimgb_alg::weighted_lengths

Definition at line 230 of file tgb_internal.h.


The documentation for this class was generated from the following files: