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
 
intlengths
 
wlen_typeweighted_lengths
 
long * short_Exps
 
kStrategy strat
 
intT_deg
 
intT_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 ( ideal  I,
int  syz_comp,
BOOLEAN  F4,
int  deg_pos 
)

Definition at line 3178 of file tgb.cc.

3179 {
3180  this->deg_pos = deg_pos;
3181  lastCleanedDeg = -1;
3182  completed = FALSE;
3183  this->syz_comp = syz_comp;
3184  r = currRing;
3185  nc = rIsPluralRing (r);
3187  //Print("last dp Block start: %i\n", this->lastDpBlockStart);
3188  is_homog = TRUE;
3189  {
3190  int hzz;
3191  for(hzz = 0; hzz < IDELEMS (I); hzz++)
3192  {
3193  assume (I->m[hzz] != NULL);
3194  int d = this->pTotaldegree (I->m[hzz]);
3195  poly t = I->m[hzz]->next;
3196  while(t)
3197  {
3198  if(d != this->pTotaldegree (t))
3199  {
3200  is_homog = FALSE;
3201  break;
3202  }
3203  t = t->next;
3204  }
3205  if(!(is_homog))
3206  break;
3207  }
3208  }
3209  eliminationProblem = ((!(is_homog)) && ((currRing->pLexOrder) || (I->rank > 1)));
3210  tailReductions = ((is_homog) || ((TEST_OPT_REDTAIL) && (!(I->rank > 1))));
3211  // Print("is homog:%d",c->is_homog);
3212  void *h;
3213  int i;
3214  to_destroy = NULL;
3215  easy_product_crit = 0;
3217  if(rField_is_Zp (r))
3219  else
3221  //not fully correct
3222  //(rChar()==0);
3223  F4_mode = F4;
3224 
3225  reduction_steps = 0;
3226  last_index = -1;
3227 
3228  F = NULL;
3229  F_minus = NULL;
3230 
3231  Rcounter = 0;
3232 
3233  soon_free = NULL;
3234 
3235  tmp_lm = pOne ();
3236 
3237  normal_forms = 0;
3238  current_degree = 1;
3239 
3240  max_pairs = 5 * IDELEMS (I);
3241 
3242  apairs =
3243  (sorted_pair_node **) omalloc (sizeof (sorted_pair_node *) * max_pairs);
3244  pair_top = -1;
3245 
3246  int n = IDELEMS (I);
3247  array_lengths = n;
3248 
3249 
3250  i = 0;
3251  this->n = 0;
3252  T_deg = (int *) omalloc (n * sizeof (int));
3253  if(eliminationProblem)
3254  T_deg_full = (int *) omalloc (n * sizeof (int));
3255  else
3256  T_deg_full = NULL;
3257  tmp_pair_lm = (poly *) omalloc (n * sizeof (poly));
3258  tmp_spn = (sorted_pair_node **) omalloc (n * sizeof (sorted_pair_node *));
3259  lm_bin = omGetSpecBin (POLYSIZE + (r->ExpL_Size) * sizeof (long));
3260 #ifdef HEAD_BIN
3261  HeadBin = omGetSpecBin (POLYSIZE + (currRing->ExpL_Size) * sizeof (long));
3262 #endif
3263  /* omUnGetSpecBin(&(c->HeadBin)); */
3264 #ifndef HAVE_BOOST
3265 #ifdef USE_STDVECBOOL
3266 #else
3267  h = omalloc (n * sizeof (char *));
3268 
3269  states = (char **) h;
3270 #endif
3271 #endif
3272  h = omalloc (n * sizeof (int));
3273  lengths = (int *) h;
3274  weighted_lengths = (wlen_type *) omAllocAligned (n * sizeof (wlen_type));
3275  gcd_of_terms = (poly *) omAlloc (n * sizeof (poly));
3276 
3277  short_Exps = (long *) omalloc (n * sizeof (long));
3278  if(F4_mode)
3279  S = idInit (n, I->rank);
3280  else
3281  S = idInit (1, I->rank);
3282  strat = new skStrategy;
3283  if(eliminationProblem)
3284  strat->honey = TRUE;
3285  strat->syzComp = 0;
3289  strat->tailRing = r;
3290  strat->enterS = enterSBba;
3291  strat->sl = -1;
3292  i = n;
3293  i = 1; //some strange bug else
3294  /* initS(c->S,NULL,c->strat); */
3295  /* intS start: */
3296  // i=((i+IDELEMS(c->S)+15)/16)*16;
3297  strat->ecartS = (intset) omAlloc (i * sizeof (int)); /*initec(i); */
3298  strat->sevS = (unsigned long *) omAlloc0 (i * sizeof (unsigned long));
3299  /*initsevS(i); */
3300  strat->S_2_R = (int *) omAlloc0 (i * sizeof (int)); /*initS_2_R(i); */
3301  strat->fromQ = NULL;
3302  strat->Shdl = idInit (1, 1);
3303  strat->S = strat->Shdl->m;
3304  strat->lenS = (int *) omAlloc0 (i * sizeof (int));
3306  strat->lenSw = (wlen_type *) omAlloc0 (i * sizeof (wlen_type));
3307  else
3308  strat->lenSw = NULL;
3309  assume (n > 0);
3310  add_to_basis_ideal_quotient (I->m[0], this, NULL);
3311 
3312  assume (strat->sl == IDELEMS (strat->Shdl) - 1);
3313  if(!(F4_mode))
3314  {
3315  poly *array_arg = I->m;
3316  array_arg++;
3317  introduceDelayedPairs (array_arg, n - 1);
3318  /*
3319  for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis
3320  {
3321  // add_to_basis(I->m[i],-1,-1,c);
3322  si=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
3323  si->i=-1;
3324  si->j=-2;
3325  si->expected_length=pQuality(I->m[i],this,pLength(I->m[i]));
3326  si->deg=pTotaldegree(I->m[i]);
3327  if (!rField_is_Zp(r))
3328  {
3329  p_Cleardenom(I->m[i], r);
3330  }
3331  si->lcm_of_lm=I->m[i];
3332 
3333  // c->apairs[n-1-i]=si;
3334  apairs[n-i-1]=si;
3335  ++(pair_top);
3336  } */
3337  }
3338  else
3339  {
3340  for(i = 1; i < n; i++) //the 1 is wanted, because first element is added to basis
3341  add_to_basis_ideal_quotient (I->m[i], this, NULL);
3342  }
3343  for(i = 0; i < IDELEMS (I); i++)
3344  {
3345  I->m[i] = NULL;
3346  }
3347  idDelete (&I);
3348  add_later = idInit (ADD_LATER_SIZE, S->rank);
3349 #ifdef USE_NORO
3350  use_noro = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3351  && (!(eliminationProblem)) && (n_GetChar(currRing->cf) <= 32003));
3352  use_noro_last_block = false;
3353  if((!(use_noro)) && (lastDpBlockStart <= (currRing->N)))
3354  {
3355  use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3356  && (n_GetChar(currRing->cf) <= 32003));
3357  }
3358 #else
3359  use_noro = false;
3360  use_noro_last_block = false;
3361 #endif
3362  //Print("NORO last block %i",use_noro_last_block);
3363  memset (add_later->m, 0, ADD_LATER_SIZE * sizeof (poly));
3364 }
#define TEST_OPT_REDTAIL
Definition: options.h:111
void introduceDelayedPairs(poly *pa, int s)
Definition: tgb.cc:3142
unsigned int reduction_steps
Definition: tgb_internal.h:257
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
BOOLEAN honey
Definition: kutil.h:371
int syzComp
Definition: kutil.h:357
sorted_pair_node ** add_to_basis_ideal_quotient(poly h, slimgb_alg *c, int *ip)
Definition: tgb.cc:1428
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:7466
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
wlen_set lenSw
Definition: kutil.h:318
#define FALSE
Definition: auxiliary.h:140
int * S_2_R
Definition: kutil.h:342
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:444
int * T_deg_full
Definition: tgb_internal.h:234
#define TRUE
Definition: auxiliary.h:144
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
static bool rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:355
BOOLEAN F4_mode
Definition: tgb_internal.h:281
ideal add_later
Definition: tgb_internal.h:226
void(* initEcart)(TObject *L)
Definition: kutil.h:279
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
long * short_Exps
Definition: tgb_internal.h:231
BOOLEAN nc
Definition: tgb_internal.h:282
#define ADD_LATER_SIZE
Definition: tgb.cc:39
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
intset fromQ
Definition: kutil.h:319
void initEcartBBA(TObject *h)
Definition: kutil.cc:1133
kStrategy strat
Definition: tgb_internal.h:232
void idDelete(ideal *h, ring r=currRing)
delete an ideal
Definition: ideals.h:31
int extended_product_crit
Definition: tgb_internal.h:269
BOOLEAN isDifficultField
Definition: tgb_internal.h:276
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:7325
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:286
polyset S
Definition: kutil.h:304
#define IDELEMS(i)
Definition: simpleideals.h:19
BOOLEAN is_homog
Definition: tgb_internal.h:278
intset lenS
Definition: kutil.h:317
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:446
#define omGetSpecBin(size)
Definition: omBin.h:11
int lastCleanedDeg
Definition: tgb_internal.h:272
intset ecartS
Definition: kutil.h:307
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
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:54
char ** states
Definition: tgb_internal.h:221
ring tailRing
Definition: kutil.h:343
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:320
BOOLEAN eliminationProblem
Definition: tgb_internal.h:280
int array_lengths
Definition: tgb_internal.h:261
int * intset
Definition: kutil.h:53
poly * gcd_of_terms
Definition: tgb_internal.h:239
int sl
Definition: kutil.h:351
poly_array_list * F_minus
Definition: tgb_internal.h:251
int easy_product_crit
Definition: tgb_internal.h:268
void enterSBba(LObject p, int atS, kStrategy strat, int atR)
Definition: kutil.cc:6927
int syz_comp
array_lengths should be greater equal n;
Definition: tgb_internal.h:260
ideal Shdl
Definition: kutil.h:301
void(* enterS)(LObject h, int pos, kStrategy strat, int atR)
Definition: kutil.h:285
static Poly * h
Definition: janet.cc:978
#define omAlloc0(size)
Definition: omAllocDecl.h:211
poly_list_node * to_destroy
Definition: tgb_internal.h:248
slimgb_alg::~slimgb_alg ( )
virtual

Definition at line 3366 of file tgb.cc.

3367 {
3368 
3369  if(!(completed))
3370  {
3371  poly *add = (poly *) omalloc ((pair_top + 2) * sizeof (poly));
3372  int piter;
3373  int pos = 0;
3374  for(piter = 0; piter <= pair_top; piter++)
3375  {
3376  sorted_pair_node *s = apairs[piter];
3377  if(s->i < 0)
3378  {
3379  //delayed element
3380  if(s->lcm_of_lm != NULL)
3381  {
3382  add[pos] = s->lcm_of_lm;
3383  pos++;
3384  }
3385  }
3386  free_sorted_pair_node (s, r);
3387  apairs[piter] = NULL;
3388  }
3389  pair_top = -1;
3390  add[pos] = NULL;
3391  pos = 0;
3392  while(add[pos] != NULL)
3393  {
3394  add_to_basis_ideal_quotient (add[pos], this, NULL);
3395  pos++;
3396  }
3397  for(piter = 0; piter <= pair_top; piter++)
3398  {
3399  sorted_pair_node *s = apairs[piter];
3400  assume (s->i >= 0);
3401  free_sorted_pair_node (s, r);
3402  apairs[piter] = NULL;
3403  }
3404  pair_top = -1;
3405  }
3406  id_Delete (&add_later, r);
3407  int i, j;
3408  slimgb_alg *c = this;
3409  while(c->to_destroy)
3410  {
3411  pDelete (&(c->to_destroy->p));
3412  poly_list_node *old = c->to_destroy;
3413  c->to_destroy = c->to_destroy->next;
3414  omfree (old);
3415  }
3416  while(c->F)
3417  {
3418  for(i = 0; i < c->F->size; i++)
3419  {
3420  pDelete (&(c->F->mp[i].m));
3421  }
3422  omfree (c->F->mp);
3423  c->F->mp = NULL;
3424  mp_array_list *old = c->F;
3425  c->F = c->F->next;
3426  omfree (old);
3427  }
3428  while(c->F_minus)
3429  {
3430  for(i = 0; i < c->F_minus->size; i++)
3431  {
3432  pDelete (&(c->F_minus->p[i]));
3433  }
3434  omfree (c->F_minus->p);
3435  c->F_minus->p = NULL;
3436  poly_array_list *old = c->F_minus;
3437  c->F_minus = c->F_minus->next;
3438  omfree (old);
3439  }
3440 #ifndef HAVE_BOOST
3441 #ifndef USE_STDVECBOOL
3442  for(int z = 1 /* zero length at 0 */ ; z < c->n; z++)
3443  {
3444  omfree (c->states[z]);
3445  }
3446  omfree (c->states);
3447 #endif
3448 #endif
3449 
3450  omfree (c->lengths);
3451  omfree (c->weighted_lengths);
3452  for(int z = 0; z < c->n; z++)
3453  {
3454  pDelete (&c->tmp_pair_lm[z]);
3455  omfree (c->tmp_spn[z]);
3456  }
3457  omfree (c->tmp_pair_lm);
3458  omfree (c->tmp_spn);
3459 
3460  omfree (c->T_deg);
3461  if(c->T_deg_full)
3462  omfree (c->T_deg_full);
3463 
3464  omFree (c->strat->ecartS);
3465  omFree (c->strat->sevS);
3466 // initsevS(i);
3467  omFree (c->strat->S_2_R);
3468 
3469 
3470  omFree (c->strat->lenS);
3471 
3472  if(c->strat->lenSw)
3473  omFree (c->strat->lenSw);
3474 
3475  for(i = 0; i < c->n; i++)
3476  {
3477  if(c->gcd_of_terms[i])
3478  pDelete (&(c->gcd_of_terms[i]));
3479  }
3480  omfree (c->gcd_of_terms);
3481 
3482  omfree (c->apairs);
3483  if(TEST_OPT_PROT)
3484  {
3485  //Print("calculated %d NFs\n",c->normal_forms);
3486  Print ("\nNF:%i product criterion:%i, ext_product criterion:%i \n",
3488  }
3489 
3490  for(i = 0; i <= c->strat->sl; i++)
3491  {
3492  if(!c->strat->S[i])
3493  continue;
3494  BOOLEAN found = FALSE;
3495  for(j = 0; j < c->n; j++)
3496  {
3497  if(c->S->m[j] == c->strat->S[i])
3498  {
3499  found = TRUE;
3500  break;
3501  }
3502  }
3503  if(!found)
3504  pDelete (&c->strat->S[i]);
3505  }
3506 // for(i=0;i<c->n;i++)
3507 // {
3508 // if (c->rep[i]!=i)
3509 // {
3510 // // for(j=0;j<=c->strat->sl;j++)
3511 // {
3512 // // if(c->strat->S[j]==c->S->m[i])
3513 // {
3514 // // c->strat->S[j]=NULL;
3515 // // break;
3516 // // }
3517 // // }
3518 // // PrintS("R_delete");
3519 // pDelete(&c->S->m[i]);
3520 // }
3521 // }
3522 
3523  if(completed)
3524  {
3525  for(i = 0; i < c->n; i++)
3526  {
3527  assume (c->S->m[i] != NULL);
3528  if(p_GetComp (c->S->m[i], currRing) > this->syz_comp)
3529  continue;
3530  for(j = 0; j < c->n; j++)
3531  {
3532  if((c->S->m[j] == NULL) || (i == j))
3533  continue;
3534  assume (p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3535  c->S->m[i], ~c->short_Exps[i],
3536  c->r) == p_LmDivisibleBy (c->S->m[j],
3537  c->S->m[i],
3538  c->r));
3539  if(p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3540  c->S->m[i], ~c->short_Exps[i], c->r))
3541  {
3542  pDelete (&c->S->m[i]);
3543  break;
3544  }
3545  }
3546  }
3547  }
3548  omfree (c->short_Exps);
3549 
3550  ideal I = c->S;
3551  IDELEMS (I) = c->n;
3552  idSkipZeroes (I);
3553  for(i = 0; i <= c->strat->sl; i++)
3554  c->strat->S[i] = NULL;
3555  id_Delete (&c->strat->Shdl, c->r);
3556  pDelete (&c->tmp_lm);
3558  delete c->strat;
3559 }
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:1428
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
#define TEST_OPT_PROT
Definition: options.h:98
wlen_set lenSw
Definition: kutil.h:318
#define FALSE
Definition: auxiliary.h:140
int * S_2_R
Definition: kutil.h:342
static unsigned add[]
Definition: misc_ip.cc:79
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
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
void free_sorted_pair_node(sorted_pair_node *s, ring r)
Definition: tgb.cc:3958
#define omUnGetSpecBin(bin_ptr)
Definition: omBin.h:14
int * T_deg_full
Definition: tgb_internal.h:234
#define TRUE
Definition: auxiliary.h:144
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:12
long * short_Exps
Definition: tgb_internal.h:231
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
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:1707
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:304
#define IDELEMS(i)
Definition: simpleideals.h:19
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1673
void idSkipZeroes(ideal ide)
intset lenS
Definition: kutil.h:317
intset ecartS
Definition: kutil.h:307
#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:157
poly * tmp_pair_lm
Definition: tgb_internal.h:236
unsigned long * sevS
Definition: kutil.h:320
poly * gcd_of_terms
Definition: tgb_internal.h:239
int sl
Definition: kutil.h:351
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
ideal Shdl
Definition: kutil.h:301
int BOOLEAN
Definition: auxiliary.h:131
poly_list_node * to_destroy
Definition: tgb_internal.h:248
monom_poly * mp
Definition: tgb_internal.h:198

Member Function Documentation

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

Definition at line 3797 of file tgb.cc.

3798 {
3799  assume (is_homog);
3800  int deg;
3801  if(TEST_OPT_PROT)
3802  {
3803  PrintS ("C");
3804  }
3805  for(deg = lower; deg <= upper; deg++)
3806  {
3807  int i;
3808  for(i = 0; i < n; i++)
3809  {
3810  if(T_deg[i] == deg)
3811  {
3812  poly h;
3813  h = S->m[i];
3814  h = redNFTail (h, strat->sl, strat, lengths[i]);
3815  if(!rField_is_Zp (r))
3816  {
3817  p_Cleardenom (h, r);
3818  //p_Content(h,r);
3819  }
3820  else
3821  pNorm (h);
3822  //TODO:GCD of TERMS
3823  poly got =::gcd_of_terms (h, r);
3824  p_Delete (&gcd_of_terms[i], r);
3825  gcd_of_terms[i] = got;
3826  int len = pLength (h);
3827  wlen_type wlen = pQuality (h, this, len);
3828  if(weighted_lengths)
3829  weighted_lengths[i] = wlen;
3830  lengths[i] = len;
3831  assume (h == S->m[i]);
3832  int j;
3833  for(j = 0; j <= strat->sl; j++)
3834  {
3835  if(h == strat->S[j])
3836  {
3837  int new_pos = simple_posInS (strat, h, len, wlen);
3838  if(strat->lenS)
3839  {
3840  strat->lenS[j] = len;
3841  }
3842  if(strat->lenSw)
3843  {
3844  strat->lenSw[j] = wlen;
3845  }
3846  if(new_pos < j)
3847  {
3848  move_forward_in_S (j, new_pos, strat);
3849  }
3850  else
3851  {
3852  if(new_pos > j)
3853  new_pos = new_pos - 1; //is identical with one element
3854  if(new_pos > j)
3855  move_backward_in_S (j, new_pos, strat);
3856  }
3857  break;
3858  }
3859  }
3860  }
3861  }
3862  }
3863  {
3864  int i, j;
3865  for(i = 0; i < this->n; i++)
3866  {
3867  for(j = 0; j < i; j++)
3868  {
3869  if(T_deg[i] + T_deg[j] <= upper)
3870  {
3871  now_t_rep (i, j, this);
3872  }
3873  }
3874  }
3875  }
3876  //TODO resort and update strat->S,strat->lenSw
3877  //TODO mark pairs
3878 }
static void move_backward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1066
#define TEST_OPT_PROT
Definition: options.h:98
wlen_set lenSw
Definition: kutil.h:318
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:1029
static int pLength(poly a)
Definition: p_polys.h:189
int j
Definition: myNF.cc:70
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
kStrategy strat
Definition: tgb_internal.h:232
static poly redNFTail(poly h, const int sl, kStrategy strat, int len)
Definition: tgb.cc:2975
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
polyset S
Definition: kutil.h:304
BOOLEAN is_homog
Definition: tgb_internal.h:278
intset lenS
Definition: kutil.h:317
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:446
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
int64 wlen_type
Definition: kutil.h:54
int * lengths
Definition: tgb_internal.h:229
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:334
static int simple_posInS(kStrategy strat, poly p, int len, wlen_type wlen)
Definition: tgb.cc:1310
poly * gcd_of_terms
Definition: tgb_internal.h:239
int sl
Definition: kutil.h:351
static Poly * h
Definition: janet.cc:978
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2655
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:3664
void slimgb_alg::introduceDelayedPairs ( poly pa,
int  s 
)

Definition at line 3142 of file tgb.cc.

3143 {
3144  if(s == 0)
3145  return;
3146  sorted_pair_node **si_array =
3147  (sorted_pair_node **) omalloc (s * sizeof (sorted_pair_node *));
3148 
3149  for(int i = 0; i < s; i++)
3150  {
3151  sorted_pair_node *si =
3152  (sorted_pair_node *) omalloc (sizeof (sorted_pair_node));
3153  si->i = -1;
3154  si->j = -2;
3155  poly p = pa[i];
3156  simplify_poly (p, r);
3157  si->expected_length = pQuality (p, this, pLength (p));
3158  p_Test (p, r);
3159  si->deg = this->pTotaldegree_full (p);
3160  /*if (!rField_is_Zp(r))
3161  {
3162  p_Content(p,r);
3163  p_Cleardenom(p,r);
3164  } */
3165 
3166  si->lcm_of_lm = p;
3167 
3168  // c->apairs[n-1-i]=si;
3169  si_array[i] = si;
3170  }
3171 
3172  qsort (si_array, s, sizeof (sorted_pair_node *), tgb_pair_better_gen2);
3173  apairs = spn_merge (apairs, pair_top + 1, si_array, s, this);
3174  pair_top += s;
3175  omfree (si_array);
3176 }
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
static int pLength(poly a)
Definition: p_polys.h:189
int tgb_pair_better_gen2(const void *ap, const void *bp)
Definition: tgb.cc:680
polyrec * poly
Definition: hilb.h:10
#define omfree(addr)
Definition: omAllocDecl.h:237
int i
Definition: cfEzgcd.cc:123
#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
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544
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:387
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1435
#define assume(x)
Definition: mod2.h:405
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:166

Field Documentation

ideal slimgb_alg::add_later

Definition at line 226 of file tgb_internal.h.

sorted_pair_node** slimgb_alg::apairs

Definition at line 241 of file tgb_internal.h.

int slimgb_alg::array_lengths

Definition at line 261 of file tgb_internal.h.

int slimgb_alg::average_length

Definition at line 270 of file tgb_internal.h.

BOOLEAN slimgb_alg::completed

Definition at line 277 of file tgb_internal.h.

int slimgb_alg::current_degree

Definition at line 263 of file tgb_internal.h.

int slimgb_alg::deg_pos

Definition at line 273 of file tgb_internal.h.

int slimgb_alg::easy_product_crit

Definition at line 268 of file tgb_internal.h.

BOOLEAN slimgb_alg::eliminationProblem

Definition at line 280 of file tgb_internal.h.

poly* slimgb_alg::expandS

Definition at line 238 of file tgb_internal.h.

int slimgb_alg::extended_product_crit

Definition at line 269 of file tgb_internal.h.

mp_array_list* slimgb_alg::F

Definition at line 250 of file tgb_internal.h.

BOOLEAN slimgb_alg::F4_mode

Definition at line 281 of file tgb_internal.h.

poly_array_list* slimgb_alg::F_minus

Definition at line 251 of file tgb_internal.h.

poly* slimgb_alg::gcd_of_terms

Definition at line 239 of file tgb_internal.h.

BOOLEAN slimgb_alg::is_homog

Definition at line 278 of file tgb_internal.h.

BOOLEAN slimgb_alg::isDifficultField

Definition at line 276 of file tgb_internal.h.

int slimgb_alg::last_index

Definition at line 265 of file tgb_internal.h.

int slimgb_alg::lastCleanedDeg

Definition at line 272 of file tgb_internal.h.

int slimgb_alg::lastDpBlockStart

Definition at line 271 of file tgb_internal.h.

int* slimgb_alg::lengths

Definition at line 229 of file tgb_internal.h.

int slimgb_alg::max_pairs

Definition at line 266 of file tgb_internal.h.

int slimgb_alg::n

Definition at line 258 of file tgb_internal.h.

BOOLEAN slimgb_alg::nc

Definition at line 282 of file tgb_internal.h.

int slimgb_alg::normal_forms

Definition at line 262 of file tgb_internal.h.

int slimgb_alg::pair_top

Definition at line 267 of file tgb_internal.h.

ring slimgb_alg::r

Definition at line 228 of file tgb_internal.h.

int slimgb_alg::Rcounter

Definition at line 264 of file tgb_internal.h.

unsigned int slimgb_alg::reduction_steps

Definition at line 257 of file tgb_internal.h.

ideal slimgb_alg::S

Definition at line 227 of file tgb_internal.h.

long* slimgb_alg::short_Exps

Definition at line 231 of file tgb_internal.h.

int_pair_node* slimgb_alg::soon_free

Definition at line 240 of file tgb_internal.h.

char** slimgb_alg::states

Definition at line 221 of file tgb_internal.h.

kStrategy slimgb_alg::strat

Definition at line 232 of file tgb_internal.h.

int slimgb_alg::syz_comp

array_lengths should be greater equal n;

Definition at line 260 of file tgb_internal.h.

int* slimgb_alg::T_deg

Definition at line 233 of file tgb_internal.h.

int* slimgb_alg::T_deg_full

Definition at line 234 of file tgb_internal.h.

BOOLEAN slimgb_alg::tailReductions

Definition at line 279 of file tgb_internal.h.

poly slimgb_alg::tmp_lm

Definition at line 235 of file tgb_internal.h.

poly* slimgb_alg::tmp_pair_lm

Definition at line 236 of file tgb_internal.h.

sorted_pair_node** slimgb_alg::tmp_spn

Definition at line 237 of file tgb_internal.h.

poly_list_node* slimgb_alg::to_destroy

Definition at line 248 of file tgb_internal.h.

BOOLEAN slimgb_alg::use_noro

Definition at line 274 of file tgb_internal.h.

BOOLEAN slimgb_alg::use_noro_last_block

Definition at line 275 of file tgb_internal.h.

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: