My Project
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
 
poly * tmp_pair_lm
 
sorted_pair_node ** tmp_spn
 
poly * expandS
 
poly * gcd_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 199 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 3220 of file tgb.cc.

3221{
3222 this->deg_pos = deg_pos;
3223 lastCleanedDeg = -1;
3224 completed = FALSE;
3225 this->syz_comp = syz_comp;
3226 r = currRing;
3227 nc = rIsPluralRing (r);
3229 //Print("last dp Block start: %i\n", this->lastDpBlockStart);
3230 is_homog = TRUE;
3231 {
3232 int hzz;
3233 for(hzz = 0; hzz < IDELEMS (I); hzz++)
3234 {
3235 assume (I->m[hzz] != NULL);
3236 int d = this->pTotaldegree (I->m[hzz]);
3237 poly t = I->m[hzz]->next;
3238 while(t)
3239 {
3240 if(d != this->pTotaldegree (t))
3241 {
3242 is_homog = FALSE;
3243 break;
3244 }
3245 t = t->next;
3246 }
3247 if(!(is_homog))
3248 break;
3249 }
3250 }
3251 eliminationProblem = ((!(is_homog)) && ((currRing->pLexOrder) || (I->rank > 1)));
3252 tailReductions = ((is_homog) || ((TEST_OPT_REDTAIL) && (!(I->rank > 1))));
3253 // Print("is homog:%d",c->is_homog);
3254 void *h;
3255 int i;
3256 to_destroy = NULL;
3259 if(rField_is_Zp (r))
3261 else
3263 //not fully correct
3264 //(rChar()==0);
3265 F4_mode = F4;
3266
3267 reduction_steps = 0;
3268 last_index = -1;
3269
3270 F = NULL;
3271 F_minus = NULL;
3272
3273 Rcounter = 0;
3274
3275 soon_free = NULL;
3276
3277 tmp_lm = pOne ();
3278
3279 normal_forms = 0;
3280 current_degree = 1;
3281
3282 max_pairs = 5 * IDELEMS (I);
3283
3284 apairs =
3286 pair_top = -1;
3287
3288 int n = IDELEMS (I);
3289 array_lengths = n;
3290
3291
3292 i = 0;
3293 this->n = 0;
3294 T_deg = (int *) omAlloc (n * sizeof (int));
3296 T_deg_full = (int *) omAlloc (n * sizeof (int));
3297 else
3298 T_deg_full = NULL;
3299 tmp_pair_lm = (poly *) omAlloc (n * sizeof (poly));
3300 tmp_spn = (sorted_pair_node **) omAlloc (n * sizeof (sorted_pair_node *));
3301 lm_bin = omGetSpecBin (POLYSIZE + (r->ExpL_Size) * sizeof (long));
3302#ifdef HEAD_BIN
3303 HeadBin = omGetSpecBin (POLYSIZE + (currRing->ExpL_Size) * sizeof (long));
3304#endif
3305 /* omUnGetSpecBin(&(c->HeadBin)); */
3306#ifndef HAVE_BOOST
3307#ifdef USE_STDVECBOOL
3308#else
3309 h = omAlloc (n * sizeof (char *));
3310
3311 states = (char **) h;
3312#endif
3313#endif
3314 h = omAlloc (n * sizeof (int));
3315 lengths = (int *) h;
3317 gcd_of_terms = (poly *) omAlloc (n * sizeof (poly));
3318
3319 short_Exps = (long *) omAlloc (n * sizeof (long));
3320 if(F4_mode)
3321 S = idInit (n, I->rank);
3322 else
3323 S = idInit (1, I->rank);
3324 strat = new skStrategy;
3326 strat->honey = TRUE;
3331 strat->tailRing = r;
3333 strat->sl = -1;
3334 i = n;
3335 i = 1; //some strange bug else
3336 /* initS(c->S,NULL,c->strat); */
3337 /* intS start: */
3338 // i=((i+IDELEMS(c->S)+15)/16)*16;
3339 strat->ecartS = (intset) omAlloc (i * sizeof (int)); /*initec(i); */
3340 strat->sevS = (unsigned long *) omAlloc0 (i * sizeof (unsigned long));
3341 /*initsevS(i); */
3342 strat->S_2_R = (int *) omAlloc0 (i * sizeof (int)); /*initS_2_R(i); */
3343 strat->fromQ = NULL;
3344 strat->Shdl = idInit (1, 1);
3345 strat->S = strat->Shdl->m;
3346 strat->lenS = (int *) omAlloc0 (i * sizeof (int));
3348 strat->lenSw = (wlen_type *) omAlloc0 (i * sizeof (wlen_type));
3349 else
3350 strat->lenSw = NULL;
3351 assume (n > 0);
3352 add_to_basis_ideal_quotient (I->m[0], this, NULL);
3353
3354 assume (strat->sl == IDELEMS (strat->Shdl) - 1);
3355 if(!(F4_mode))
3356 {
3357 poly *array_arg = I->m;
3358 array_arg++;
3359 introduceDelayedPairs (array_arg, n - 1);
3360 /*
3361 for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis
3362 {
3363 // add_to_basis(I->m[i],-1,-1,c);
3364 si=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
3365 si->i=-1;
3366 si->j=-2;
3367 si->expected_length=pQuality(I->m[i],this,pLength(I->m[i]));
3368 si->deg=pTotaldegree(I->m[i]);
3369 if (!rField_is_Zp(r))
3370 {
3371 p_Cleardenom(I->m[i], r);
3372 }
3373 si->lcm_of_lm=I->m[i];
3374
3375 // c->apairs[n-1-i]=si;
3376 apairs[n-i-1]=si;
3377 ++(pair_top);
3378 } */
3379 }
3380 else
3381 {
3382 for(i = 1; i < n; i++) //the 1 is wanted, because first element is added to basis
3383 add_to_basis_ideal_quotient (I->m[i], this, NULL);
3384 }
3385 for(i = 0; i < IDELEMS (I); i++)
3386 {
3387 I->m[i] = NULL;
3388 }
3389 idDelete (&I);
3390 add_later = idInit (ADD_LATER_SIZE, S->rank);
3391#ifdef USE_NORO
3392 use_noro = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3393 && (!(eliminationProblem)) && (n_GetChar(currRing->cf) <= NV_MAX_PRIME));
3394 use_noro_last_block = false;
3395 if((!(use_noro)) && (lastDpBlockStart <= (currRing->N)))
3396 {
3397 use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3398 && (n_GetChar(currRing->cf) <= NV_MAX_PRIME));
3399 }
3400#else
3401 use_noro = false;
3402 use_noro_last_block = false;
3403#endif
3404 //Print("NORO last block %i",use_noro_last_block);
3405 memset (add_later->m, 0, ADD_LATER_SIZE * sizeof (poly));
3406}
#define NULL
Definition: auxiliary.h:104
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int i
Definition: cfEzgcd.cc:132
int syzComp
Definition: kutil.h:357
int * S_2_R
Definition: kutil.h:345
ring tailRing
Definition: kutil.h:346
intset lenS
Definition: kutil.h:320
intset ecartS
Definition: kutil.h:310
char honey
Definition: kutil.h:381
polyset S
Definition: kutil.h:307
ideal Shdl
Definition: kutil.h:304
wlen_set lenSw
Definition: kutil.h:321
intset fromQ
Definition: kutil.h:322
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:287
void(* initEcart)(TObject *L)
Definition: kutil.h:281
int sl
Definition: kutil.h:351
unsigned long * sevS
Definition: kutil.h:323
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:275
mp_array_list * F
Definition: tgb_internal.h:239
BOOLEAN completed
Definition: tgb_internal.h:266
int lastCleanedDeg
Definition: tgb_internal.h:261
int_pair_node * soon_free
Definition: tgb_internal.h:229
sorted_pair_node ** apairs
Definition: tgb_internal.h:230
BOOLEAN nc
Definition: tgb_internal.h:271
kStrategy strat
Definition: tgb_internal.h:221
int * T_deg_full
Definition: tgb_internal.h:223
BOOLEAN use_noro_last_block
Definition: tgb_internal.h:264
int array_lengths
Definition: tgb_internal.h:250
int easy_product_crit
Definition: tgb_internal.h:257
int lastDpBlockStart
Definition: tgb_internal.h:260
int * lengths
Definition: tgb_internal.h:218
ideal add_later
Definition: tgb_internal.h:215
int extended_product_crit
Definition: tgb_internal.h:258
sorted_pair_node ** tmp_spn
Definition: tgb_internal.h:226
void introduceDelayedPairs(poly *pa, int s)
Definition: tgb.cc:3184
char ** states
Definition: tgb_internal.h:210
BOOLEAN isDifficultField
Definition: tgb_internal.h:265
unsigned int reduction_steps
Definition: tgb_internal.h:246
poly_array_list * F_minus
Definition: tgb_internal.h:240
int current_degree
Definition: tgb_internal.h:252
poly * gcd_of_terms
Definition: tgb_internal.h:228
poly * tmp_pair_lm
Definition: tgb_internal.h:225
long * short_Exps
Definition: tgb_internal.h:220
BOOLEAN tailReductions
Definition: tgb_internal.h:268
BOOLEAN is_homog
Definition: tgb_internal.h:267
int syz_comp
array_lengths should be greater equal n;
Definition: tgb_internal.h:249
BOOLEAN use_noro
Definition: tgb_internal.h:263
BOOLEAN eliminationProblem
Definition: tgb_internal.h:269
wlen_type * weighted_lengths
Definition: tgb_internal.h:219
BOOLEAN F4_mode
Definition: tgb_internal.h:270
poly_list_node * to_destroy
Definition: tgb_internal.h:237
int normal_forms
Definition: tgb_internal.h:251
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:445
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
STATIC_VAR Poly * h
Definition: janet.cc:971
void initBuchMoraPos(kStrategy strat)
Definition: kutil.cc:9822
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9670
void initEcartBBA(TObject *h)
Definition: kutil.cc:1333
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
Definition: kutil.cc:9023
int64 wlen_type
Definition: kutil.h:54
int * intset
Definition: kutil.h:53
#define assume(x)
Definition: mod2.h:387
#define NV_MAX_PRIME
Definition: modulop.h:29
#define POLYSIZE
Definition: monomials.h:233
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define omAllocAligned
Definition: omAllocDecl.h:273
#define omGetSpecBin(size)
Definition: omBin.h:11
#define TEST_OPT_REDTAIL
Definition: options.h:116
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
#define pOne()
Definition: polys.h:315
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:502
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:400
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
#define IDELEMS(i)
Definition: simpleideals.h:23
#define ADD_LATER_SIZE
Definition: tgb.cc:39
STATIC_VAR omBin lm_bin
Definition: tgb.cc:41
static int get_last_dp_block_start(ring r)
Definition: tgb.cc:427
sorted_pair_node ** add_to_basis_ideal_quotient(poly h, slimgb_alg *c, int *ip)
Definition: tgb.cc:1426

◆ ~slimgb_alg()

slimgb_alg::~slimgb_alg ( )
virtual

Definition at line 3408 of file tgb.cc.

3409{
3410
3411 if(!(completed))
3412 {
3413 poly *add = (poly *) omAlloc ((pair_top + 2) * sizeof (poly));
3414 int piter;
3415 int pos = 0;
3416 for(piter = 0; piter <= pair_top; piter++)
3417 {
3418 sorted_pair_node *s = apairs[piter];
3419 if(s->i < 0)
3420 {
3421 //delayed element
3422 if(s->lcm_of_lm != NULL)
3423 {
3424 add[pos] = s->lcm_of_lm;
3425 pos++;
3426 }
3427 }
3429 apairs[piter] = NULL;
3430 }
3431 pair_top = -1;
3432 add[pos] = NULL;
3433 pos = 0;
3434 while(add[pos] != NULL)
3435 {
3436 add_to_basis_ideal_quotient (add[pos], this, NULL);
3437 pos++;
3438 }
3439 for(piter = 0; piter <= pair_top; piter++)
3440 {
3441 sorted_pair_node *s = apairs[piter];
3442 assume (s->i >= 0);
3444 apairs[piter] = NULL;
3445 }
3446 pair_top = -1;
3447 }
3448 id_Delete (&add_later, r);
3449 int i, j;
3450 slimgb_alg *c = this;
3451 while(c->to_destroy)
3452 {
3453 pDelete (&(c->to_destroy->p));
3454 poly_list_node *old = c->to_destroy;
3455 c->to_destroy = c->to_destroy->next;
3456 omFree (old);
3457 }
3458 while(c->F)
3459 {
3460 for(i = 0; i < c->F->size; i++)
3461 {
3462 pDelete (&(c->F->mp[i].m));
3463 }
3464 omFree (c->F->mp);
3465 c->F->mp = NULL;
3466 mp_array_list *old = c->F;
3467 c->F = c->F->next;
3468 omFree (old);
3469 }
3470 while(c->F_minus)
3471 {
3472 for(i = 0; i < c->F_minus->size; i++)
3473 {
3474 pDelete (&(c->F_minus->p[i]));
3475 }
3476 omFree (c->F_minus->p);
3477 c->F_minus->p = NULL;
3478 poly_array_list *old = c->F_minus;
3479 c->F_minus = c->F_minus->next;
3480 omFree (old);
3481 }
3482#ifndef HAVE_BOOST
3483#ifndef USE_STDVECBOOL
3484 for(int z = 1 /* zero length at 0 */ ; z < c->n; z++)
3485 {
3486 omFree (c->states[z]);
3487 }
3488 omFree (c->states);
3489#endif
3490#endif
3491
3492 omFree (c->lengths);
3494 for(int z = 0; z < c->n; z++)
3495 {
3496 pDelete (&c->tmp_pair_lm[z]);
3497 omFree (c->tmp_spn[z]);
3498 }
3499 omFree (c->tmp_pair_lm);
3500 omFree (c->tmp_spn);
3501
3502 omFree (c->T_deg);
3503 omfree (c->T_deg_full); /*c->T_deg_full my be NULL*/
3504
3505 omFree (c->strat->ecartS);
3506 omFree (c->strat->sevS);
3507// initsevS(i);
3508 omFree (c->strat->S_2_R);
3509
3510
3511 omFree (c->strat->lenS);
3512
3513 if(c->strat->lenSw)
3514 omFree (c->strat->lenSw);
3515
3516 for(i = 0; i < c->n; i++)
3517 {
3518 if(c->gcd_of_terms[i])
3519 pDelete (&(c->gcd_of_terms[i]));
3520 }
3521 omFree (c->gcd_of_terms);
3522
3523 omFree (c->apairs);
3524 if(TEST_OPT_PROT)
3525 {
3526 //Print("calculated %d NFs\n",c->normal_forms);
3527 Print ("\nNF:%i product criterion:%i, ext_product criterion:%i \n",
3529 }
3530
3531 for(i = 0; i <= c->strat->sl; i++)
3532 {
3533 if(!c->strat->S[i])
3534 continue;
3536 for(j = 0; j < c->n; j++)
3537 {
3538 if(c->S->m[j] == c->strat->S[i])
3539 {
3540 found = TRUE;
3541 break;
3542 }
3543 }
3544 if(!found)
3545 pDelete (&c->strat->S[i]);
3546 }
3547// for(i=0;i<c->n;i++)
3548// {
3549// if (c->rep[i]!=i)
3550// {
3551// // for(j=0;j<=c->strat->sl;j++)
3552// {
3553// // if(c->strat->S[j]==c->S->m[i])
3554// {
3555// // c->strat->S[j]=NULL;
3556// // break;
3557// // }
3558// // }
3559// // PrintS("R_delete");
3560// pDelete(&c->S->m[i]);
3561// }
3562// }
3563
3564 if(completed)
3565 {
3566 for(i = 0; i < c->n; i++)
3567 {
3568 assume (c->S->m[i] != NULL);
3569 if(p_GetComp (c->S->m[i], currRing) > this->syz_comp)
3570 continue;
3571 for(j = 0; j < c->n; j++)
3572 {
3573 if((c->S->m[j] == NULL) || (i == j))
3574 continue;
3575 assume (p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3576 c->S->m[i], ~c->short_Exps[i],
3577 c->r) == p_LmDivisibleBy (c->S->m[j],
3578 c->S->m[i],
3579 c->r));
3580 if(p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3581 c->S->m[i], ~c->short_Exps[i], c->r))
3582 {
3583 pDelete (&c->S->m[i]);
3584 break;
3585 }
3586 }
3587 }
3588 }
3589 omFree (c->short_Exps);
3590
3591 ideal I = c->S;
3592 IDELEMS (I) = c->n;
3593 idSkipZeroes (I);
3594 for(i = 0; i <= c->strat->sl; i++)
3595 c->strat->S[i] = NULL;
3596 id_Delete (&c->strat->Shdl, c->r);
3597 pDelete (&c->tmp_lm);
3599 delete c->strat;
3600}
int BOOLEAN
Definition: auxiliary.h:87
#define Print
Definition: emacs.cc:80
const CanonicalForm int s
Definition: facAbsFact.cc:51
bool found
Definition: facFactorize.cc:55
int j
Definition: facHensel.cc:110
STATIC_VAR unsigned add[]
Definition: misc_ip.cc:115
#define p_GetComp(p, r)
Definition: monomials.h:64
#define omfree(addr)
Definition: omAllocDecl.h:237
#define omFree(addr)
Definition: omAllocDecl.h:261
#define omUnGetSpecBin(bin_ptr)
Definition: omBin.h:14
#define TEST_OPT_PROT
Definition: options.h:103
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
Definition: p_polys.h:1897
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1863
#define pDelete(p_ptr)
Definition: polys.h:186
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
void free_sorted_pair_node(sorted_pair_node *s, const ring r)
Definition: tgb.cc:3998
poly_array_list * next
Definition: tgb_internal.h:197
mp_array_list * next
Definition: tgb_internal.h:189
poly_list_node * next
Definition: tgb_internal.h:171
monom_poly * mp
Definition: tgb_internal.h:187

Member Function Documentation

◆ cleanDegs()

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

Definition at line 3838 of file tgb.cc.

3839{
3840 assume (is_homog);
3841 int deg;
3842 if(TEST_OPT_PROT)
3843 {
3844 PrintS ("C");
3845 }
3846 for(deg = lower; deg <= upper; deg++)
3847 {
3848 int i;
3849 for(i = 0; i < n; i++)
3850 {
3851 if(T_deg[i] == deg)
3852 {
3853 poly h;
3854 h = S->m[i];
3855 h = redNFTail (h, strat->sl, strat, lengths[i]);
3857 {
3858 p_Cleardenom (h, r); //includes p_Content(h,r);
3859 }
3860 else
3861 pNorm (h);
3862 //TODO:GCD of TERMS
3863 poly got =::gcd_of_terms (h, r);
3864 p_Delete (&gcd_of_terms[i], r);
3865 gcd_of_terms[i] = got;
3866 int len = pLength (h);
3867 wlen_type wlen = pQuality (h, this, len);
3869 weighted_lengths[i] = wlen;
3870 lengths[i] = len;
3871 assume (h == S->m[i]);
3872 int j;
3873 for(j = 0; j <= strat->sl; j++)
3874 {
3875 if(h == strat->S[j])
3876 {
3877 int new_pos = simple_posInS (strat, h, len, wlen);
3878 if(strat->lenS)
3879 {
3880 strat->lenS[j] = len;
3881 }
3882 if(strat->lenSw)
3883 {
3884 strat->lenSw[j] = wlen;
3885 }
3886 if(new_pos < j)
3887 {
3888 move_forward_in_S (j, new_pos, strat);
3889 }
3890 else
3891 {
3892 if(new_pos > j)
3893 new_pos = new_pos - 1; //is identical with one element
3894 if(new_pos > j)
3895 move_backward_in_S (j, new_pos, strat);
3896 }
3897 break;
3898 }
3899 }
3900 }
3901 }
3902 }
3903 {
3904 int i, j;
3905 for(i = 0; i < this->n; i++)
3906 {
3907 for(j = 0; j < i; j++)
3908 {
3909 if(T_deg[i] + T_deg[j] <= upper)
3910 {
3911 now_t_rep (i, j, this);
3912 }
3913 }
3914 }
3915 }
3916 //TODO resort and update strat->S,strat->lenSw
3917 //TODO mark pairs
3918}
#define TEST_OPT_INTSTRATEGY
Definition: options.h:110
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2900
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:861
static unsigned pLength(poly a)
Definition: p_polys.h:191
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:363
void PrintS(const char *s)
Definition: reporter.cc:284
static poly redNFTail(poly h, const int sl, kStrategy strat, int len)
Definition: tgb.cc:3019
static void move_forward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1027
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
Definition: tgb.cc:3705
static int simple_posInS(kStrategy strat, poly p, int len, wlen_type wlen)
Definition: tgb.cc:1308
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544
static void move_backward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1064

◆ introduceDelayedPairs()

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

Definition at line 3184 of file tgb.cc.

3185{
3186 if(s == 0)
3187 return;
3188 sorted_pair_node **si_array =
3189 (sorted_pair_node **) omAlloc (s * sizeof (sorted_pair_node *));
3190
3191 for(int i = 0; i < s; i++)
3192 {
3193 sorted_pair_node *si =
3195 si->i = -1;
3196 si->j = -2;
3197 poly p = pa[i];
3198 simplify_poly (p, r);
3199 si->expected_length = pQuality (p, this, pLength (p));
3200 p_Test (p, r);
3201 si->deg = this->pTotaldegree_full (p);
3202 /*if (!rField_is_Zp(r))
3203 {
3204 p_Content(p,r);
3205 p_Cleardenom(p,r);
3206 } */
3207
3208 si->lcm_of_lm = p;
3209
3210 // c->apairs[n-1-i]=si;
3211 si_array[i] = si;
3212 }
3213
3214 qsort (si_array, s, sizeof (sorted_pair_node *), tgb_pair_better_gen2);
3215 apairs = spn_merge (apairs, pair_top + 1, si_array, s, this);
3216 pair_top += s;
3217 omFree (si_array);
3218}
int p
Definition: cfModGcd.cc:4080
int pTotaldegree_full(poly p)
Definition: tgb_internal.h:283
BOOLEAN pa(leftv res, leftv args)
Definition: cohomo.cc:4344
#define p_Test(p, r)
Definition: p_polys.h:162
int tgb_pair_better_gen2(const void *ap, const void *bp)
Definition: tgb.cc:680
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 void simplify_poly(poly p, ring r)
Definition: tgb.cc:59
wlen_type expected_length
Definition: tgb_internal.h:147

◆ pTotaldegree()

unsigned long slimgb_alg::pTotaldegree ( poly  p)
inline

Definition at line 275 of file tgb_internal.h.

276 {
277 pTest(p);
278 //assume(pDeg(p,r)==::p_Totaldegree(p,r));
279 assume(((unsigned long)::p_Totaldegree(p,r))==p->exp[deg_pos]);
280 return p->exp[deg_pos];
281 //return ::pTotaldegree(p,this->r);
282 }
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1467
#define pTest(p)
Definition: polys.h:415

◆ pTotaldegree_full()

int slimgb_alg::pTotaldegree_full ( poly  p)
inline

Definition at line 283 of file tgb_internal.h.

284 {
285 int rr=0;
286 while(p)
287 {
288 int d=this->pTotaldegree(p);
289 rr=si_max(rr,d);
290 pIter(p);
291 }
292 return rr;
293 }
static int si_max(const int a, const int b)
Definition: auxiliary.h:124
#define pIter(p)
Definition: monomials.h:37

Field Documentation

◆ add_later

ideal slimgb_alg::add_later

Definition at line 215 of file tgb_internal.h.

◆ apairs

sorted_pair_node** slimgb_alg::apairs

Definition at line 230 of file tgb_internal.h.

◆ array_lengths

int slimgb_alg::array_lengths

Definition at line 250 of file tgb_internal.h.

◆ average_length

int slimgb_alg::average_length

Definition at line 259 of file tgb_internal.h.

◆ completed

BOOLEAN slimgb_alg::completed

Definition at line 266 of file tgb_internal.h.

◆ current_degree

int slimgb_alg::current_degree

Definition at line 252 of file tgb_internal.h.

◆ deg_pos

int slimgb_alg::deg_pos

Definition at line 262 of file tgb_internal.h.

◆ easy_product_crit

int slimgb_alg::easy_product_crit

Definition at line 257 of file tgb_internal.h.

◆ eliminationProblem

BOOLEAN slimgb_alg::eliminationProblem

Definition at line 269 of file tgb_internal.h.

◆ expandS

poly* slimgb_alg::expandS

Definition at line 227 of file tgb_internal.h.

◆ extended_product_crit

int slimgb_alg::extended_product_crit

Definition at line 258 of file tgb_internal.h.

◆ F

mp_array_list* slimgb_alg::F

Definition at line 239 of file tgb_internal.h.

◆ F4_mode

BOOLEAN slimgb_alg::F4_mode

Definition at line 270 of file tgb_internal.h.

◆ F_minus

poly_array_list* slimgb_alg::F_minus

Definition at line 240 of file tgb_internal.h.

◆ gcd_of_terms

poly* slimgb_alg::gcd_of_terms

Definition at line 228 of file tgb_internal.h.

◆ is_homog

BOOLEAN slimgb_alg::is_homog

Definition at line 267 of file tgb_internal.h.

◆ isDifficultField

BOOLEAN slimgb_alg::isDifficultField

Definition at line 265 of file tgb_internal.h.

◆ last_index

int slimgb_alg::last_index

Definition at line 254 of file tgb_internal.h.

◆ lastCleanedDeg

int slimgb_alg::lastCleanedDeg

Definition at line 261 of file tgb_internal.h.

◆ lastDpBlockStart

int slimgb_alg::lastDpBlockStart

Definition at line 260 of file tgb_internal.h.

◆ lengths

int* slimgb_alg::lengths

Definition at line 218 of file tgb_internal.h.

◆ max_pairs

int slimgb_alg::max_pairs

Definition at line 255 of file tgb_internal.h.

◆ n

int slimgb_alg::n

Definition at line 247 of file tgb_internal.h.

◆ nc

BOOLEAN slimgb_alg::nc

Definition at line 271 of file tgb_internal.h.

◆ normal_forms

int slimgb_alg::normal_forms

Definition at line 251 of file tgb_internal.h.

◆ pair_top

int slimgb_alg::pair_top

Definition at line 256 of file tgb_internal.h.

◆ r

ring slimgb_alg::r

Definition at line 217 of file tgb_internal.h.

◆ Rcounter

int slimgb_alg::Rcounter

Definition at line 253 of file tgb_internal.h.

◆ reduction_steps

unsigned int slimgb_alg::reduction_steps

Definition at line 246 of file tgb_internal.h.

◆ S

ideal slimgb_alg::S

Definition at line 216 of file tgb_internal.h.

◆ short_Exps

long* slimgb_alg::short_Exps

Definition at line 220 of file tgb_internal.h.

◆ soon_free

int_pair_node* slimgb_alg::soon_free

Definition at line 229 of file tgb_internal.h.

◆ states

char** slimgb_alg::states

Definition at line 210 of file tgb_internal.h.

◆ strat

kStrategy slimgb_alg::strat

Definition at line 221 of file tgb_internal.h.

◆ syz_comp

int slimgb_alg::syz_comp

array_lengths should be greater equal n;

Definition at line 249 of file tgb_internal.h.

◆ T_deg

int* slimgb_alg::T_deg

Definition at line 222 of file tgb_internal.h.

◆ T_deg_full

int* slimgb_alg::T_deg_full

Definition at line 223 of file tgb_internal.h.

◆ tailReductions

BOOLEAN slimgb_alg::tailReductions

Definition at line 268 of file tgb_internal.h.

◆ tmp_lm

poly slimgb_alg::tmp_lm

Definition at line 224 of file tgb_internal.h.

◆ tmp_pair_lm

poly* slimgb_alg::tmp_pair_lm

Definition at line 225 of file tgb_internal.h.

◆ tmp_spn

sorted_pair_node** slimgb_alg::tmp_spn

Definition at line 226 of file tgb_internal.h.

◆ to_destroy

poly_list_node* slimgb_alg::to_destroy

Definition at line 237 of file tgb_internal.h.

◆ use_noro

BOOLEAN slimgb_alg::use_noro

Definition at line 263 of file tgb_internal.h.

◆ use_noro_last_block

BOOLEAN slimgb_alg::use_noro_last_block

Definition at line 264 of file tgb_internal.h.

◆ weighted_lengths

wlen_type* slimgb_alg::weighted_lengths

Definition at line 219 of file tgb_internal.h.


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