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 3203 of file tgb.cc.

3204{
3205 this->deg_pos = deg_pos;
3206 lastCleanedDeg = -1;
3207 completed = FALSE;
3208 this->syz_comp = syz_comp;
3209 r = currRing;
3210 nc = rIsPluralRing (r);
3212 //Print("last dp Block start: %i\n", this->lastDpBlockStart);
3213 is_homog = TRUE;
3214 {
3215 int hzz;
3216 for(hzz = 0; hzz < IDELEMS (I); hzz++)
3217 {
3218 assume (I->m[hzz] != NULL);
3219 int d = this->pTotaldegree (I->m[hzz]);
3220 poly t = I->m[hzz]->next;
3221 while(t)
3222 {
3223 if(d != (int)this->pTotaldegree (t))
3224 {
3225 is_homog = FALSE;
3226 break;
3227 }
3228 t = t->next;
3229 }
3230 if(!(is_homog))
3231 break;
3232 }
3233 }
3234 eliminationProblem = ((!(is_homog)) && ((currRing->pLexOrder) || (I->rank > 1)));
3235 tailReductions = ((is_homog) || ((TEST_OPT_REDTAIL) && (!(I->rank > 1))));
3236 // Print("is homog:%d",c->is_homog);
3237 void *h;
3238 int i;
3239 to_destroy = NULL;
3242 if(rField_is_Zp (r))
3244 else
3246 //not fully correct
3247 //(rChar()==0);
3248 F4_mode = F4;
3249
3250 reduction_steps = 0;
3251 last_index = -1;
3252
3253 F = NULL;
3254 F_minus = NULL;
3255
3256 Rcounter = 0;
3257
3258 soon_free = NULL;
3259
3260 tmp_lm = pOne ();
3261
3262 normal_forms = 0;
3263 current_degree = 1;
3264
3265 max_pairs = 5 * IDELEMS (I);
3266
3267 apairs =
3269 pair_top = -1;
3270
3271 int n = IDELEMS (I);
3272 array_lengths = n;
3273
3274
3275 i = 0;
3276 this->n = 0;
3277 T_deg = (int *) omAlloc (n * sizeof (int));
3279 T_deg_full = (int *) omAlloc (n * sizeof (int));
3280 else
3281 T_deg_full = NULL;
3282 tmp_pair_lm = (poly *) omAlloc (n * sizeof (poly));
3283 tmp_spn = (sorted_pair_node **) omAlloc (n * sizeof (sorted_pair_node *));
3284 lm_bin = omGetSpecBin (POLYSIZE + (r->ExpL_Size) * sizeof (long));
3285#ifdef HEAD_BIN
3286 HeadBin = omGetSpecBin (POLYSIZE + (currRing->ExpL_Size) * sizeof (long));
3287#endif
3288 /* omUnGetSpecBin(&(c->HeadBin)); */
3289#ifndef HAVE_BOOST
3290#ifdef USE_STDVECBOOL
3291#else
3292 h = omAlloc (n * sizeof (char *));
3293
3294 states = (char **) h;
3295#endif
3296#endif
3297 h = omAlloc (n * sizeof (int));
3298 lengths = (int *) h;
3300 gcd_of_terms = (poly *) omAlloc (n * sizeof (poly));
3301
3302 short_Exps = (long *) omAlloc (n * sizeof (long));
3303 if(F4_mode)
3304 S = idInit (n, I->rank);
3305 else
3306 S = idInit (1, I->rank);
3307 strat = new skStrategy;
3309 strat->honey = TRUE;
3314 strat->tailRing = r;
3316 strat->sl = -1;
3317 i = n;
3318 i = 1; //some strange bug else
3319 /* initS(c->S,NULL,c->strat); */
3320 /* intS start: */
3321 // i=((i+IDELEMS(c->S)+15)/16)*16;
3322 strat->ecartS = (intset) omAlloc (i * sizeof (int)); /*initec(i); */
3323 strat->sevS = (unsigned long *) omAlloc0 (i * sizeof (unsigned long));
3324 /*initsevS(i); */
3325 strat->S_2_R = (int *) omAlloc0 (i * sizeof (int)); /*initS_2_R(i); */
3326 strat->fromQ = NULL;
3327 strat->Shdl = idInit (1, 1);
3328 strat->S = strat->Shdl->m;
3329 strat->lenS = (int *) omAlloc0 (i * sizeof (int));
3331 strat->lenSw = (wlen_type *) omAlloc0 (i * sizeof (wlen_type));
3332 else
3333 strat->lenSw = NULL;
3334 assume (n > 0);
3335 add_to_basis_ideal_quotient (I->m[0], this, NULL);
3336
3337 assume (strat->sl == IDELEMS (strat->Shdl) - 1);
3338 if(!(F4_mode))
3339 {
3340 poly *array_arg = I->m;
3341 array_arg++;
3342 introduceDelayedPairs (array_arg, n - 1);
3343 /*
3344 for (i=1;i<n;i++)//the 1 is wanted, because first element is added to basis
3345 {
3346 // add_to_basis(I->m[i],-1,-1,c);
3347 si=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
3348 si->i=-1;
3349 si->j=-2;
3350 si->expected_length=pQuality(I->m[i],this,pLength(I->m[i]));
3351 si->deg=pTotaldegree(I->m[i]);
3352 if (!rField_is_Zp(r))
3353 {
3354 p_Cleardenom(I->m[i], r);
3355 }
3356 si->lcm_of_lm=I->m[i];
3357
3358 // c->apairs[n-1-i]=si;
3359 apairs[n-i-1]=si;
3360 ++(pair_top);
3361 } */
3362 }
3363 else
3364 {
3365 for(i = 1; i < n; i++) //the 1 is wanted, because first element is added to basis
3366 add_to_basis_ideal_quotient (I->m[i], this, NULL);
3367 }
3368 for(i = 0; i < IDELEMS (I); i++)
3369 {
3370 I->m[i] = NULL;
3371 }
3372 idDelete (&I);
3373 add_later = idInit (ADD_LATER_SIZE, S->rank);
3374#ifdef USE_NORO
3375 use_noro = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3376 && (!(eliminationProblem)) && (n_GetChar(currRing->cf) <= NV_MAX_PRIME));
3377 use_noro_last_block = false;
3378 if((!(use_noro)) && (lastDpBlockStart <= (currRing->N)))
3379 {
3380 use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
3381 && (n_GetChar(currRing->cf) <= NV_MAX_PRIME));
3382 }
3383#else
3384 use_noro = false;
3385 use_noro_last_block = false;
3386#endif
3387 //Print("NORO last block %i",use_noro_last_block);
3388 memset (add_later->m, 0, ADD_LATER_SIZE * sizeof (poly));
3389}
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
int i
Definition: cfEzgcd.cc:132
int syzComp
Definition: kutil.h:354
int * S_2_R
Definition: kutil.h:342
ring tailRing
Definition: kutil.h:343
intset lenS
Definition: kutil.h:319
intset ecartS
Definition: kutil.h:309
char honey
Definition: kutil.h:377
polyset S
Definition: kutil.h:306
ideal Shdl
Definition: kutil.h:303
wlen_set lenSw
Definition: kutil.h:320
intset fromQ
Definition: kutil.h:321
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:286
void(* initEcart)(TObject *L)
Definition: kutil.h:280
int sl
Definition: kutil.h:348
unsigned long * sevS
Definition: kutil.h:322
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:3167
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:444
#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:9884
void initBuchMoraCrit(kStrategy strat)
Definition: kutil.cc:9732
void initEcartBBA(TObject *h)
Definition: kutil.cc:1392
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
Definition: kutil.cc:9085
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:37
#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 NULL
Definition: omList.c:12
#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:501
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:1389

◆ ~slimgb_alg()

slimgb_alg::~slimgb_alg ( )
virtual

Definition at line 3391 of file tgb.cc.

3392{
3393
3394 if(!(completed))
3395 {
3396 poly *add = (poly *) omAlloc ((pair_top + 2) * sizeof (poly));
3397 int piter;
3398 int pos = 0;
3399 for(piter = 0; piter <= pair_top; piter++)
3400 {
3401 sorted_pair_node *s = apairs[piter];
3402 if(s->i < 0)
3403 {
3404 //delayed element
3405 if(s->lcm_of_lm != NULL)
3406 {
3407 add[pos] = s->lcm_of_lm;
3408 pos++;
3409 }
3410 }
3412 apairs[piter] = NULL;
3413 }
3414 pair_top = -1;
3415 add[pos] = NULL;
3416 pos = 0;
3417 while(add[pos] != NULL)
3418 {
3419 add_to_basis_ideal_quotient (add[pos], this, NULL);
3420 pos++;
3421 }
3422 for(piter = 0; piter <= pair_top; piter++)
3423 {
3424 sorted_pair_node *s = apairs[piter];
3425 assume (s->i >= 0);
3427 apairs[piter] = NULL;
3428 }
3429 pair_top = -1;
3430 }
3431 id_Delete (&add_later, r);
3432 int i, j;
3433 slimgb_alg *c = this;
3434 while(c->to_destroy)
3435 {
3436 pDelete (&(c->to_destroy->p));
3437 poly_list_node *old = c->to_destroy;
3438 c->to_destroy = c->to_destroy->next;
3439 omFree (old);
3440 }
3441 while(c->F)
3442 {
3443 for(i = 0; i < c->F->size; i++)
3444 {
3445 pDelete (&(c->F->mp[i].m));
3446 }
3447 omFree (c->F->mp);
3448 c->F->mp = NULL;
3449 mp_array_list *old = c->F;
3450 c->F = c->F->next;
3451 omFree (old);
3452 }
3453 while(c->F_minus)
3454 {
3455 for(i = 0; i < c->F_minus->size; i++)
3456 {
3457 pDelete (&(c->F_minus->p[i]));
3458 }
3459 omFree (c->F_minus->p);
3460 c->F_minus->p = NULL;
3461 poly_array_list *old = c->F_minus;
3462 c->F_minus = c->F_minus->next;
3463 omFree (old);
3464 }
3465#ifndef HAVE_BOOST
3466#ifndef USE_STDVECBOOL
3467 for(int z = 1 /* zero length at 0 */ ; z < c->n; z++)
3468 {
3469 omFree (c->states[z]);
3470 }
3471 omFree (c->states);
3472#endif
3473#endif
3474
3475 omFree (c->lengths);
3477 for(int z = 0; z < c->n; z++)
3478 {
3479 pDelete (&c->tmp_pair_lm[z]);
3480 omFree (c->tmp_spn[z]);
3481 }
3482 omFree (c->tmp_pair_lm);
3483 omFree (c->tmp_spn);
3484
3485 omFree (c->T_deg);
3486 omfree (c->T_deg_full); /*c->T_deg_full my be NULL*/
3487
3488 omFree (c->strat->ecartS);
3489 omFree (c->strat->sevS);
3490// initsevS(i);
3491 omFree (c->strat->S_2_R);
3492
3493
3494 omFree (c->strat->lenS);
3495
3496 if(c->strat->lenSw)
3497 omFree (c->strat->lenSw);
3498
3499 for(i = 0; i < c->n; i++)
3500 {
3501 if(c->gcd_of_terms[i])
3502 pDelete (&(c->gcd_of_terms[i]));
3503 }
3504 omFree (c->gcd_of_terms);
3505
3506 omFree (c->apairs);
3507 if(TEST_OPT_PROT)
3508 {
3509 //Print("calculated %d NFs\n",c->normal_forms);
3510 Print ("\nNF:%i product criterion:%i, ext_product criterion:%i \n",
3512 }
3513
3514 for(i = 0; i <= c->strat->sl; i++)
3515 {
3516 if(!c->strat->S[i])
3517 continue;
3519 for(j = 0; j < c->n; j++)
3520 {
3521 if(c->S->m[j] == c->strat->S[i])
3522 {
3523 found = TRUE;
3524 break;
3525 }
3526 }
3527 if(!found)
3528 pDelete (&c->strat->S[i]);
3529 }
3530// for(i=0;i<c->n;i++)
3531// {
3532// if (c->rep[i]!=i)
3533// {
3534// // for(j=0;j<=c->strat->sl;j++)
3535// {
3536// // if(c->strat->S[j]==c->S->m[i])
3537// {
3538// // c->strat->S[j]=NULL;
3539// // break;
3540// // }
3541// // }
3542// // PrintS("R_delete");
3543// pDelete(&c->S->m[i]);
3544// }
3545// }
3546
3547 if(completed)
3548 {
3549 for(i = 0; i < c->n; i++)
3550 {
3551 assume (c->S->m[i] != NULL);
3552 if(p_GetComp (c->S->m[i], currRing) > this->syz_comp)
3553 continue;
3554 for(j = 0; j < c->n; j++)
3555 {
3556 if((c->S->m[j] == NULL) || (i == j))
3557 continue;
3558 assume (p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3559 c->S->m[i], ~c->short_Exps[i],
3560 c->r) == p_LmDivisibleBy (c->S->m[j],
3561 c->S->m[i],
3562 c->r));
3563 if(p_LmShortDivisibleBy (c->S->m[j], c->short_Exps[j],
3564 c->S->m[i], ~c->short_Exps[i], c->r))
3565 {
3566 pDelete (&c->S->m[i]);
3567 break;
3568 }
3569 }
3570 }
3571 }
3572 omFree (c->short_Exps);
3573
3574 ideal I = c->S;
3575 IDELEMS (I) = c->n;
3576 idSkipZeroes (I);
3577 for(i = 0; i <= c->strat->sl; i++)
3578 c->strat->S[i] = NULL;
3579 id_Delete (&c->strat->Shdl, c->r);
3580 pDelete (&c->tmp_lm);
3582 delete c->strat;
3583}
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:107
#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:1909
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1875
#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:3968
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 3808 of file tgb.cc.

3809{
3810 assume (is_homog);
3811 int deg;
3812 if(TEST_OPT_PROT)
3813 {
3814 PrintS ("C");
3815 }
3816 for(deg = lower; deg <= upper; deg++)
3817 {
3818 int i;
3819 for(i = 0; i < n; i++)
3820 {
3821 if(T_deg[i] == deg)
3822 {
3823 poly h;
3824 h = S->m[i];
3825 h = redNFTail (h, strat->sl, strat, lengths[i]);
3827 {
3828 p_Cleardenom (h, r); //includes p_Content(h,r);
3829 }
3830 else
3831 pNorm (h);
3832 //TODO:GCD of TERMS
3833 poly got =::gcd_of_terms (h, r);
3834 p_Delete (&gcd_of_terms[i], r);
3835 gcd_of_terms[i] = got;
3836 int len = pLength (h);
3837 wlen_type wlen = pQuality (h, this, len);
3839 weighted_lengths[i] = wlen;
3840 lengths[i] = len;
3841 assume (h == S->m[i]);
3842 int j;
3843 for(j = 0; j <= strat->sl; j++)
3844 {
3845 if(h == strat->S[j])
3846 {
3847 int new_pos = simple_posInS (strat, h, len, wlen);
3848 if(strat->lenS)
3849 {
3850 strat->lenS[j] = len;
3851 }
3852 if(strat->lenSw)
3853 {
3854 strat->lenSw[j] = wlen;
3855 }
3856 if(new_pos < j)
3857 {
3858 move_forward_in_S (j, new_pos, strat);
3859 }
3860 else
3861 {
3862 if(new_pos > j)
3863 new_pos = new_pos - 1; //is identical with one element
3864 if(new_pos > j)
3865 move_backward_in_S (j, new_pos, strat);
3866 }
3867 break;
3868 }
3869 }
3870 }
3871 }
3872 }
3873 {
3874 int i, j;
3875 for(i = 0; i < this->n; i++)
3876 {
3877 for(j = 0; j < i; j++)
3878 {
3879 if(T_deg[i] + T_deg[j] <= upper)
3880 {
3881 now_t_rep (i, j, this);
3882 }
3883 }
3884 }
3885 }
3886 //TODO resort and update strat->S,strat->lenSw
3887 //TODO mark pairs
3888}
#define TEST_OPT_INTSTRATEGY
Definition: options.h:110
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2906
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:873
static unsigned pLength(poly a)
Definition: p_polys.h:191
void pNorm(poly p)
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:3002
static void move_forward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:990
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
Definition: tgb.cc:3688
static int simple_posInS(kStrategy strat, poly p, int len, wlen_type wlen)
Definition: tgb.cc:1271
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:521
static void move_backward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1027

◆ introduceDelayedPairs()

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

Definition at line 3167 of file tgb.cc.

3168{
3169 if(s == 0)
3170 return;
3171 sorted_pair_node **si_array =
3172 (sorted_pair_node **) omAlloc (s * sizeof (sorted_pair_node *));
3173
3174 for(int i = 0; i < s; i++)
3175 {
3176 sorted_pair_node *si =
3178 si->i = -1;
3179 si->j = -2;
3180 poly p = pa[i];
3181 simplify_poly (p, r);
3182 si->expected_length = pQuality (p, this, pLength (p));
3183 p_Test (p, r);
3184 si->deg = this->pTotaldegree_full (p);
3185 /*if (!rField_is_Zp(r))
3186 {
3187 p_Content(p,r);
3188 p_Cleardenom(p,r);
3189 } */
3190
3191 si->lcm_of_lm = p;
3192
3193 // c->apairs[n-1-i]=si;
3194 si_array[i] = si;
3195 }
3196
3197 qsort (si_array, s, sizeof (sorted_pair_node *), tgb_pair_better_gen2);
3198 apairs = spn_merge (apairs, pair_top + 1, si_array, s, this);
3199 pair_top += s;
3200 omFree (si_array);
3201}
int p
Definition: cfModGcd.cc:4077
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:645
sorted_pair_node ** spn_merge(sorted_pair_node **p, int pn, sorted_pair_node **q, int qn, slimgb_alg *c)
Definition: tgb.cc:716
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:1479
#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!=NULL)
287 {
288 int d=this->pTotaldegree(p);
289 if (d>rr) rr=d;
290 pIter(p);
291 }
292 return rr;
293 }
#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: