Data Structures | Macros | Functions | Variables
tgb.cc File Reference
#include <kernel/mod2.h>
#include <kernel/GBEngine/tgb.h>
#include <kernel/GBEngine/tgb_internal.h>
#include <kernel/GBEngine/tgbgauss.h>
#include <misc/options.h>
#include <kernel/digitech.h>
#include <polys/nc/nc.h>
#include <polys/nc/sca.h>
#include <polys/prCopy.h>
#include <coeffs/longrat.h>
#include <stdlib.h>
#include <stdio.h>
#include <queue>

Go to the source code of this file.

Data Structures

class  poly_tree_node
 
class  exp_number_builder
 
struct  int_poly_pair
 obsolete More...
 

Macros

#define BUCKETS_FOR_NORO_RED   1
 : delay nur auf Sugarvergr?erung : grade aus ecartS, setze dazu strat->honey; und nutze p.ecart : no tail reductions in syz comp More...
 
#define SR_HDL(A)   ((long)(A))
 
#define ADD_LATER_SIZE   500
 
#define LEN_VAR3
 
#define degbound(p)   assume(pTotaldegree(p)<10)
 
#define ENLARGE(pointer, type)   pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type))
 
#define ENLARGE_ALIGN(pointer, type)
 

Functions

static int add_to_reductors (slimgb_alg *c, poly h, int len, int ecart, BOOLEAN simplified=FALSE)
 
static void multi_reduction (red_object *los, int &losl, slimgb_alg *c)
 
static void multi_reduce_step (find_erg &erg, red_object *r, slimgb_alg *c)
 
static BOOLEAN extended_product_criterion (poly p1, poly gcd1, poly p2, poly gcd2, slimgb_alg *c)
 
static poly gcd_of_terms (poly p, ring r)
 
static int tgb_pair_better_gen (const void *ap, const void *bp)
 
static BOOLEAN pair_better (sorted_pair_node *a, sorted_pair_node *b, slimgb_alg *c=NULL)
 
static BOOLEAN state_is (calc_state state, const int &i, const int &j, slimgb_alg *c)
 
static void super_clean_top_of_pair_list (slimgb_alg *c)
 
static int simple_posInS (kStrategy strat, poly p, int len, wlen_type wlen)
 
static int * make_connections (int from, int to, poly bound, slimgb_alg *c)
 
static BOOLEAN has_t_rep (const int &arg_i, const int &arg_j, slimgb_alg *state)
 
static void shorten_tails (slimgb_alg *c, poly monom)
 
static poly redNF2 (poly h, slimgb_alg *c, int &len, number &m, int n=0)
 
static poly redNFTail (poly h, const int sl, kStrategy strat, int len)
 
static int bucket_guess (kBucket *bucket)
 
static void simplify_poly (poly p, ring r)
 
int slim_nsize (number n, ring r)
 
static BOOLEAN monomial_root (poly m, ring r)
 
static BOOLEAN polynomial_root (poly h, ring r)
 
static poly p_Init_Special (const ring r)
 
static poly pOne_Special (const ring r=currRing)
 
static wlen_type pSLength (poly p, int l)
 
wlen_type kSBucketLength (kBucket *b, poly lm=NULL)
 TODO CoefBuckets bercksichtigen. More...
 
static BOOLEAN elength_is_normal_length (poly p, slimgb_alg *c)
 
static BOOLEAN lies_in_last_dp_block (poly p, slimgb_alg *c)
 
static int get_last_dp_block_start (ring r)
 
static wlen_type do_pELength (poly p, slimgb_alg *c, int dlm=-1)
 
wlen_type pELength (poly p, slimgb_alg *c, ring)
 
wlen_type kEBucketLength (kBucket *b, poly lm, slimgb_alg *ca)
 
static int pELength (poly p, slimgb_alg *c, int l)
 
static wlen_type pQuality (poly p, slimgb_alg *c, int l=-1)
 
static int pTotaldegree_full (poly p)
 
static int red_object_better_gen (const void *ap, const void *bp)
 
int tgb_pair_better_gen2 (const void *ap, const void *bp)
 
int kFindDivisibleByInS_easy (kStrategy strat, const red_object &obj)
 
int kFindDivisibleByInS_easy (kStrategy strat, poly p, long sev)
 
static int posInPairs (sorted_pair_node **p, int pn, sorted_pair_node *qe, slimgb_alg *c, int an=0)
 
static BOOLEAN ascending (int *i, int top)
 
sorted_pair_node ** spn_merge (sorted_pair_node **p, int pn, sorted_pair_node **q, int qn, slimgb_alg *c)
 
static BOOLEAN trivial_syzygie (int pos1, int pos2, poly bound, slimgb_alg *c)
 
int find_best (red_object *r, int l, int u, wlen_type &w, slimgb_alg *c)
 returns position sets w as weight More...
 
BOOLEAN good_has_t_rep (int i, int j, slimgb_alg *c)
 
BOOLEAN lenS_correct (kStrategy strat)
 
static void cleanS (kStrategy strat, slimgb_alg *c)
 
static void length_one_crit (slimgb_alg *c, int pos, int len)
 
static void move_forward_in_S (int old_pos, int new_pos, kStrategy strat)
 
static void move_backward_in_S (int old_pos, int new_pos, kStrategy strat)
 
static void replace_pair (int &i, int &j, slimgb_alg *c)
 
static void add_later (poly p, const char *prot, slimgb_alg *c)
 
static void clearS (poly p, unsigned long p_sev, int l, int *at, int *k, kStrategy strat)
 
static int iq_crit (const void *ap, const void *bp)
 
static wlen_type coeff_mult_size_estimate (int s1, int s2, ring r)
 
static wlen_type pair_weighted_length (int i, int j, slimgb_alg *c)
 
sorted_pair_node ** add_to_basis_ideal_quotient (poly h, slimgb_alg *c, int *ip)
 
static poly redTailShort (poly h, kStrategy strat)
 
static void line_of_extended_prod (int fixpos, slimgb_alg *c)
 
static void c_S_element_changed_hook (int pos, slimgb_alg *c)
 
void t2ippa_rec (poly *ip, int *ia, poly_tree_node *k, int &offset)
 obsolete More...
 
void t2ippa (poly *ip, int *ia, exp_number_builder &e)
 obsolete More...
 
int anti_poly_order (const void *a, const void *b)
 
BOOLEAN is_valid_ro (red_object &ro)
 
int terms_sort_crit (const void *a, const void *b)
 
static void mass_add (poly *p, int pn, slimgb_alg *c)
 
static void go_on (slimgb_alg *c)
 
void init_with_mac_poly (tgb_sparse_matrix *mat, int row, mac_poly m)
 
poly free_row_to_poly (tgb_sparse_matrix *mat, int row, poly *monoms, int monom_index)
 
static int poly_crit (const void *ap1, const void *ap2)
 
ideal t_rep_gb (ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
 
ideal do_t_rep_gb (ring, ideal arg_I, int syz_comp, BOOLEAN F4_mode, int deg_pos)
 
void now_t_rep (const int &arg_i, const int &arg_j, slimgb_alg *c)
 
sorted_pair_nodetop_pair (slimgb_alg *c)
 
sorted_pair_nodequick_pop_pair (slimgb_alg *c)
 
void clean_top_of_pair_list (slimgb_alg *c)
 
void free_sorted_pair_node (sorted_pair_node *s, ring r)
 
static BOOLEAN pHasNotCFExtended (poly p1, poly p2, poly m)
 
static wlen_type quality_of_pos_in_strat_S (int pos, slimgb_alg *c)
 
static wlen_type quality_of_pos_in_strat_S_mult_high (int pos, poly high, slimgb_alg *c)
 
static void multi_reduction_lls_trick (red_object *los, int, slimgb_alg *c, find_erg &erg)
 
static int fwbw (red_object *los, int i)
 
static void canonicalize_region (red_object *los, int l, int u, slimgb_alg *)
 
static void multi_reduction_find (red_object *los, int, slimgb_alg *c, int startf, find_erg &erg)
 
static int multi_reduction_clear_zeroes (red_object *los, int losl, int l, int u)
 
int search_red_object_pos (red_object *a, int top, red_object *key)
 
static void sort_region_down (red_object *los, int l, int u, slimgb_alg *)
 

Variables

static const int bundle_size = 100
 
static const int bundle_size_noro = 10000
 
static const int delay_factor = 3
 
static omBin lm_bin = NULL
 

Data Structure Documentation

§ int_poly_pair

struct int_poly_pair

obsolete

Definition at line 2022 of file tgb.cc.

Data Fields
int n
poly p

Macro Definition Documentation

§ ADD_LATER_SIZE

#define ADD_LATER_SIZE   500

Definition at line 39 of file tgb.cc.

§ BUCKETS_FOR_NORO_RED

#define BUCKETS_FOR_NORO_RED   1

: delay nur auf Sugarvergr?erung : grade aus ecartS, setze dazu strat->honey; und nutze p.ecart : no tail reductions in syz comp

Definition at line 34 of file tgb.cc.

§ degbound

#define degbound (   p)    assume(pTotaldegree(p)<10)

Definition at line 153 of file tgb.cc.

§ ENLARGE

#define ENLARGE (   pointer,
  type 
)    pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type))

§ ENLARGE_ALIGN

#define ENLARGE_ALIGN (   pointer,
  type 
)
Value:
{if(pointer)\
pointer=(type*)omReallocAligned(pointer, c->array_lengths*sizeof(type));\
else pointer=(type*)omAllocAligned(c->array_lengths*sizeof(type));}
#define omAllocAligned
Definition: omAllocDecl.h:273
#define omReallocAligned
Definition: omAllocDecl.h:283

§ LEN_VAR3

#define LEN_VAR3

Definition at line 152 of file tgb.cc.

§ SR_HDL

#define SR_HDL (   A)    ((long)(A))

Definition at line 35 of file tgb.cc.

Function Documentation

§ add_later()

static void add_later ( poly  p,
const char *  prot,
slimgb_alg c 
)
static

Definition at line 1292 of file tgb.cc.

1293 {
1294  int i = 0;
1295  //check, if it is already in the queue
1296 
1297  while(c->add_later->m[i] != NULL)
1298  {
1299  if(p_LmEqual (c->add_later->m[i], p, c->r))
1300  return;
1301  i++;
1302  }
1303  if(TEST_OPT_PROT)
1304  PrintS (prot);
1305  c->add_later->m[i] = p;
1306 }
#define TEST_OPT_PROT
Definition: options.h:98
return P p
Definition: myNF.cc:203
ideal add_later
Definition: tgb_internal.h:226
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define p_LmEqual(p1, p2, r)
Definition: p_polys.h:1611
#define NULL
Definition: omList.c:10

§ add_to_basis_ideal_quotient()

sorted_pair_node** add_to_basis_ideal_quotient ( poly  h,
slimgb_alg c,
int *  ip 
)

Definition at line 1426 of file tgb.cc.

1428 {
1429  p_Test (h, c->r);
1430  assume (h != NULL);
1431  poly got = gcd_of_terms (h, c->r);
1432  if((got != NULL) && (TEST_V_UPTORADICAL))
1433  {
1434  poly copy = p_Copy (got, c->r);
1435  //p_wrp(got,c->r);
1436  BOOLEAN changed = monomial_root (got, c->r);
1437  if(changed)
1438  {
1439  poly div_by = pDivide (copy, got);
1440  poly iter = h;
1441  while(iter)
1442  {
1443  pExpVectorSub (iter, div_by);
1444  pIter (iter);
1445  }
1446  p_Delete (&div_by, c->r);
1447  PrintS ("U");
1448  }
1449  p_Delete (&copy, c->r);
1450  }
1451 
1452 #define ENLARGE(pointer, type) pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type))
1453 
1454 #define ENLARGE_ALIGN(pointer, type) {if(pointer)\
1455  pointer=(type*)omReallocAligned(pointer, c->array_lengths*sizeof(type));\
1456  else pointer=(type*)omAllocAligned(c->array_lengths*sizeof(type));}
1457 // BOOLEAN corr=lenS_correct(c->strat);
1458  int sugar;
1459  int ecart = 0;
1460  ++(c->n);
1461  ++(c->S->ncols);
1462  int i, j;
1463  i = c->n - 1;
1464  sorted_pair_node **nodes =
1465  (sorted_pair_node **) omalloc (sizeof (sorted_pair_node *) * i);
1466  int spc = 0;
1467  if(c->n > c->array_lengths)
1468  {
1469  c->array_lengths = c->array_lengths * 2;
1470  assume (c->array_lengths >= c->n);
1471  ENLARGE (c->T_deg, int);
1474 
1475  ENLARGE_ALIGN (c->short_Exps, long);
1476  ENLARGE (c->lengths, int);
1477 #ifndef HAVE_BOOST
1478 #ifndef USE_STDVECBOOL
1479 
1480  ENLARGE_ALIGN (c->states, char *);
1481 #endif
1482 #endif
1484  //if (c->weighted_lengths!=NULL) {
1486  //}
1487  //ENLARGE_ALIGN(c->S->m,poly);
1488  }
1489  pEnlargeSet (&c->S->m, c->n - 1, 1);
1490  if(c->T_deg_full)
1491  ENLARGE (c->T_deg_full, int);
1492  sugar = c->T_deg[i] = c->pTotaldegree (h);
1493  if(c->T_deg_full)
1494  {
1495  sugar = c->T_deg_full[i] = c->pTotaldegree_full (h);
1496  ecart = sugar - c->T_deg[i];
1497  assume (ecart >= 0);
1498  }
1499  c->tmp_pair_lm[i] = pOne_Special (c->r);
1500 
1501  c->tmp_spn[i] = (sorted_pair_node *) omAlloc (sizeof (sorted_pair_node));
1502 
1503  c->lengths[i] = pLength (h);
1504 
1505  //necessary for correct weighted length
1506 
1507  if(!rField_is_Zp (c->r))
1508  {
1509  p_Cleardenom (h, c->r); //includes p_Content(h,c->r);
1510  }
1511  else
1512  pNorm (h);
1513  pNormalize (h);
1514 
1515  c->weighted_lengths[i] = pQuality (h, c, c->lengths[i]);
1516  c->gcd_of_terms[i] = got;
1517 #ifdef HAVE_BOOST
1518  c->states.push_back (dynamic_bitset <> (i));
1519 
1520 #else
1521 #ifdef USE_STDVECBOOL
1522 
1523  c->states.push_back (vector < bool > (i));
1524 
1525 #else
1526  if(i > 0)
1527  c->states[i] = (char *) omAlloc (i * sizeof (char));
1528  else
1529  c->states[i] = NULL;
1530 #endif
1531 #endif
1532 
1533  c->S->m[i] = h;
1534  c->short_Exps[i] = p_GetShortExpVector (h, c->r);
1535 
1536 #undef ENLARGE
1537 #undef ENLARGE_ALIGN
1538  if(p_GetComp (h, currRing) <= c->syz_comp)
1539  {
1540  for(j = 0; j < i; j++)
1541  {
1542 
1543 
1544 #ifndef HAVE_BOOST
1545  c->states[i][j] = UNCALCULATED;
1546 #endif
1547  assume (p_LmDivisibleBy (c->S->m[i], c->S->m[j], c->r) ==
1548  p_LmShortDivisibleBy (c->S->m[i], c->short_Exps[i], c->S->m[j],
1549  ~(c->short_Exps[j]), c->r));
1550 
1551  if(__p_GetComp (c->S->m[i], c->r) != __p_GetComp (c->S->m[j], c->r))
1552  {
1553  //c->states[i][j]=UNCALCULATED;
1554  //WARNUNG: be careful
1555  continue;
1556  }
1557  else if((!c->nc) && (c->lengths[i] == 1) && (c->lengths[j] == 1))
1558  {
1559  c->states[i][j] = HASTREP;
1560  }
1561  else if(((!c->nc) || (c->is_homog && rIsSCA (c->r)))
1562  && (pHasNotCF (c->S->m[i], c->S->m[j])))
1563 // else if ((!(c->nc)) && (pHasNotCF(c->S->m[i],c->S->m[j])))
1564  {
1565  c->easy_product_crit++;
1566  c->states[i][j] = HASTREP;
1567  continue;
1568  }
1569  else
1571  (c->S->m[i], c->gcd_of_terms[i], c->S->m[j], c->gcd_of_terms[j],
1572  c))
1573  {
1574  c->states[i][j] = HASTREP;
1575  c->extended_product_crit++;
1576  //PrintS("E");
1577  }
1578  // if (c->states[i][j]==UNCALCULATED)
1579  // {
1580 
1581  if((TEST_V_FINDMONOM) && (!c->nc))
1582  {
1583  //PrintS("COMMU");
1584  // if (c->lengths[i]==c->lengths[j])
1585  // {
1586 // poly short_s=ksCreateShortSpoly(c->S->m[i],c->S->m[j],c->r);
1587 // if (short_s==NULL)
1588 // {
1589 // c->states[i][j]=HASTREP;
1590 // }
1591 // else
1592 // {
1593 // p_Delete(&short_s, currRing);
1594 // }
1595 // }
1596  if(c->lengths[i] + c->lengths[j] == 3)
1597  {
1598 
1599 
1600  poly short_s = ksCreateShortSpoly (c->S->m[i], c->S->m[j], c->r);
1601  if(short_s == NULL)
1602  {
1603  c->states[i][j] = HASTREP;
1604  }
1605  else
1606  {
1607  assume (pLength (short_s) == 1);
1608  if(TEST_V_UPTORADICAL)
1609  monomial_root (short_s, c->r);
1610  int iS = kFindDivisibleByInS_easy (c->strat, short_s,
1611  p_GetShortExpVector (short_s,
1612  c->r));
1613  if(iS < 0)
1614  {
1615  //PrintS("N");
1616  if(TRUE)
1617  {
1618  c->states[i][j] = HASTREP;
1619  add_later (short_s, "N", c);
1620  }
1621  else
1622  p_Delete (&short_s, currRing);
1623  }
1624  else
1625  {
1626  if(c->strat->lenS[iS] > 1)
1627  {
1628  //PrintS("O");
1629  if(TRUE)
1630  {
1631  c->states[i][j] = HASTREP;
1632  add_later (short_s, "O", c);
1633  }
1634  else
1635  p_Delete (&short_s, currRing);
1636  }
1637  else
1638  p_Delete (&short_s, currRing);
1639  c->states[i][j] = HASTREP;
1640  }
1641 
1642 
1643  }
1644  }
1645  }
1646  // if (short_s)
1647  // {
1648  assume (spc <= j);
1649  sorted_pair_node *s = c->tmp_spn[spc]; //(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
1650  s->i = si_max (i, j);
1651  s->j = si_min (i, j);
1652  assume (s->j == j);
1653  s->expected_length = pair_weighted_length (i, j, c); //c->lengths[i]+c->lengths[j]-2;
1654 
1655  poly lm = c->tmp_pair_lm[spc]; //=pOne_Special();
1656 
1657  pLcm (c->S->m[i], c->S->m[j], lm);
1658  pSetm (lm);
1659  p_Test (lm, c->r);
1660  s->deg = c->pTotaldegree (lm);
1661 
1662  if(c->T_deg_full) //Sugar
1663  {
1664  int t_i = c->T_deg_full[s->i] - c->T_deg[s->i];
1665  int t_j = c->T_deg_full[s->j] - c->T_deg[s->j];
1666  s->deg += si_max (t_i, t_j);
1667  //Print("\n max: %d\n",max(t_i,t_j));
1668  }
1669  p_Test (lm, c->r);
1670  s->lcm_of_lm = lm;
1671  // pDelete(&short_s);
1672  //assume(lm!=NULL);
1673  nodes[spc] = s;
1674  spc++;
1675 
1676  // }
1677  //else
1678  //{
1679  //c->states[i][j]=HASTREP;
1680  //}
1681  }
1682  } //if syz_comp end
1683 
1684  assume (spc <= i);
1685  //now ideal quotient crit
1686  qsort (nodes, spc, sizeof (sorted_pair_node *), iq_crit);
1687 
1688  sorted_pair_node **nodes_final =
1689  (sorted_pair_node **) omalloc (sizeof (sorted_pair_node *) * i);
1690  int spc_final = 0;
1691  j = 0;
1692  while(j < spc)
1693  {
1694  int lower = j;
1695  int upper;
1696  BOOLEAN has = FALSE;
1697  for(upper = lower + 1; upper < spc; upper++)
1698  {
1699  if(!pLmEqual (nodes[lower]->lcm_of_lm, nodes[upper]->lcm_of_lm))
1700  {
1701  break;
1702  }
1703  if(has_t_rep (nodes[upper]->i, nodes[upper]->j, c))
1704  has = TRUE;
1705  }
1706  upper = upper - 1;
1707  int z;
1708  assume (spc_final <= j);
1709  for(z = 0; z < spc_final; z++)
1710  {
1711  if(p_LmDivisibleBy
1712  (nodes_final[z]->lcm_of_lm, nodes[lower]->lcm_of_lm, c->r))
1713  {
1714  has = TRUE;
1715  break;
1716  }
1717  }
1718 
1719  if(has)
1720  {
1721  for(; lower <= upper; lower++)
1722  {
1723  //free_sorted_pair_node(nodes[lower],c->r);
1724  //omfree(nodes[lower]);
1725  nodes[lower] = NULL;
1726  }
1727  j = upper + 1;
1728  continue;
1729  }
1730  else
1731  {
1732  p_Test (nodes[lower]->lcm_of_lm, c->r);
1733  nodes[lower]->lcm_of_lm = pCopy (nodes[lower]->lcm_of_lm);
1734  assume (__p_GetComp (c->S->m[nodes[lower]->i], c->r) ==
1735  __p_GetComp (c->S->m[nodes[lower]->j], c->r));
1736  nodes_final[spc_final] =
1737  (sorted_pair_node *) omAlloc (sizeof (sorted_pair_node));
1738 
1739  *(nodes_final[spc_final++]) = *(nodes[lower]);
1740  //c->tmp_spn[nodes[lower]->j]=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
1741  nodes[lower] = NULL;
1742  for(lower = lower + 1; lower <= upper; lower++)
1743  {
1744  // free_sorted_pair_node(nodes[lower],c->r);
1745  //omfree(nodes[lower]);
1746  nodes[lower] = NULL;
1747  }
1748  j = upper + 1;
1749  continue;
1750  }
1751  }
1752 
1753  // Print("i:%d,spc_final:%d",i,spc_final);
1754 
1755  assume (spc_final <= spc);
1756  omfree (nodes);
1757  nodes = NULL;
1758 
1759  add_to_reductors (c, h, c->lengths[c->n - 1], ecart, TRUE);
1760  //i=posInS(c->strat,c->strat->sl,h,0 ecart);
1761  if(!(c->nc))
1762  {
1763  if(c->lengths[c->n - 1] == 1)
1764  shorten_tails (c, c->S->m[c->n - 1]);
1765  }
1766  //you should really update c->lengths, c->strat->lenS, and the oder of polys in strat if you sort after lengths
1767 
1768  //for(i=c->strat->sl; i>0;i--)
1769  // if(c->strat->lenS[i]<c->strat->lenS[i-1]) printf("fehler bei %d\n",i);
1770  if(c->Rcounter > 50)
1771  {
1772  c->Rcounter = 0;
1773  cleanS (c->strat, c);
1774  }
1775 
1776 #ifdef HAVE_PLURAL
1777  // for SCA:
1778  // here write at the end of nodes_final[spc_final,...,spc_final+lmdeg-1]
1779  if(rIsSCA (c->r))
1780  {
1781  const poly pNext = pNext (h);
1782 
1783  if(pNext != NULL)
1784  {
1785  // for additional polynomials
1786  const unsigned int m_iFirstAltVar = scaFirstAltVar (c->r);
1787  const unsigned int m_iLastAltVar = scaLastAltVar (c->r);
1788 
1789  int N = // c->r->N;
1790  m_iLastAltVar - m_iFirstAltVar + 1; // should be enough
1791  // TODO: but we may also use got = gcd({m}_{m\in f}))!
1792 
1793  poly *array_arg = (poly *) omalloc (N * sizeof (poly)); // !
1794  int j = 0;
1795 
1796 
1797  for(unsigned short v = m_iFirstAltVar; v <= m_iLastAltVar; v++)
1798  // for all x_v | Ann(lm(h))
1799  if(p_GetExp (h, v, c->r)) // TODO: use 'got' here!
1800  {
1801  assume (p_GetExp (h, v, c->r) == 1);
1802 
1803  poly p = sca_pp_Mult_xi_pp (v, pNext, c->r); // x_v * h;
1804 
1805  if(p != NULL) // if (x_v * h != 0)
1806  array_arg[j++] = p;
1807  } // for all x_v | Ann(lm(h))
1808 
1809  c->introduceDelayedPairs (array_arg, j);
1810 
1811  omFree (array_arg); // !!!
1812  }
1813 // PrintS("Saturation - done!!!\n");
1814  }
1815 #endif // if SCAlgebra
1816 
1817 
1818  if(!ip)
1819  {
1820  qsort (nodes_final, spc_final, sizeof (sorted_pair_node *),
1822 
1823 
1824  c->apairs =
1825  spn_merge (c->apairs, c->pair_top + 1, nodes_final, spc_final, c);
1826  c->pair_top += spc_final;
1828  omfree (nodes_final);
1829  return NULL;
1830  }
1831  {
1832  *ip = spc_final;
1833  return nodes_final;
1834  }
1835 }
static int iq_crit(const void *ap, const void *bp)
Definition: tgb.cc:1340
#define __p_GetComp(p, r)
Definition: monomials.h:71
static int add_to_reductors(slimgb_alg *c, poly h, int len, int ecart, BOOLEAN simplified=FALSE)
Definition: tgb.cc:965
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define pDivide(a, b)
Definition: polys.h:276
void introduceDelayedPairs(poly *pa, int s)
Definition: tgb.cc:3139
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
CFArray copy(const CFList &list)
write elements of list into an array
#define pSetm(p)
Definition: polys.h:253
static void add_later(poly p, const char *prot, slimgb_alg *c)
Definition: tgb.cc:1292
static BOOLEAN extended_product_criterion(poly p1, poly gcd1, poly p2, poly gcd2, slimgb_alg *c)
Definition: tgb.cc:4080
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
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
int pTotaldegree_full(poly p)
Definition: tgb_internal.h:294
CFFListIterator iter
Definition: facAbsBiFact.cc:54
int * T_deg_full
Definition: tgb_internal.h:234
#define TRUE
Definition: auxiliary.h:101
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
Definition: tgb.cc:685
static void shorten_tails(slimgb_alg *c, poly monom)
Definition: tgb.cc:3715
#define pHasNotCF(p1, p2)
Definition: polys.h:245
#define pLcm(a, b, m)
Definition: polys.h:278
#define pExpVectorSub(p1, p2)
Definition: polys.h:88
static poly pOne_Special(const ring r=currRing)
Definition: tgb.cc:142
static BOOLEAN monomial_root(poly m, ring r)
Definition: tgb.cc:89
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
Definition: kspoly.cc:824
#define omAlloc(size)
Definition: omAllocDecl.h:210
void clean_top_of_pair_list(slimgb_alg *c)
Definition: tgb.cc:3921
static int pLength(poly a)
Definition: p_polys.h:189
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
#define pIter(p)
Definition: monomials.h:44
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
static BOOLEAN has_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *state)
Definition: tgb.cc:3682
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:464
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
int tgb_pair_better_gen2(const void *ap, const void *bp)
Definition: tgb.cc:680
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
pNormalize(P.p)
#define omfree(addr)
Definition: omAllocDecl.h:237
poly sca_pp_Mult_xi_pp(short i, const poly pPoly, const ring rRing)
Definition: sca.cc:1217
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 int si_max(const int a, const int b)
Definition: auxiliary.h:123
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1768
static short scaFirstAltVar(ring r)
Definition: sca.h:18
BOOLEAN is_homog
Definition: tgb_internal.h:278
intset lenS
Definition: kutil.h:315
#define p_Test(p, r)
Definition: p_polys.h:160
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
unsigned long p_GetShortExpVector(const poly p, const ring r)
Definition: p_polys.cc:4589
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
wlen_type expected_length
Definition: tgb_internal.h:158
#define ENLARGE(pointer, type)
#define omalloc(size)
Definition: omAllocDecl.h:228
#define NULL
Definition: omList.c:10
void pEnlargeSet(poly **p, int l, int increment)
Definition: p_polys.cc:3556
static void cleanS(kStrategy strat, slimgb_alg *c)
Definition: tgb.cc:919
int64 wlen_type
Definition: kutil.h:56
static poly gcd_of_terms(poly p, ring r)
Definition: tgb.cc:4021
char ** states
Definition: tgb_internal.h:221
int * lengths
Definition: tgb_internal.h:229
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:346
poly * tmp_pair_lm
Definition: tgb_internal.h:236
static short scaLastAltVar(ring r)
Definition: sca.h:25
static bool rIsSCA(const ring r)
Definition: nc.h:206
#define pNext(p)
Definition: monomials.h:43
int array_lengths
Definition: tgb_internal.h:261
poly * gcd_of_terms
Definition: tgb_internal.h:239
static wlen_type pair_weighted_length(int i, int j, slimgb_alg *c)
Definition: tgb.cc:1373
#define TEST_V_FINDMONOM
Definition: options.h:134
sorted_pair_node ** spn_merge(sorted_pair_node **p, int pn, sorted_pair_node **q, int qn, slimgb_alg *c)
Definition: tgb.cc:751
int easy_product_crit
Definition: tgb_internal.h:268
#define TEST_V_UPTORADICAL
Definition: options.h:133
polyrec * poly
Definition: hilb.h:10
int syz_comp
array_lengths should be greater equal n;
Definition: tgb_internal.h:260
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2716
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544
#define pLmEqual(p1, p2)
Definition: polys.h:111
#define ENLARGE_ALIGN(pointer, type)
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168

§ add_to_reductors()

static int add_to_reductors ( slimgb_alg c,
poly  h,
int  len,
int  ecart,
BOOLEAN  simplified = FALSE 
)
static

Definition at line 965 of file tgb.cc.

967 {
968  //inDebug(h);
969  assume (lenS_correct (c->strat));
970  assume (len == pLength (h));
971  int i;
972 // if (c->isDifficultField)
973 // i=simple_posInS(c->strat,h,pSLength(h,len),c->isDifficultField);
974 // else
975 // i=simple_posInS(c->strat,h,len,c->isDifficultField);
976 
977  LObject P;
978  memset (&P, 0, sizeof (P));
979  P.tailRing = c->r;
980  P.p = h; /*p_Copy(h,c->r); */
981  P.ecart = ecart;
982  P.FDeg = c->r->pFDeg (P.p, c->r);
983  if(!(simplified))
984  {
985  if(!rField_is_Zp (c->r))
986  {
987  p_Cleardenom (P.p, c->r); //includes p_Content(P.p,c->r );
988  }
989  else
990  pNorm (P.p);
991  pNormalize (P.p);
992  }
993  wlen_type pq = pQuality (h, c, len);
994  i = simple_posInS (c->strat, h, len, pq);
995  c->strat->enterS (P, i, c->strat, -1);
996 
997  c->strat->lenS[i] = len;
998  assume (pLength (c->strat->S[i]) == c->strat->lenS[i]);
999  if(c->strat->lenSw != NULL)
1000  c->strat->lenSw[i] = pq;
1001 
1002  return i;
1003 }
class sLObject LObject
Definition: kutil.h:60
wlen_set lenSw
Definition: kutil.h:316
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
pNormalize(P.p)
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
Definition: kutil.h:282
BOOLEAN lenS_correct(kStrategy strat)
Definition: tgb.cc:907
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:346
static int simple_posInS(kStrategy strat, poly p, int len, wlen_type wlen)
Definition: tgb.cc:1308
kBucketDestroy & P
Definition: myNF.cc:191
static Poly * h
Definition: janet.cc:978
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2716
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544

§ anti_poly_order()

int anti_poly_order ( const void *  a,
const void *  b 
)

Definition at line 2051 of file tgb.cc.

2052 {
2053  return -pLmCmp (((int_poly_pair *) a)->p, ((int_poly_pair *) b)->p);
2054 }
const poly a
Definition: syzextra.cc:212
return P p
Definition: myNF.cc:203
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
obsolete
Definition: tgb.cc:2022
const poly b
Definition: syzextra.cc:213

§ ascending()

static BOOLEAN ascending ( int *  i,
int  top 
)
static

Definition at line 742 of file tgb.cc.

743 {
744  if(top < 1)
745  return TRUE;
746  if(i[top] < i[top - 1])
747  return FALSE;
748  return ascending (i, top - 1);
749 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int i
Definition: cfEzgcd.cc:123
static BOOLEAN ascending(int *i, int top)
Definition: tgb.cc:742

§ bucket_guess()

static int bucket_guess ( kBucket bucket)
static

Definition at line 952 of file tgb.cc.

953 {
954  int sum = 0;
955  int i;
956  for(i = bucket->buckets_used; i >= 0; i--)
957  {
958  if(bucket->buckets[i])
959  sum += bucket->buckets_length[i];
960  }
961  return sum;
962 }
int i
Definition: cfEzgcd.cc:123

§ c_S_element_changed_hook()

static void c_S_element_changed_hook ( int  pos,
slimgb_alg c 
)
static

Definition at line 1971 of file tgb.cc.

1972 {
1973  length_one_crit (c, pos, c->lengths[pos]);
1974  if(!c->nc)
1975  line_of_extended_prod (pos, c);
1976 }
BOOLEAN nc
Definition: tgb_internal.h:282
static void length_one_crit(slimgb_alg *c, int pos, int len)
Definition: tgb.cc:1005
int * lengths
Definition: tgb_internal.h:229
static void line_of_extended_prod(int fixpos, slimgb_alg *c)
Definition: tgb.cc:1939

§ canonicalize_region()

static void canonicalize_region ( red_object los,
int  l,
int  u,
slimgb_alg  
)
static

Definition at line 4483 of file tgb.cc.

4484 {
4485  assume (l <= u + 1);
4486  int i;
4487  for(i = l; i <= u; i++)
4488  {
4489  kBucketCanonicalize (los[i].bucket);
4490  }
4491 }
#define assume(x)
Definition: mod2.h:403
P bucket
Definition: myNF.cc:79
int i
Definition: cfEzgcd.cc:123
int kBucketCanonicalize(kBucket_pt bucket)
int l
Definition: cfEzgcd.cc:94

§ clean_top_of_pair_list()

void clean_top_of_pair_list ( slimgb_alg c)

Definition at line 3921 of file tgb.cc.

3922 {
3923  while((c->pair_top >= 0) && (c->apairs[c->pair_top]->i >= 0)
3924  &&
3925  (!state_is
3926  (UNCALCULATED, c->apairs[c->pair_top]->j, c->apairs[c->pair_top]->i,
3927  c)))
3928  {
3929  free_sorted_pair_node (c->apairs[c->pair_top], c->r);
3930  c->pair_top--;
3931  }
3932 }
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
void free_sorted_pair_node(sorted_pair_node *s, ring r)
Definition: tgb.cc:3954
static BOOLEAN state_is(calc_state state, const int &i, const int &j, slimgb_alg *c)
Definition: tgb.cc:3935

§ cleanS()

static void cleanS ( kStrategy  strat,
slimgb_alg c 
)
static

Definition at line 919 of file tgb.cc.

920 {
921  int i = 0;
922  LObject P;
923  while(i <= strat->sl)
924  {
925  P.p = strat->S[i];
926  P.sev = strat->sevS[i];
927  //int dummy=strat->sl;
928  //if(kFindDivisibleByInS(strat,&dummy,&P)!=i)
929  if(kFindDivisibleByInS_easy (strat, P.p, P.sev) != i)
930  {
931  deleteInS (i, strat);
932  //remember destroying poly
933  BOOLEAN found = FALSE;
934  int j;
935  for(j = 0; j < c->n; j++)
936  {
937  if(c->S->m[j] == P.p)
938  {
939  found = TRUE;
940  break;
941  }
942  }
943  if(!found)
944  pDelete (&P.p);
945  //remember additional reductors
946  }
947  else
948  i++;
949  }
950 }
class sLObject LObject
Definition: kutil.h:60
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
Definition: tgb.cc:685
void deleteInS(int i, kStrategy strat)
Definition: kutil.cc:1041
bool found
Definition: facFactorize.cc:56
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
#define pDelete(p_ptr)
Definition: polys.h:169
unsigned long * sevS
Definition: kutil.h:318
kBucketDestroy & P
Definition: myNF.cc:191
int BOOLEAN
Definition: auxiliary.h:88

§ clearS()

static void clearS ( poly  p,
unsigned long  p_sev,
int  l,
int *  at,
int *  k,
kStrategy  strat 
)
inlinestatic

Definition at line 1323 of file tgb.cc.

1324 {
1325  assume (p_sev == pGetShortExpVector (p));
1326  if(!pLmShortDivisibleBy (p, p_sev, strat->S[*at], ~strat->sevS[*at]))
1327  return;
1328  if(l >= strat->lenS[*at])
1329  return;
1330  if(TEST_OPT_PROT)
1331  PrintS ("!");
1332  mflush ();
1333  //pDelete(&strat->S[*at]);
1334  deleteInS ((*at), strat);
1335  (*at)--;
1336  (*k)--;
1337 // assume(lenS_correct(strat));
1338 }
#define TEST_OPT_PROT
Definition: options.h:98
return P p
Definition: myNF.cc:203
void deleteInS(int i, kStrategy strat)
Definition: kutil.cc:1041
#define mflush()
Definition: reporter.h:57
#define assume(x)
Definition: mod2.h:403
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
Definition: polys.h:152
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
Definition: polys.h:146
void PrintS(const char *s)
Definition: reporter.cc:284
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
unsigned long * sevS
Definition: kutil.h:318
int l
Definition: cfEzgcd.cc:94

§ coeff_mult_size_estimate()

static wlen_type coeff_mult_size_estimate ( int  s1,
int  s2,
ring  r 
)
static

Definition at line 1365 of file tgb.cc.

1366 {
1367  if(rField_is_Q (r))
1368  return s1 + s2;
1369  else
1370  return s1 * s2;
1371 }
const ring r
Definition: syzextra.cc:208
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501

§ do_pELength()

static wlen_type do_pELength ( poly  p,
slimgb_alg c,
int  dlm = -1 
)
static

Definition at line 446 of file tgb.cc.

447 {
448  if(p == NULL)
449  return 0;
450  wlen_type s = 0;
451  poly pi = p;
452  if(dlm < 0)
453  {
454  dlm = c->pTotaldegree (p);
455  s = 1;
456  pi = p->next;
457  }
458 
459  while(pi)
460  {
461  int d = c->pTotaldegree (pi);
462  if(d > dlm)
463  s += 1 + d - dlm;
464  else
465  ++s;
466  pi = pi->next;
467  }
468  return s;
469 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
return P p
Definition: myNF.cc:203
#define pi
Definition: libparse.cc:1143
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
polyrec * poly
Definition: hilb.h:10

§ do_t_rep_gb()

ideal do_t_rep_gb ( ring  ,
ideal  arg_I,
int  syz_comp,
BOOLEAN  F4_mode,
int  deg_pos 
)

Definition at line 3606 of file tgb.cc.

3607 {
3608  // Print("QlogSize(0) %d, QlogSize(1) %d,QlogSize(-2) %d, QlogSize(5) %d\n", QlogSize(nlInit(0)),QlogSize(nlInit(1)),QlogSize(nlInit(-2)),QlogSize(nlInit(5)));
3609 
3610  if(TEST_OPT_PROT)
3611  if(F4_mode)
3612  PrintS ("F4 Modus \n");
3613 
3614  //debug_Ideal=arg_debug_Ideal;
3615  //if (debug_Ideal) PrintS("DebugIdeal received\n");
3616  // Print("Idelems %i \n----------\n",IDELEMS(arg_I));
3617  ideal I = arg_I;
3618  id_Compactify (I,currRing);
3619  if(idIs0 (I))
3620  return I;
3621  int i;
3622  for(i = 0; i < IDELEMS (I); i++)
3623  {
3624  assume (I->m[i] != NULL);
3625  simplify_poly (I->m[i], currRing);
3626  }
3627 
3628  qsort (I->m, IDELEMS (I), sizeof (poly), poly_crit);
3629  //Print("Idelems %i \n----------\n",IDELEMS(I));
3630  //slimgb_alg* c=(slimgb_alg*) omalloc(sizeof(slimgb_alg));
3631  //int syz_comp=arg_I->rank;
3632  slimgb_alg *c = new slimgb_alg (I, syz_comp, F4_mode, deg_pos);
3633 
3634  while((c->pair_top >= 0)
3635  && ((!(TEST_OPT_DEGBOUND))
3636  || (c->apairs[c->pair_top]->deg <= Kstd1_deg)))
3637  {
3638 #ifdef HAVE_F4
3639  if(F4_mode)
3640  go_on_F4 (c);
3641  else
3642 #endif
3643  go_on (c);
3644  }
3645  if(c->pair_top < 0)
3646  c->completed = TRUE;
3647  I = c->S;
3648  delete c;
3649  if(TEST_OPT_REDSB)
3650  {
3651  ideal erg = kInterRed (I, NULL);
3652  assume (I != erg);
3653  id_Delete (&I, currRing);
3654  return erg;
3655  }
3656  //qsort(I->m, IDELEMS(I),sizeof(poly),pLmCmp_func);
3657  assume (I->rank >= id_RankFreeModule (I,currRing));
3658  return (I);
3659 }
#define TEST_OPT_DEGBOUND
Definition: options.h:108
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
#define TEST_OPT_PROT
Definition: options.h:98
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
#define TEST_OPT_REDSB
Definition: options.h:99
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static void go_on(slimgb_alg *c)
Definition: tgb.cc:2713
#define assume(x)
Definition: mod2.h:403
ideal kInterRed(ideal F, ideal Q)
Definition: kstd1.cc:3436
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define IDELEMS(i)
Definition: simpleideals.h:24
static int poly_crit(const void *ap1, const void *ap2)
Definition: tgb.cc:3121
#define NULL
Definition: omList.c:10
BOOLEAN completed
Definition: tgb_internal.h:277
static void simplify_poly(poly p, ring r)
Definition: tgb.cc:59
polyrec * poly
Definition: hilb.h:10
int Kstd1_deg
Definition: kutil.cc:236
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void id_Compactify(ideal id, const ring r)

§ elength_is_normal_length()

static BOOLEAN elength_is_normal_length ( poly  p,
slimgb_alg c 
)
static

Definition at line 371 of file tgb.cc.

372 {
373  ring r = c->r;
374  if(p_GetComp (p, r) != 0)
375  return FALSE;
376  if(c->lastDpBlockStart <= (currRing->N))
377  {
378  int i;
379  for(i = 1; i < c->lastDpBlockStart; i++)
380  {
381  if(p_GetExp (p, i, r) != 0)
382  {
383  break;
384  }
385  }
386  if(i >= c->lastDpBlockStart)
387  {
388  //wrp(p);
389  //PrintS("\n");
390  return TRUE;
391  }
392  else
393  return FALSE;
394  }
395  else
396  return FALSE;
397 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
#define TRUE
Definition: auxiliary.h:101
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:464
int i
Definition: cfEzgcd.cc:123
int lastDpBlockStart
Definition: tgb_internal.h:271

§ extended_product_criterion()

static BOOLEAN extended_product_criterion ( poly  p1,
poly  gcd1,
poly  p2,
poly  gcd2,
slimgb_alg c 
)
inlinestatic

Definition at line 4080 of file tgb.cc.

4082 {
4083  if(c->nc)
4084  return FALSE;
4085  if(gcd1 == NULL)
4086  return FALSE;
4087  if(gcd2 == NULL)
4088  return FALSE;
4089  gcd1->next = gcd2; //may ordered incorrect
4090  poly m = gcd_of_terms (gcd1, c->r);
4091  gcd1->next = NULL;
4092  if(m == NULL)
4093  return FALSE;
4094 
4095  BOOLEAN erg = pHasNotCFExtended (p1, p2, m);
4096  pDelete (&m);
4097  return erg;
4098 }
static BOOLEAN pHasNotCFExtended(poly p1, poly p2, poly m)
Definition: tgb.cc:4061
#define FALSE
Definition: auxiliary.h:97
BOOLEAN nc
Definition: tgb_internal.h:282
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
static poly gcd_of_terms(poly p, ring r)
Definition: tgb.cc:4021
#define pDelete(p_ptr)
Definition: polys.h:169
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88

§ find_best()

int find_best ( red_object r,
int  l,
int  u,
wlen_type w,
slimgb_alg c 
)

returns position sets w as weight

Definition at line 854 of file tgb.cc.

855 {
856  int best = l;
857  int i;
858  w = r[l].guess_quality (c);
859  for(i = l + 1; i <= u; i++)
860  {
861  wlen_type w2 = r[i].guess_quality (c);
862  if(w2 < w)
863  {
864  w = w2;
865  best = i;
866  }
867  }
868  return best;
869 }
int i
Definition: cfEzgcd.cc:123
wlen_type guess_quality(slimgb_alg *c)
Definition: tgb.cc:591
int64 wlen_type
Definition: kutil.h:56
const CanonicalForm & w
Definition: facAbsFact.cc:55
int l
Definition: cfEzgcd.cc:94

§ free_row_to_poly()

poly free_row_to_poly ( tgb_sparse_matrix mat,
int  row,
poly monoms,
int  monom_index 
)

Definition at line 3101 of file tgb.cc.

3103 {
3104  poly p = NULL;
3105  poly *set_this = &p;
3106  mac_poly r = mat->mp[row];
3107  mat->mp[row] = NULL;
3108  while(r)
3109  {
3110  (*set_this) = pLmInit (monoms[monom_index - 1 - r->exp]);
3111  pSetCoeff ((*set_this), r->coef);
3112  set_this = &((*set_this)->next);
3113  mac_poly old = r;
3114  r = r->next;
3115  delete old;
3116 
3117  }
3118  return p;
3119 }
return P p
Definition: myNF.cc:203
int exp
Definition: tgbgauss.h:47
number coef
Definition: tgbgauss.h:45
mac_poly_r * next
Definition: tgbgauss.h:46
const ring r
Definition: syzextra.cc:208
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
Definition: polys.h:64
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31
mac_poly * mp
Definition: tgbgauss.h:58

§ free_sorted_pair_node()

void free_sorted_pair_node ( sorted_pair_node s,
ring  r 
)

Definition at line 3954 of file tgb.cc.

3955 {
3956  if(s->i >= 0)
3957  p_Delete (&s->lcm_of_lm, r);
3958  omfree (s);
3959 }
const ring r
Definition: syzextra.cc:208
#define omfree(addr)
Definition: omAllocDecl.h:237
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843

§ fwbw()

static int fwbw ( red_object los,
int  i 
)
static

Definition at line 4425 of file tgb.cc.

4426 {
4427  int i2 = i;
4428  int step = 1;
4429 
4430  BOOLEAN bw = FALSE;
4431  BOOLEAN incr = TRUE;
4432 
4433  while(1)
4434  {
4435  if(!bw)
4436  {
4437  step = si_min (i2, step);
4438  if(step == 0)
4439  break;
4440  i2 -= step;
4441 
4442  if(!pLmEqual (los[i].p, los[i2].p))
4443  {
4444  bw = TRUE;
4445  incr = FALSE;
4446  }
4447  else
4448  {
4449  if((!incr) && (step == 1))
4450  break;
4451  }
4452  }
4453  else
4454  {
4455  step = si_min (i - i2, step);
4456  if(step == 0)
4457  break;
4458  i2 += step;
4459  if(pLmEqual (los[i].p, los[i2].p))
4460  {
4461  if(step == 1)
4462  break;
4463  else
4464  {
4465  bw = FALSE;
4466  }
4467  }
4468  }
4469  if(incr)
4470  step *= 2;
4471  else
4472  {
4473  if(step % 2 == 1)
4474  step = (step + 1) / 2;
4475  else
4476  step /= 2;
4477  }
4478  }
4479  return i2;
4480 }
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
int i
Definition: cfEzgcd.cc:123
int BOOLEAN
Definition: auxiliary.h:88
#define pLmEqual(p1, p2)
Definition: polys.h:111

§ gcd_of_terms()

static poly gcd_of_terms ( poly  p,
ring  r 
)
static

Definition at line 4021 of file tgb.cc.

4022 {
4023  int max_g_0 = 0;
4024  assume (p != NULL);
4025  int i;
4026  poly m = pOne ();
4027  poly t;
4028  for(i = (currRing->N); i; i--)
4029  {
4030  pSetExp (m, i, pGetExp (p, i));
4031  if(max_g_0 == 0)
4032  if(pGetExp (m, i) > 0)
4033  max_g_0 = i;
4034  }
4035 
4036  t = p->next;
4037  while(t != NULL)
4038  {
4039  if(max_g_0 == 0)
4040  break;
4041  for(i = max_g_0; i; i--)
4042  {
4043  pSetExp (m, i, si_min (pGetExp (t, i), pGetExp (m, i)));
4044  if(max_g_0 == i)
4045  if(pGetExp (m, i) == 0)
4046  max_g_0 = 0;
4047  if((max_g_0 == 0) && (pGetExp (m, i) > 0))
4048  {
4049  max_g_0 = i;
4050  }
4051  }
4052  t = t->next;
4053  }
4054  p_Setm (m, r);
4055  if(max_g_0 > 0)
4056  return m;
4057  pDelete (&m);
4058  return NULL;
4059 }
#define pSetExp(p, i, v)
Definition: polys.h:42
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:298
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:169
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
polyrec * poly
Definition: hilb.h:10

§ get_last_dp_block_start()

static int get_last_dp_block_start ( ring  r)
static

Definition at line 427 of file tgb.cc.

428 {
429  //ring r=c->r;
430  int last_block;
431 
433  {
434  last_block = rBlocks (r) - 3;
435  }
436  else
437  {
438  last_block = rBlocks (r) - 2;
439  }
440  assume (last_block >= 0);
441  if(r->order[last_block] == ringorder_dp)
442  return r->block0[last_block];
443  return (currRing->N) + 1;
444 }
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static int rBlocks(ring r)
Definition: ring.h:556
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
BOOLEAN rRing_has_CompLastBlock(ring r)
Definition: ring.cc:5103

§ go_on()

static void go_on ( slimgb_alg c)
static

Definition at line 2713 of file tgb.cc.

2714 {
2715  //set limit of 1000 for multireductions, at the moment for
2716  //programming reasons
2717 #ifdef USE_NORO
2718  //Print("module rank%d\n",c->S->rank);
2719  const BOOLEAN use_noro = c->use_noro;
2720 #else
2721  const BOOLEAN use_noro = FALSE;
2722 #endif
2723  int i = 0;
2724  c->average_length = 0;
2725  for(i = 0; i < c->n; i++)
2726  {
2727  c->average_length += c->lengths[i];
2728  }
2729  c->average_length = c->average_length / c->n;
2730  i = 0;
2731  int max_pairs = bundle_size;
2732 
2733 #ifdef USE_NORO
2734  if((use_noro) || (c->use_noro_last_block))
2735  max_pairs = bundle_size_noro;
2736 #endif
2737  poly *p = (poly *) omalloc ((max_pairs + 1) * sizeof (poly)); //nullterminated
2738 
2739  int curr_deg = -1;
2740  while(i < max_pairs)
2741  {
2742  sorted_pair_node *s = top_pair (c); //here is actually chain criterium done
2743 
2744  if(!s)
2745  break;
2746 
2747  if(curr_deg >= 0)
2748  {
2749  if(s->deg > curr_deg)
2750  break;
2751  }
2752 
2753  else
2754  curr_deg = s->deg;
2755  quick_pop_pair (c);
2756  if(s->i >= 0)
2757  {
2758  //be careful replace_pair use createShortSpoly which is not noncommutative
2759  now_t_rep (s->i, s->j, c);
2760  replace_pair (s->i, s->j, c);
2761 
2762  if(s->i == s->j)
2763  {
2764  free_sorted_pair_node (s, c->r);
2765  continue;
2766  }
2767  now_t_rep (s->i, s->j, c);
2768  }
2769  poly h;
2770  if(s->i >= 0)
2771  {
2772 #ifdef HAVE_PLURAL
2773  if(c->nc)
2774  {
2775  h = nc_CreateSpoly (c->S->m[s->i], c->S->m[s->j] /*, NULL */ , c->r);
2776 
2777  if(h != NULL)
2778  p_Cleardenom (h, c->r);
2779  }
2780  else
2781 #endif
2782  h = ksOldCreateSpoly (c->S->m[s->i], c->S->m[s->j], NULL, c->r);
2783  p_Test (h, c->r);
2784  }
2785  else
2786  {
2787  h = s->lcm_of_lm;
2788  p_Test (h, c->r);
2789  }
2790  // if(s->i>=0)
2791 // now_t_rep(s->j,s->i,c);
2792  number coef;
2793  int mlen = pLength (h);
2794  p_Test (h, c->r);
2795  if((!c->nc) & (!(use_noro)))
2796  {
2797  h = redNF2 (h, c, mlen, coef, 2);
2798  redTailShort (h, c->strat);
2799  nDelete (&coef);
2800  }
2801  p_Test (h, c->r);
2802  free_sorted_pair_node (s, c->r);
2803  if(!h)
2804  continue;
2805  p[i] = h;
2806  i++;
2807  }
2808  p[i] = NULL;
2809 // pre_comp(p,i,c);
2810  if(i == 0)
2811  {
2812  omfree (p);
2813  return;
2814  }
2815 #ifdef TGB_RESORT_PAIRS
2816  c->replaced = new bool[c->n];
2817  c->used_b = FALSE;
2818 #endif
2819 
2820  c->normal_forms += i;
2821  int j;
2822 #ifdef USE_NORO
2823  //if ((!(c->nc))&&(rField_is_Zp(c->r)))
2824  //{
2825  if(use_noro)
2826  {
2827  int pn = i;
2828  if(pn == 0)
2829  {
2830  omfree (p);
2831  return;
2832  }
2833  {
2834  if(n_GetChar(currRing->cf) < 255)
2835  {
2836  noro_step < tgb_uint8 > (p, pn, c);
2837  }
2838  else
2839  {
2840  if(n_GetChar(currRing->cf) < 65000)
2841  {
2842  noro_step < tgb_uint16 > (p, pn, c);
2843  }
2844  else
2845  {
2846  noro_step < tgb_uint32 > (p, pn, c);
2847  }
2848  }
2849  }
2850 
2851  //if (TEST_OPT_PROT)
2852  //{
2853  // Print("reported rank:%i\n",pn);
2854  //}
2855  mass_add (p, pn, c);
2856  omfree (p);
2857  return;
2858  /*if (TEST_OPT_PROT)
2859  for(j=0;j<pn;j++)
2860  {
2861  p_wrp(p[j],c->r);
2862  } */
2863  }
2864 #endif
2865  red_object *buf = (red_object *) omalloc (i * sizeof (red_object));
2866  for(j = 0; j < i; j++)
2867  {
2868  p_Test (p[j], c->r);
2869  buf[j].p = p[j];
2870  buf[j].sev = pGetShortExpVector (p[j]);
2871  buf[j].bucket = kBucketCreate (currRing);
2872  p_Test (p[j], c->r);
2873  int len = pLength (p[j]);
2874  kBucketInit (buf[j].bucket, buf[j].p, len);
2875  buf[j].initial_quality = buf[j].guess_quality (c);
2876  assume (buf[j].initial_quality >= 0);
2877  }
2878  omfree (p);
2879  qsort (buf, i, sizeof (red_object), red_object_better_gen);
2880 // Print("\ncurr_deg:%i\n",curr_deg);
2881  if(TEST_OPT_PROT)
2882  {
2883  Print ("%dM[%d,", curr_deg, i);
2884  }
2885 
2886  multi_reduction (buf, i, c);
2887 #ifdef TGB_RESORT_PAIRS
2888  if(c->used_b)
2889  {
2890  if(TEST_OPT_PROT)
2891  PrintS ("B");
2892  int e;
2893  for(e = 0; e <= c->pair_top; e++)
2894  {
2895  if(c->apairs[e]->i < 0)
2896  continue;
2897  assume (c->apairs[e]->j >= 0);
2898  if((c->replaced[c->apairs[e]->i]) || (c->replaced[c->apairs[e]->j]))
2899  {
2900  sorted_pair_node *s = c->apairs[e];
2901  s->expected_length = pair_weighted_length (s->i, s->j, c);
2902  }
2903  }
2904  qsort (c->apairs, c->pair_top + 1, sizeof (sorted_pair_node *),
2906  }
2907 #endif
2908 #ifdef TGB_DEBUG
2909  {
2910  int k;
2911  for(k = 0; k < i; k++)
2912  {
2913  assume (kFindDivisibleByInS_easy (c->strat, buf[k]) < 0);
2914  int k2;
2915  for(k2 = 0; k2 < i; k2++)
2916  {
2917  if(k == k2)
2918  continue;
2919  assume ((!(p_LmDivisibleBy (buf[k].p, buf[k2].p, c->r)))
2920  || (wrp (buf[k].p), Print (" k %d k2 %d ", k, k2),
2921  wrp (buf[k2].p), FALSE));
2922  }
2923  }
2924  }
2925 #endif
2926  //resort S
2927 
2928  if(TEST_OPT_PROT)
2929  Print ("%i]", i);
2930 
2931  poly *add_those = (poly *) omalloc (i * sizeof (poly));
2932  for(j = 0; j < i; j++)
2933  {
2934  int len;
2935  poly p;
2936  buf[j].flatten ();
2937  kBucketClear (buf[j].bucket, &p, &len);
2938  kBucketDestroy (&buf[j].bucket);
2939  p_Test (p, c->r);
2940  //if (!c->nc) {
2941  if((c->tailReductions) || (lies_in_last_dp_block (p, c)))
2942  {
2943  p = redNFTail (p, c->strat->sl, c->strat, 0);
2944  }
2945  else
2946  {
2947  p = redTailShort (p, c->strat);
2948  }
2949  //}
2950  p_Test (p, c->r);
2951  add_those[j] = p;
2952 
2953  //sbuf[j]=add_to_basis(p,-1,-1,c,ibuf+j);
2954  }
2955  mass_add (add_those, i, c);
2956  omfree (add_those);
2957  omfree (buf);
2958 
2959  if(TEST_OPT_PROT)
2960  Print ("(%d)", c->pair_top + 1);
2961  //TODO: implement that while(!(idIs0(c->add_later)))
2962 #ifdef TGB_RESORT_PAIRS
2963  delete c->replaced;
2964  c->replaced = NULL;
2965  c->used_b = FALSE;
2966 #endif
2967  return;
2968 }
template void noro_step< tgb_uint32 >(poly *p, int &pn, slimgb_alg *c)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:495
static void replace_pair(int &i, int &j, slimgb_alg *c)
Definition: tgb.cc:1215
const CanonicalForm int s
Definition: facAbsFact.cc:55
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
#define Print
Definition: emacs.cc:83
static int red_object_better_gen(const void *ap, const void *bp)
Definition: tgb.cc:665
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
BOOLEAN tailReductions
Definition: tgb_internal.h:279
BOOLEAN use_noro_last_block
Definition: tgb_internal.h:275
static poly redNF2(poly h, slimgb_alg *c, int &len, number &m, int n=0)
Definition: tgb.cc:1837
kBucket_pt bucket
Definition: tgb_internal.h:309
template void noro_step< tgb_uint8 >(poly *p, int &pn, slimgb_alg *c)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
Definition: kInline.h:1098
void free_sorted_pair_node(sorted_pair_node *s, ring r)
Definition: tgb.cc:3954
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:448
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
Definition: tgb.cc:685
static poly redTailShort(poly h, kStrategy strat)
Definition: tgb.cc:1920
int normal_forms
Definition: tgb_internal.h:262
int k
Definition: cfEzgcd.cc:93
static int pLength(poly a)
Definition: p_polys.h:189
static void multi_reduction(red_object *los, int &losl, slimgb_alg *c)
Definition: tgb.cc:4670
sorted_pair_node * top_pair(slimgb_alg *c)
Definition: tgb.cc:3876
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN nc
Definition: tgb_internal.h:282
sorted_pair_node * quick_pop_pair(slimgb_alg *c)
Definition: tgb.cc:3900
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
int j
Definition: myNF.cc:70
int tgb_pair_better_gen2(const void *ap, const void *bp)
Definition: tgb.cc:680
#define assume(x)
Definition: mod2.h:403
int status int void * buf
Definition: si_signals.h:59
kStrategy strat
Definition: tgb_internal.h:232
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
Definition: polys.h:152
#define omfree(addr)
Definition: omAllocDecl.h:237
P bucket
Definition: myNF.cc:79
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 BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1768
wlen_type guess_quality(slimgb_alg *c)
Definition: tgb.cc:591
#define nDelete(n)
Definition: numbers.h:16
static const int bundle_size_noro
Definition: tgb.cc:37
#define p_Test(p, r)
Definition: p_polys.h:160
wlen_type expected_length
Definition: tgb_internal.h:158
int average_length
Definition: tgb_internal.h:270
#define omalloc(size)
Definition: omAllocDecl.h:228
#define NULL
Definition: omList.c:10
static void mass_add(poly *p, int pn, slimgb_alg *c)
Definition: tgb.cc:2180
BOOLEAN use_noro
Definition: tgb_internal.h:274
int * lengths
Definition: tgb_internal.h:229
template void noro_step< tgb_uint16 >(poly *p, int &pn, slimgb_alg *c)
wlen_type initial_quality
Definition: tgb_internal.h:314
int sl
Definition: kutil.h:346
static wlen_type pair_weighted_length(int i, int j, slimgb_alg *c)
Definition: tgb.cc:1373
unsigned long sev
Definition: tgb_internal.h:311
static poly nc_CreateSpoly(const poly p1, const poly p2, const ring r)
Definition: nc.h:258
static BOOLEAN lies_in_last_dp_block(poly p, slimgb_alg *c)
Definition: tgb.cc:399
static const int bundle_size
Definition: tgb.cc:36
void flatten()
Definition: tgb.cc:4853
void wrp(poly p)
Definition: polys.h:293
polyrec * poly
Definition: hilb.h:10
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2716
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
Definition: tgb.cc:3661

§ good_has_t_rep()

BOOLEAN good_has_t_rep ( int  i,
int  j,
slimgb_alg c 
)

Definition at line 876 of file tgb.cc.

877 {
878  assume (i >= 0);
879  assume (j >= 0);
880  if(has_t_rep (i, j, c))
881  return TRUE;
882  //poly lm=pOne();
883  assume (c->tmp_lm != NULL);
884  poly lm = c->tmp_lm;
885 
886  pLcm (c->S->m[i], c->S->m[j], lm);
887  pSetm (lm);
888  assume (lm != NULL);
889  //int deciding_deg= pTotaldegree(lm);
890  int *i_con = make_connections (i, j, lm, c);
891  //p_Delete(&lm,c->r);
892 
893  for(int n = 0; ((n < c->n) && (i_con[n] >= 0)); n++)
894  {
895  if(i_con[n] == j)
896  {
897  now_t_rep (i, j, c);
898  omFree (i_con);
899  return TRUE;
900  }
901  }
902  omfree (i_con);
903 
904  return FALSE;
905 }
#define pSetm(p)
Definition: polys.h:253
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#define pLcm(a, b, m)
Definition: polys.h:278
static int * make_connections(int from, int to, poly bound, slimgb_alg *c)
Definition: tgb.cc:1101
static BOOLEAN has_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *state)
Definition: tgb.cc:3682
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:403
#define omfree(addr)
Definition: omAllocDecl.h:237
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
Definition: tgb.cc:3661

§ has_t_rep()

static BOOLEAN has_t_rep ( const int &  arg_i,
const int &  arg_j,
slimgb_alg state 
)
static

Definition at line 3682 of file tgb.cc.

3683 {
3684  assume (0 <= arg_i);
3685  assume (0 <= arg_j);
3686  assume (arg_i < state->n);
3687  assume (arg_j < state->n);
3688  if(arg_i == arg_j)
3689  {
3690  return (TRUE);
3691  }
3692  if(arg_i > arg_j)
3693  {
3694  return (state->states[arg_i][arg_j] == HASTREP);
3695  }
3696  else
3697  {
3698  return (state->states[arg_j][arg_i] == HASTREP);
3699  }
3700 }
#define TRUE
Definition: auxiliary.h:101
#define assume(x)
Definition: mod2.h:403
char ** states
Definition: tgb_internal.h:221

§ init_with_mac_poly()

void init_with_mac_poly ( tgb_sparse_matrix mat,
int  row,
mac_poly  m 
)

Definition at line 3086 of file tgb.cc.

3087 {
3088  assume (mat->mp[row] == NULL);
3089  mat->mp[row] = m;
3090 #ifdef TGB_DEBUG
3091  mac_poly r = m;
3092  while(r)
3093  {
3094  assume (r->exp < mat->columns);
3095  r = r->next;
3096  }
3097 #endif
3098 }
int exp
Definition: tgbgauss.h:47
mac_poly_r * next
Definition: tgbgauss.h:46
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
int m
Definition: cfEzgcd.cc:119
#define NULL
Definition: omList.c:10
mac_poly * mp
Definition: tgbgauss.h:58

§ iq_crit()

static int iq_crit ( const void *  ap,
const void *  bp 
)
static

Definition at line 1340 of file tgb.cc.

1341 {
1342  sorted_pair_node *a = *((sorted_pair_node **) ap);
1343  sorted_pair_node *b = *((sorted_pair_node **) bp);
1344  assume (a->i > a->j);
1345  assume (b->i > b->j);
1346 
1347  if(a->deg < b->deg)
1348  return -1;
1349  if(a->deg > b->deg)
1350  return 1;
1351  int comp = pLmCmp (a->lcm_of_lm, b->lcm_of_lm);
1352  if(comp != 0)
1353  return comp;
1354  if(a->expected_length < b->expected_length)
1355  return -1;
1356  if(a->expected_length > b->expected_length)
1357  return 1;
1358  if(a->j > b->j)
1359  return 1;
1360  if(a->j < b->j)
1361  return -1;
1362  return 0;
1363 }
const poly a
Definition: syzextra.cc:212
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
#define assume(x)
Definition: mod2.h:403
wlen_type expected_length
Definition: tgb_internal.h:158
const poly b
Definition: syzextra.cc:213

§ is_valid_ro()

BOOLEAN is_valid_ro ( red_object ro)

Definition at line 2056 of file tgb.cc.

2057 {
2058  red_object r2 = ro;
2059  ro.validate ();
2060  if((r2.p != ro.p) || (r2.sev != ro.sev))
2061  return FALSE;
2062  return TRUE;
2063 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
unsigned long sev
Definition: tgb_internal.h:311
void validate()
Definition: tgb.cc:4858

§ kEBucketLength()

wlen_type kEBucketLength ( kBucket b,
poly  lm,
slimgb_alg ca 
)

Definition at line 494 of file tgb.cc.

495 {
496  wlen_type s = 0;
497  if(lm == NULL)
498  {
499  lm = kBucketGetLm (b);
500  }
501  if(lm == NULL)
502  return 0;
503  if(elength_is_normal_length (lm, ca))
504  {
505  return bucket_guess (b);
506  }
507  int d = ca->pTotaldegree (lm);
508 #if 0
509  assume (sugar >= d);
510  s = 1 + (bucket_guess (b) - 1) * (sugar - d + 1);
511  return s;
512 #else
513 
514  //int d=pTotaldegree(lm,ca->r);
515  int i;
516  for(i = b->buckets_used; i >= 0; i--)
517  {
518  if(b->buckets[i] == NULL)
519  continue;
520 
521  if((ca->pTotaldegree (b->buckets[i]) <= d)
522  && (elength_is_normal_length (b->buckets[i], ca)))
523  {
524  s += b->buckets_length[i];
525  }
526  else
527  {
528  s += do_pELength (b->buckets[i], ca, d);
529  }
530  }
531  return s;
532 #endif
533 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
static BOOLEAN elength_is_normal_length(poly p, slimgb_alg *c)
Definition: tgb.cc:371
static wlen_type do_pELength(poly p, slimgb_alg *c, int dlm=-1)
Definition: tgb.cc:446
#define assume(x)
Definition: mod2.h:403
static int bucket_guess(kBucket *bucket)
Definition: tgb.cc:952
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56

§ kFindDivisibleByInS_easy() [1/2]

int kFindDivisibleByInS_easy ( kStrategy  strat,
const red_object obj 
)

Definition at line 685 of file tgb.cc.

686 {
687  int i;
688  long not_sev = ~obj.sev;
689  poly p = obj.p;
690  for(i = 0; i <= strat->sl; i++)
691  {
692  if(pLmShortDivisibleBy (strat->S[i], strat->sevS[i], p, not_sev))
693  return i;
694  }
695  return -1;
696 }
return P p
Definition: myNF.cc:203
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
Definition: polys.h:146
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
unsigned long * sevS
Definition: kutil.h:318
int sl
Definition: kutil.h:346
unsigned long sev
Definition: tgb_internal.h:311
polyrec * poly
Definition: hilb.h:10

§ kFindDivisibleByInS_easy() [2/2]

int kFindDivisibleByInS_easy ( kStrategy  strat,
poly  p,
long  sev 
)

Definition at line 698 of file tgb.cc.

699 {
700  int i;
701  long not_sev = ~sev;
702  for(i = 0; i <= strat->sl; i++)
703  {
704  if(pLmShortDivisibleBy (strat->S[i], strat->sevS[i], p, not_sev))
705  return i;
706  }
707  return -1;
708 }
return P p
Definition: myNF.cc:203
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
Definition: polys.h:146
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
unsigned long * sevS
Definition: kutil.h:318
int sl
Definition: kutil.h:346

§ kSBucketLength()

wlen_type kSBucketLength ( kBucket b,
poly  lm = NULL 
)

TODO CoefBuckets bercksichtigen.

Definition at line 221 of file tgb.cc.

222 {
223  int s = 0;
224  wlen_type c;
225  number coef;
226  if(lm == NULL)
227  coef = pGetCoeff (kBucketGetLm (b));
228  //c=nSize(pGetCoeff(kBucketGetLm(b)));
229  else
230  coef = pGetCoeff (lm);
231  //c=nSize(pGetCoeff(lm));
232  if(rField_is_Q (currRing))
233  {
234  c = nlQlogSize (coef, currRing->cf);
235  }
236  else
237  c = nSize (coef);
238 
239  int i;
240  for(i = b->buckets_used; i >= 0; i--)
241  {
242  assume ((b->buckets_length[i] == 0) || (b->buckets[i] != NULL));
243  s += b->buckets_length[i] /*pLength(b->buckets[i]) */ ;
244  }
245 #ifdef HAVE_COEF_BUCKETS
246  assume (b->buckets[0] == kBucketGetLm (b));
247  if(b->coef[0] != NULL)
248  {
249  if(rField_is_Q (currRing))
250  {
251  int modifier = nlQlogSize (pGetCoeff (b->coef[0]), currRing->cf);
252  c += modifier;
253  }
254  else
255  {
256  int modifier = nSize (pGetCoeff (b->coef[0]));
257  c *= modifier;
258  }
259  }
260 #endif
261  if(!(TEST_V_COEFSTRAT))
262  {
263  return s * c;
264  }
265  else
266  {
267  wlen_type res = s;
268  res *= c;
269  res *= c;
270  return res;
271  }
272 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
static FORCE_INLINE int nlQlogSize(number n, const coeffs r)
only used by slimgb (tgb.cc)
Definition: longrat.h:77
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
#define TEST_V_COEFSTRAT
Definition: options.h:132
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
#define nSize(n)
Definition: numbers.h:39

§ length_one_crit()

static void length_one_crit ( slimgb_alg c,
int  pos,
int  len 
)
static

Definition at line 1005 of file tgb.cc.

1006 {
1007  if(c->nc)
1008  return;
1009  if(len == 1)
1010  {
1011  int i;
1012  for(i = 0; i < pos; i++)
1013  {
1014  if(c->lengths[i] == 1)
1015  c->states[pos][i] = HASTREP;
1016  }
1017  for(i = pos + 1; i < c->n; i++)
1018  {
1019  if(c->lengths[i] == 1)
1020  c->states[i][pos] = HASTREP;
1021  }
1022  if(!c->nc)
1023  shorten_tails (c, c->S->m[pos]);
1024  }
1025 }
static void shorten_tails(slimgb_alg *c, poly monom)
Definition: tgb.cc:3715
BOOLEAN nc
Definition: tgb_internal.h:282
int i
Definition: cfEzgcd.cc:123
char ** states
Definition: tgb_internal.h:221
int * lengths
Definition: tgb_internal.h:229

§ lenS_correct()

BOOLEAN lenS_correct ( kStrategy  strat)

Definition at line 907 of file tgb.cc.

908 {
909  int i;
910  for(i = 0; i <= strat->sl; i++)
911  {
912  if(strat->lenS[i] != pLength (strat->S[i]))
913  return FALSE;
914  }
915  return TRUE;
916 }
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
static int pLength(poly a)
Definition: p_polys.h:189
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
int sl
Definition: kutil.h:346

§ lies_in_last_dp_block()

static BOOLEAN lies_in_last_dp_block ( poly  p,
slimgb_alg c 
)
static

Definition at line 399 of file tgb.cc.

400 {
401  ring r = c->r;
402  if(p_GetComp (p, r) != 0)
403  return FALSE;
404  if(c->lastDpBlockStart <= (currRing->N))
405  {
406  int i;
407  for(i = 1; i < c->lastDpBlockStart; i++)
408  {
409  if(p_GetExp (p, i, r) != 0)
410  {
411  break;
412  }
413  }
414  if(i >= c->lastDpBlockStart)
415  {
416  //wrp(p);
417  //PrintS("\n");
418  return TRUE;
419  }
420  else
421  return FALSE;
422  }
423  else
424  return FALSE;
425 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define p_GetComp(p, r)
Definition: monomials.h:72
#define TRUE
Definition: auxiliary.h:101
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:464
int i
Definition: cfEzgcd.cc:123
int lastDpBlockStart
Definition: tgb_internal.h:271

§ line_of_extended_prod()

static void line_of_extended_prod ( int  fixpos,
slimgb_alg c 
)
static

Definition at line 1939 of file tgb.cc.

1940 {
1941  if(c->gcd_of_terms[fixpos] == NULL)
1942  {
1943  c->gcd_of_terms[fixpos] = gcd_of_terms (c->S->m[fixpos], c->r);
1944  if(c->gcd_of_terms[fixpos])
1945  {
1946  int i;
1947  for(i = 0; i < fixpos; i++)
1948  if((c->states[fixpos][i] != HASTREP)
1949  &&
1951  (c->S->m[fixpos], c->gcd_of_terms[fixpos], c->S->m[i],
1952  c->gcd_of_terms[i], c)))
1953  {
1954  c->states[fixpos][i] = HASTREP;
1955  c->extended_product_crit++;
1956  }
1957  for(i = fixpos + 1; i < c->n; i++)
1958  if((c->states[i][fixpos] != HASTREP)
1959  &&
1961  (c->S->m[fixpos], c->gcd_of_terms[fixpos], c->S->m[i],
1962  c->gcd_of_terms[i], c)))
1963  {
1964  c->states[i][fixpos] = HASTREP;
1965  c->extended_product_crit++;
1966  }
1967  }
1968  }
1969 }
static BOOLEAN extended_product_criterion(poly p1, poly gcd1, poly p2, poly gcd2, slimgb_alg *c)
Definition: tgb.cc:4080
int extended_product_crit
Definition: tgb_internal.h:269
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static poly gcd_of_terms(poly p, ring r)
Definition: tgb.cc:4021
char ** states
Definition: tgb_internal.h:221
poly * gcd_of_terms
Definition: tgb_internal.h:239

§ make_connections()

static int * make_connections ( int  from,
int  to,
poly  bound,
slimgb_alg c 
)
static

Definition at line 1101 of file tgb.cc.

1102 {
1103  ideal I = c->S;
1104  int *cans = (int *) omAlloc (c->n * sizeof (int));
1105  int *connected = (int *) omAlloc (c->n * sizeof (int));
1106  cans[0] = to;
1107  int cans_length = 1;
1108  connected[0] = from;
1109  int last_cans_pos = -1;
1110  int connected_length = 1;
1111  long neg_bounds_short = ~p_GetShortExpVector (bound, c->r);
1112 
1113  int not_yet_found = cans_length;
1114  int con_checked = 0;
1115  int pos;
1116 
1117  while(TRUE)
1118  {
1119  if((con_checked < connected_length) && (not_yet_found > 0))
1120  {
1121  pos = connected[con_checked];
1122  for(int i = 0; i < cans_length; i++)
1123  {
1124  if(cans[i] < 0)
1125  continue;
1126  //FIXME: triv. syz. does not hold on noncommutative, check it for modules
1127  if((has_t_rep (pos, cans[i], c))
1128  || ((!rIsPluralRing (c->r))
1129  && (trivial_syzygie (pos, cans[i], bound, c))))
1130  {
1131  connected[connected_length] = cans[i];
1132  connected_length++;
1133  cans[i] = -1;
1134  --not_yet_found;
1135 
1136  if(connected[connected_length - 1] == to)
1137  {
1138  if(connected_length < c->n)
1139  {
1140  connected[connected_length] = -1;
1141  }
1142  omFree (cans);
1143  return connected;
1144  }
1145  }
1146  }
1147  con_checked++;
1148  }
1149  else
1150  {
1151  for(last_cans_pos++; last_cans_pos <= c->n; last_cans_pos++)
1152  {
1153  if(last_cans_pos == c->n)
1154  {
1155  if(connected_length < c->n)
1156  {
1157  connected[connected_length] = -1;
1158  }
1159  omfree (cans);
1160  return connected;
1161  }
1162  if((last_cans_pos == from) || (last_cans_pos == to))
1163  continue;
1165  (I->m[last_cans_pos], c->short_Exps[last_cans_pos], bound,
1166  neg_bounds_short, c->r))
1167  {
1168  cans[cans_length] = last_cans_pos;
1169  cans_length++;
1170  break;
1171  }
1172  }
1173  not_yet_found++;
1174  for(int i = 0; i < con_checked; i++)
1175  {
1176  if(has_t_rep (connected[i], last_cans_pos, c))
1177  {
1178  connected[connected_length] = last_cans_pos;
1179  connected_length++;
1180  cans[cans_length - 1] = -1;
1181  --not_yet_found;
1182  if(connected[connected_length - 1] == to)
1183  {
1184  if(connected_length < c->n)
1185  {
1186  connected[connected_length] = -1;
1187  }
1188  omFree (cans);
1189  return connected;
1190  }
1191  break;
1192  }
1193  }
1194  }
1195  }
1196  if(connected_length < c->n)
1197  {
1198  connected[connected_length] = -1;
1199  }
1200  omfree (cans);
1201  return connected;
1202 }
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
#define TRUE
Definition: auxiliary.h:101
static BOOLEAN trivial_syzygie(int pos1, int pos2, poly bound, slimgb_alg *c)
Definition: tgb.cc:800
#define omAlloc(size)
Definition: omAllocDecl.h:210
long * short_Exps
Definition: tgb_internal.h:231
clock_t to
Definition: walk.cc:99
static BOOLEAN has_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *state)
Definition: tgb.cc:3682
#define omFree(addr)
Definition: omAllocDecl.h:261
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#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 i
Definition: cfEzgcd.cc:123
unsigned long p_GetShortExpVector(const poly p, const ring r)
Definition: p_polys.cc:4589

§ mass_add()

static void mass_add ( poly p,
int  pn,
slimgb_alg c 
)
static

Definition at line 2180 of file tgb.cc.

2181 {
2182  int j;
2183  int *ibuf = (int *) omalloc (pn * sizeof (int));
2184  sorted_pair_node ***sbuf =
2185  (sorted_pair_node ***) omalloc (pn * sizeof (sorted_pair_node **));
2186  for(j = 0; j < pn; j++)
2187  {
2188  p_Test (p[j], c->r);
2189  sbuf[j] = add_to_basis_ideal_quotient (p[j], c, ibuf + j);
2190  }
2191  int sum = 0;
2192  for(j = 0; j < pn; j++)
2193  {
2194  sum += ibuf[j];
2195  }
2196  sorted_pair_node **big_sbuf =
2197  (sorted_pair_node **) omalloc (sum * sizeof (sorted_pair_node *));
2198  int partsum = 0;
2199  for(j = 0; j < pn; j++)
2200  {
2201  memmove (big_sbuf + partsum, sbuf[j],
2202  ibuf[j] * sizeof (sorted_pair_node *));
2203  omFree (sbuf[j]);
2204  partsum += ibuf[j];
2205  }
2206 
2207  qsort (big_sbuf, sum, sizeof (sorted_pair_node *), tgb_pair_better_gen2);
2208  c->apairs = spn_merge (c->apairs, c->pair_top + 1, big_sbuf, sum, c);
2209  c->pair_top += sum;
2211  omfree (big_sbuf);
2212  omfree (sbuf);
2213  omfree (ibuf);
2214  //omfree(buf);
2215 #ifdef TGB_DEBUG
2216  int z;
2217  for(z = 1; z <= c->pair_top; z++)
2218  {
2219  assume (pair_better (c->apairs[z], c->apairs[z - 1], c));
2220  }
2221 #endif
2222 
2223 }
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
return P p
Definition: myNF.cc:203
void clean_top_of_pair_list(slimgb_alg *c)
Definition: tgb.cc:3921
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
int tgb_pair_better_gen2(const void *ap, const void *bp)
Definition: tgb.cc:680
#define assume(x)
Definition: mod2.h:403
#define omfree(addr)
Definition: omAllocDecl.h:237
static BOOLEAN pair_better(sorted_pair_node *a, sorted_pair_node *b, slimgb_alg *c=NULL)
Definition: tgb.cc:3962
#define p_Test(p, r)
Definition: p_polys.h:160
#define omalloc(size)
Definition: omAllocDecl.h:228
sorted_pair_node ** spn_merge(sorted_pair_node **p, int pn, sorted_pair_node **q, int qn, slimgb_alg *c)
Definition: tgb.cc:751

§ monomial_root()

static BOOLEAN monomial_root ( poly  m,
ring  r 
)
static

Definition at line 89 of file tgb.cc.

90 {
91  BOOLEAN changed = FALSE;
92  int i;
93  for(i = 1; i <= rVar (r); i++)
94  {
95  int e = p_GetExp (m, i, r);
96  if(e > 1)
97  {
98  p_SetExp (m, i, 1, r);
99  changed = TRUE;
100  }
101  }
102  if(changed)
103  {
104  p_Setm (m, r);
105  }
106  return changed;
107 }
#define FALSE
Definition: auxiliary.h:97
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
#define TRUE
Definition: auxiliary.h:101
const ring r
Definition: syzextra.cc:208
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:464
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:483
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
int BOOLEAN
Definition: auxiliary.h:88

§ move_backward_in_S()

static void move_backward_in_S ( int  old_pos,
int  new_pos,
kStrategy  strat 
)
static

Definition at line 1064 of file tgb.cc.

1065 {
1066  assume (old_pos <= new_pos);
1067  poly p = strat->S[old_pos];
1068  int ecart = strat->ecartS[old_pos];
1069  long sev = strat->sevS[old_pos];
1070  int s_2_r = strat->S_2_R[old_pos];
1071  int length = strat->lenS[old_pos];
1072  assume (length == pLength (strat->S[old_pos]));
1073  wlen_type length_w;
1074  if(strat->lenSw != NULL)
1075  length_w = strat->lenSw[old_pos];
1076  int i;
1077  for(i = old_pos; i < new_pos; i++)
1078  {
1079  strat->S[i] = strat->S[i + 1];
1080  strat->ecartS[i] = strat->ecartS[i + 1];
1081  strat->sevS[i] = strat->sevS[i + 1];
1082  strat->S_2_R[i] = strat->S_2_R[i + 1];
1083  }
1084  if(strat->lenS != NULL)
1085  for(i = old_pos; i < new_pos; i++)
1086  strat->lenS[i] = strat->lenS[i + 1];
1087  if(strat->lenSw != NULL)
1088  for(i = old_pos; i < new_pos; i++)
1089  strat->lenSw[i] = strat->lenSw[i + 1];
1090 
1091  strat->S[new_pos] = p;
1092  strat->ecartS[new_pos] = ecart;
1093  strat->sevS[new_pos] = sev;
1094  strat->S_2_R[new_pos] = s_2_r;
1095  strat->lenS[new_pos] = length;
1096  if(strat->lenSw != NULL)
1097  strat->lenSw[new_pos] = length_w;
1098  //assume(lenS_correct(strat));
1099 }
wlen_set lenSw
Definition: kutil.h:316
int * S_2_R
Definition: kutil.h:340
return P p
Definition: myNF.cc:203
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
intset ecartS
Definition: kutil.h:305
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
unsigned long * sevS
Definition: kutil.h:318
polyrec * poly
Definition: hilb.h:10

§ move_forward_in_S()

static void move_forward_in_S ( int  old_pos,
int  new_pos,
kStrategy  strat 
)
static

Definition at line 1027 of file tgb.cc.

1028 {
1029  assume (old_pos >= new_pos);
1030  poly p = strat->S[old_pos];
1031  int ecart = strat->ecartS[old_pos];
1032  long sev = strat->sevS[old_pos];
1033  int s_2_r = strat->S_2_R[old_pos];
1034  int length = strat->lenS[old_pos];
1035  assume (length == pLength (strat->S[old_pos]));
1036  wlen_type length_w;
1037  if(strat->lenSw != NULL)
1038  length_w = strat->lenSw[old_pos];
1039  int i;
1040  for(i = old_pos; i > new_pos; i--)
1041  {
1042  strat->S[i] = strat->S[i - 1];
1043  strat->ecartS[i] = strat->ecartS[i - 1];
1044  strat->sevS[i] = strat->sevS[i - 1];
1045  strat->S_2_R[i] = strat->S_2_R[i - 1];
1046  }
1047  if(strat->lenS != NULL)
1048  for(i = old_pos; i > new_pos; i--)
1049  strat->lenS[i] = strat->lenS[i - 1];
1050  if(strat->lenSw != NULL)
1051  for(i = old_pos; i > new_pos; i--)
1052  strat->lenSw[i] = strat->lenSw[i - 1];
1053 
1054  strat->S[new_pos] = p;
1055  strat->ecartS[new_pos] = ecart;
1056  strat->sevS[new_pos] = sev;
1057  strat->S_2_R[new_pos] = s_2_r;
1058  strat->lenS[new_pos] = length;
1059  if(strat->lenSw != NULL)
1060  strat->lenSw[new_pos] = length_w;
1061  //assume(lenS_correct(strat));
1062 }
wlen_set lenSw
Definition: kutil.h:316
int * S_2_R
Definition: kutil.h:340
return P p
Definition: myNF.cc:203
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:403
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
intset ecartS
Definition: kutil.h:305
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
unsigned long * sevS
Definition: kutil.h:318
polyrec * poly
Definition: hilb.h:10

§ multi_reduce_step()

void multi_reduce_step ( find_erg erg,
red_object r,
slimgb_alg c 
)
static

Definition at line 4928 of file tgb.cc.

4929 {
4930  static int id = 0;
4931  id++;
4932  unsigned long sev;
4933  BOOLEAN lt_changed = FALSE;
4934  int rn = erg.reduce_by;
4935  poly red;
4936  int red_len;
4937  simple_reducer *pointer;
4938  BOOLEAN work_on_copy = FALSE;
4939  if(erg.fromS)
4940  {
4941  red = c->strat->S[rn];
4942  red_len = c->strat->lenS[rn];
4943  assume (red_len == pLength (red));
4944  }
4945  else
4946  {
4947  r[rn].flatten ();
4948  kBucketClear (r[rn].bucket, &red, &red_len);
4949 
4950  if(!rField_is_Zp (c->r))
4951  {
4952  p_Cleardenom (red, c->r); //should be unnecessary
4953  //includes p_Content(red, c->r);
4954  }
4955  pNormalize (red);
4956 
4957  if((!(erg.fromS)) && (TEST_V_UPTORADICAL))
4958  {
4959  if(polynomial_root (red, c->r))
4960  lt_changed = TRUE;
4961  sev = p_GetShortExpVector (red, c->r);
4962  }
4963  red_len = pLength (red);
4964  }
4965  if(((TEST_V_MODPSOLVSB) && (red_len > 1))
4966  || ((c->nc) || (erg.to_reduce_u - erg.to_reduce_l > 5)))
4967  {
4968  work_on_copy = TRUE;
4969  // poly m=pOne();
4970  poly m = c->tmp_lm;
4971  pSetCoeff (m, nInit (1));
4972  pSetComp (m, 0);
4973  for(int i = 1; i <= (currRing->N); i++)
4974  pSetExp (m, i, (pGetExp (r[erg.to_reduce_l].p, i) - pGetExp (red, i)));
4975  pSetm (m);
4976  poly red_cp;
4977 #ifdef HAVE_PLURAL
4978  if(c->nc)
4979  red_cp = nc_mm_Mult_pp (m, red, c->r);
4980  else
4981 #endif
4982  red_cp = ppMult_mm (red, m);
4983  if(!erg.fromS)
4984  {
4985  kBucketInit (r[rn].bucket, red, red_len);
4986  }
4987  //now reduce the copy
4988  //static poly redNF2 (poly h,slimgb_alg* c , int &len, number& m,int n)
4989 
4990  if(!c->nc)
4991  redTailShort (red_cp, c->strat);
4992  //number mul;
4993  // red_len--;
4994 // red_cp->next=redNF2(red_cp->next,c,red_len,mul,c->average_length);
4995 // pSetCoeff(red_cp,nMult(red_cp->coef,mul));
4996 // nDelete(&mul);
4997 // red_len++;
4998  red = red_cp;
4999  red_len = pLength (red);
5000  // pDelete(&m);
5001  }
5002 
5003  assume (red_len == pLength (red));
5004 
5005  int reducer_deg = 0;
5006  if(c->eliminationProblem)
5007  {
5008  int lm_deg = c->pTotaldegree (r[erg.to_reduce_l].p);
5009  int ecart;
5010  if(erg.fromS)
5011  {
5012  ecart = c->strat->ecartS[erg.reduce_by];
5013  }
5014  else
5015  {
5016  ecart = c->pTotaldegree_full (red) - lm_deg;
5017  }
5018  reducer_deg = lm_deg + ecart;
5019  }
5020  pointer = new simple_reducer (red, red_len, reducer_deg, c);
5021 
5022  if((!work_on_copy) && (!erg.fromS))
5023  pointer->fill_back = r[rn].bucket;
5024  else
5025  pointer->fill_back = NULL;
5026  pointer->reduction_id = id;
5027  pointer->c = c;
5028 
5029  pointer->reduce (r, erg.to_reduce_l, erg.to_reduce_u);
5030  if(work_on_copy)
5031  pDelete (&pointer->p);
5032  delete pointer;
5033  if(lt_changed)
5034  {
5035  assume (!erg.fromS);
5036  r[erg.reduce_by].sev = sev;
5037  }
5038 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:495
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
#define pSetm(p)
Definition: polys.h:253
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:97
kBucket_pt bucket
Definition: tgb_internal.h:309
int to_reduce_u
Definition: tgb_internal.h:387
#define ppMult_mm(p, m)
Definition: polys.h:184
int pTotaldegree_full(poly p)
Definition: tgb_internal.h:294
kBucket_pt fill_back
Definition: tgb_internal.h:361
static BOOLEAN polynomial_root(poly h, ring r)
Definition: tgb.cc:109
#define TRUE
Definition: auxiliary.h:101
static poly redTailShort(poly h, kStrategy strat)
Definition: tgb.cc:1920
slimgb_alg * c
Definition: tgb_internal.h:354
static int pLength(poly a)
Definition: p_polys.h:189
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
BOOLEAN nc
Definition: tgb_internal.h:282
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
pNormalize(P.p)
P bucket
Definition: myNF.cc:79
#define pSetComp(p, v)
Definition: polys.h:38
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
unsigned long p_GetShortExpVector(const poly p, const ring r)
Definition: p_polys.cc:4589
intset ecartS
Definition: kutil.h:305
#define TEST_V_MODPSOLVSB
Definition: options.h:131
#define NULL
Definition: omList.c:10
virtual void reduce(red_object *r, int l, int u)
we assume hat all occuring red_objects have same lm, and all occ. lm&#39;s in r[l...u] are the same...
Definition: tgb.cc:4889
#define pDelete(p_ptr)
Definition: polys.h:169
BOOLEAN eliminationProblem
Definition: tgb_internal.h:280
unsigned long sev
Definition: tgb_internal.h:311
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
BOOLEAN fromS
Definition: tgb_internal.h:390
void flatten()
Definition: tgb.cc:4853
#define TEST_V_UPTORADICAL
Definition: options.h:133
int reduce_by
Definition: tgb_internal.h:389
polyrec * poly
Definition: hilb.h:10
#define nInit(i)
Definition: numbers.h:24
int to_reduce_l
Definition: tgb_internal.h:388
int BOOLEAN
Definition: auxiliary.h:88
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2716
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31

§ multi_reduction()

static void multi_reduction ( red_object los,
int &  losl,
slimgb_alg c 
)
static

Definition at line 4670 of file tgb.cc.

4671 {
4672  poly *delay = (poly *) omalloc (losl * sizeof (poly));
4673  int delay_s = 0;
4674  //initialize;
4675  assume (c->strat->sl >= 0);
4676  assume (losl > 0);
4677  int i;
4678  wlen_type max_initial_quality = 0;
4679 
4680  for(i = 0; i < losl; i++)
4681  {
4682  los[i].sev = pGetShortExpVector (los[i].p);
4683 //SetShortExpVector();
4684  los[i].p = kBucketGetLm (los[i].bucket);
4685  if(los[i].initial_quality > max_initial_quality)
4686  max_initial_quality = los[i].initial_quality;
4687  // else
4688 // Print("init2_qal=%lld;", los[i].initial_quality);
4689 // Print("initial_quality=%lld;",max_initial_quality);
4690  }
4691 
4692  int curr_pos = losl - 1;
4693 
4694 // nicht reduzierbare eintr�e in ergebnisliste schreiben
4695  // nullen loeschen
4696  while(curr_pos >= 0)
4697  {
4698  if((c->use_noro_last_block)
4699  && (lies_in_last_dp_block (los[curr_pos].p, c)))
4700  {
4701  int pn_noro = curr_pos + 1;
4702  poly *p_noro = (poly *) omalloc (pn_noro * sizeof (poly));
4703  for(i = 0; i < pn_noro; i++)
4704  {
4705  int dummy_len;
4706  poly p;
4707  los[i].p = NULL;
4708  kBucketClear (los[i].bucket, &p, &dummy_len);
4709  p_noro[i] = p;
4710  }
4711  if(n_GetChar(currRing->cf) < 255)
4712  {
4713  noro_step < tgb_uint8 > (p_noro, pn_noro, c);
4714  }
4715  else
4716  {
4717  if(n_GetChar(currRing->cf) < 65000)
4718  {
4719  noro_step < tgb_uint16 > (p_noro, pn_noro, c);
4720  }
4721  else
4722  {
4723  noro_step < tgb_uint32 > (p_noro, pn_noro, c);
4724  }
4725  }
4726  for(i = 0; i < pn_noro; i++)
4727  {
4728  los[i].p = p_noro[i];
4729  los[i].sev = pGetShortExpVector (los[i].p);
4730  //ignore quality
4731  kBucketInit (los[i].bucket, los[i].p, pLength (los[i].p));
4732  }
4733  qsort (los, pn_noro, sizeof (red_object), red_object_better_gen);
4734  int deleted =
4735  multi_reduction_clear_zeroes (los, losl, pn_noro, curr_pos);
4736  losl -= deleted;
4737  curr_pos -= deleted;
4738  break;
4739  }
4740  find_erg erg;
4741 
4742  multi_reduction_find (los, losl, c, curr_pos, erg); //last argument should be curr_pos
4743  if(erg.reduce_by < 0)
4744  break;
4745 
4746  erg.expand = NULL;
4747 
4748  multi_reduction_lls_trick (los, losl, c, erg);
4749 
4750  int i;
4751  // wrp(los[erg.to_reduce_u].p);
4752  //PrintLn();
4753  multi_reduce_step (erg, los, c);
4754 
4755 
4756  if(!TEST_OPT_REDTHROUGH)
4757  {
4758  for(i = erg.to_reduce_l; i <= erg.to_reduce_u; i++)
4759  {
4760  if(los[i].p != NULL) //the check (los[i].p!=NULL) might be invalid
4761  {
4762  //
4763  assume (los[i].initial_quality > 0);
4764  if(los[i].guess_quality (c)
4765  > 1.5 * delay_factor * max_initial_quality)
4766  {
4767  if(TEST_OPT_PROT)
4768  PrintS ("v");
4769  los[i].canonicalize ();
4770  if(los[i].guess_quality (c) > delay_factor * max_initial_quality)
4771  {
4772  if(TEST_OPT_PROT)
4773  PrintS (".");
4774  los[i].clear_to_poly ();
4775  //delay.push_back(los[i].p);
4776  delay[delay_s] = los[i].p;
4777  delay_s++;
4778  los[i].p = NULL;
4779  }
4780  }
4781  }
4782  }
4783  }
4784  int deleted = multi_reduction_clear_zeroes (los, losl, erg.to_reduce_l,
4785  erg.to_reduce_u);
4786  if(erg.fromS == FALSE)
4787  curr_pos = si_max (erg.to_reduce_u, erg.reduce_by);
4788  else
4789  curr_pos = erg.to_reduce_u;
4790  losl -= deleted;
4791  curr_pos -= deleted;
4792 
4793  //Print("deleted %i \n",deleted);
4794  if((TEST_V_UPTORADICAL) && (!(erg.fromS)))
4795  sort_region_down (los, si_min (erg.to_reduce_l, erg.reduce_by),
4796  (si_max (erg.to_reduce_u, erg.reduce_by)) - deleted,
4797  c);
4798  else
4799  sort_region_down (los, erg.to_reduce_l, erg.to_reduce_u - deleted, c);
4800 
4801  if(erg.expand)
4802  {
4803 #ifdef FIND_DETERMINISTIC
4804  int i;
4805  for(i = 0; c->expandS[i]; i++) ;
4806  c->expandS = (poly *) omrealloc (c->expandS, (i + 2) * sizeof (poly));
4807  c->expandS[i] = erg.expand;
4808  c->expandS[i + 1] = NULL;
4809 #else
4810  int ecart = 0;
4811  if(c->eliminationProblem)
4812  {
4813  ecart =
4814  c->pTotaldegree_full (erg.expand) - c->pTotaldegree (erg.expand);
4815  }
4816  add_to_reductors (c, erg.expand, erg.expand_length, ecart);
4817 #endif
4818  }
4819  }
4820 
4821  //sorted_pair_node** pairs=(sorted_pair_node**)
4822  // omalloc(delay_s*sizeof(sorted_pair_node*));
4823  c->introduceDelayedPairs (delay, delay_s);
4824  /*
4825  for(i=0;i<delay_s;i++)
4826  {
4827  poly p=delay[i];
4828  //if (rPar(c->r)==0)
4829  simplify_poly(p,c->r);
4830  sorted_pair_node* si=(sorted_pair_node*) omalloc(sizeof(sorted_pair_node));
4831  si->i=-1;
4832  si->j=-1;
4833  if (!rField_is_Zp(c->r))
4834  {
4835  if (!c->nc)
4836  p=redTailShort(p, c->strat);
4837  p_Cleardenom(p, c->r);
4838  p_Content(p, c->r);
4839  }
4840  si->expected_length=pQuality(p,c,pLength(p));
4841  si->deg=pTotaldegree(p);
4842  si->lcm_of_lm=p;
4843  pairs[i]=si;
4844  }
4845  qsort(pairs,delay_s,sizeof(sorted_pair_node*),tgb_pair_better_gen2);
4846  c->apairs=spn_merge(c->apairs,c->pair_top+1,pairs,delay_s,c);
4847  c->pair_top+=delay_s; */
4848  omfree (delay);
4849  //omfree(pairs);
4850  return;
4851 }
static void multi_reduction_find(red_object *los, int, slimgb_alg *c, int startf, find_erg &erg)
Definition: tgb.cc:4495
template void noro_step< tgb_uint32 >(poly *p, int &pn, slimgb_alg *c)
static int add_to_reductors(slimgb_alg *c, poly h, int len, int ecart, BOOLEAN simplified=FALSE)
Definition: tgb.cc:965
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:495
void introduceDelayedPairs(poly *pa, int s)
Definition: tgb.cc:3139
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
static void sort_region_down(red_object *los, int l, int u, slimgb_alg *)
Definition: tgb.cc:4614
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
static int red_object_better_gen(const void *ap, const void *bp)
Definition: tgb.cc:665
#define TEST_OPT_PROT
Definition: options.h:98
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
int expand_length
Definition: tgb_internal.h:386
BOOLEAN use_noro_last_block
Definition: tgb_internal.h:275
template void noro_step< tgb_uint8 >(poly *p, int &pn, slimgb_alg *c)
int to_reduce_u
Definition: tgb_internal.h:387
int pTotaldegree_full(poly p)
Definition: tgb_internal.h:294
static int multi_reduction_clear_zeroes(red_object *los, int losl, int l, int u)
Definition: tgb.cc:4561
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
static void multi_reduce_step(find_erg &erg, red_object *r, slimgb_alg *c)
Definition: tgb.cc:4928
static void multi_reduction_lls_trick(red_object *los, int, slimgb_alg *c, find_erg &erg)
Definition: tgb.cc:4165
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
Definition: coeffs.h:448
static int pLength(poly a)
Definition: p_polys.h:189
void canonicalize()
Definition: tgb.cc:871
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
poly expand
Definition: tgb_internal.h:385
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
Definition: polys.h:152
#define omfree(addr)
Definition: omAllocDecl.h:237
P bucket
Definition: myNF.cc:79
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
poly * expandS
Definition: tgb_internal.h:238
static const int delay_factor
Definition: tgb.cc:38
#define omalloc(size)
Definition: omAllocDecl.h:228
#define omrealloc(addr, size)
Definition: omAllocDecl.h:233
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
template void noro_step< tgb_uint16 >(poly *p, int &pn, slimgb_alg *c)
BOOLEAN eliminationProblem
Definition: tgb_internal.h:280
wlen_type initial_quality
Definition: tgb_internal.h:314
int sl
Definition: kutil.h:346
unsigned long sev
Definition: tgb_internal.h:311
BOOLEAN fromS
Definition: tgb_internal.h:390
static BOOLEAN lies_in_last_dp_block(poly p, slimgb_alg *c)
Definition: tgb.cc:399
int clear_to_poly()
Definition: tgb.cc:4865
#define TEST_V_UPTORADICAL
Definition: options.h:133
int reduce_by
Definition: tgb_internal.h:389
polyrec * poly
Definition: hilb.h:10
#define TEST_OPT_REDTHROUGH
Definition: options.h:116
int to_reduce_l
Definition: tgb_internal.h:388

§ multi_reduction_clear_zeroes()

static int multi_reduction_clear_zeroes ( red_object los,
int  losl,
int  l,
int  u 
)
static

Definition at line 4561 of file tgb.cc.

4562 {
4563  int deleted = 0;
4564  int i = l;
4565  int last = -1;
4566  while(i <= u)
4567  {
4568  if(los[i].p == NULL)
4569  {
4570  kBucketDestroy (&los[i].bucket);
4571 // delete los[i];//here we assume los are constructed with new
4572  //destroy resources, must be added here
4573  if(last >= 0)
4574  {
4575  memmove (los + (int) (last + 1 - deleted), los + (last + 1),
4576  sizeof (red_object) * (i - 1 - last));
4577  }
4578  last = i;
4579  deleted++;
4580  }
4581  i++;
4582  }
4583  if((last >= 0) && (last != losl - 1))
4584  memmove (los + (int) (last + 1 - deleted), los + last + 1,
4585  sizeof (red_object) * (losl - 1 - last));
4586  return deleted;
4587 }
return P p
Definition: myNF.cc:203
static poly last
Definition: hdegree.cc:1077
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
P bucket
Definition: myNF.cc:79
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int l
Definition: cfEzgcd.cc:94

§ multi_reduction_find()

static void multi_reduction_find ( red_object los,
int  ,
slimgb_alg c,
int  startf,
find_erg erg 
)
static

Definition at line 4495 of file tgb.cc.

4502 {
4503  kStrategy strat = c->strat;
4504 
4505  assume (startf <= losl);
4506  assume ((startf == losl - 1)
4507  || (pLmCmp (los[startf].p, los[startf + 1].p) == -1));
4508  int i = startf;
4509 
4510  int j;
4511  while(i >= 0)
4512  {
4513  assume ((i == losl - 1) || (pLmCmp (los[i].p, los[i + 1].p) <= 0));
4514  assume (is_valid_ro (los[i]));
4515  j = kFindDivisibleByInS_easy (strat, los[i]);
4516  if(j >= 0)
4517  {
4518  erg.to_reduce_u = i;
4519  erg.reduce_by = j;
4520  erg.fromS = TRUE;
4521  int i2 = fwbw (los, i);
4522  assume (pLmEqual (los[i].p, los[i2].p));
4523  assume ((i2 == 0) || (!pLmEqual (los[i2].p, los[i2 - 1].p)));
4524  assume (i >= i2);
4525 
4526  erg.to_reduce_l = i2;
4527  assume ((i == losl - 1) || (pLmCmp (los[i].p, los[i + 1].p) == -1));
4528  canonicalize_region (los, erg.to_reduce_u + 1, startf, c);
4529  return;
4530  }
4531  if(j < 0)
4532  {
4533  //not reduceable, try to use this for reducing higher terms
4534  int i2 = fwbw (los, i);
4535  assume (pLmEqual (los[i].p, los[i2].p));
4536  assume ((i2 == 0) || (!pLmEqual (los[i2].p, los[i2 - 1].p)));
4537  assume (i >= i2);
4538  if(i2 != i)
4539  {
4540  erg.to_reduce_u = i - 1;
4541  erg.to_reduce_l = i2;
4542  erg.reduce_by = i;
4543  erg.fromS = FALSE;
4544  assume ((i == losl - 1) || (pLmCmp (los[i].p, los[i + 1].p) == -1));
4545  canonicalize_region (los, erg.to_reduce_u + 1, startf, c);
4546  return;
4547  }
4548  i--;
4549  }
4550  }
4551  erg.reduce_by = -1; //error code
4552  return;
4553 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
int to_reduce_u
Definition: tgb_internal.h:387
#define TRUE
Definition: auxiliary.h:101
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
Definition: tgb.cc:685
BOOLEAN is_valid_ro(red_object &ro)
Definition: tgb.cc:2056
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
int i
Definition: cfEzgcd.cc:123
int int kStrategy strat
Definition: myNF.cc:68
BOOLEAN fromS
Definition: tgb_internal.h:390
int reduce_by
Definition: tgb_internal.h:389
static void canonicalize_region(red_object *los, int l, int u, slimgb_alg *)
Definition: tgb.cc:4483
int to_reduce_l
Definition: tgb_internal.h:388
#define pLmEqual(p1, p2)
Definition: polys.h:111
static int fwbw(red_object *los, int i)
Definition: tgb.cc:4425

§ multi_reduction_lls_trick()

static void multi_reduction_lls_trick ( red_object los,
int  ,
slimgb_alg c,
find_erg erg 
)
static

Definition at line 4165 of file tgb.cc.

4167 {
4168  erg.expand = NULL;
4169  BOOLEAN swap_roles; //from reduce_by, to_reduce_u if fromS
4170  if(erg.fromS)
4171  {
4172  if(pLmEqual (c->strat->S[erg.reduce_by], los[erg.to_reduce_u].p))
4173  {
4174  wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
4175  int best = erg.to_reduce_u + 1;
4176 /*
4177  for (i=erg.to_reduce_u;i>=erg.to_reduce_l;i--)
4178  {
4179  int qc=los[i].guess_quality(c);
4180  if (qc<quality_a)
4181  {
4182  best=i;
4183  quality_a=qc;
4184  }
4185  }
4186  if(best!=erg.to_reduce_u+1)
4187  {*/
4188  wlen_type qc;
4189  best = find_best (los, erg.to_reduce_l, erg.to_reduce_u, qc, c);
4190  if(qc < quality_a)
4191  {
4192  los[best].flatten ();
4193  int b_pos = kBucketCanonicalize (los[best].bucket);
4194  los[best].p = los[best].bucket->buckets[b_pos];
4195  qc = pQuality (los[best].bucket->buckets[b_pos], c);
4196  if(qc < quality_a)
4197  {
4198  red_object h = los[erg.to_reduce_u];
4199  los[erg.to_reduce_u] = los[best];
4200  los[best] = h;
4201  swap_roles = TRUE;
4202  }
4203  else
4204  swap_roles = FALSE;
4205  }
4206  else
4207  {
4208  swap_roles = FALSE;
4209  }
4210  }
4211  else
4212  {
4213  if(erg.to_reduce_u > erg.to_reduce_l)
4214  {
4215  wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
4216 #ifdef HAVE_PLURAL
4217  if((c->nc) && (!(rIsSCA (c->r))))
4218  quality_a =
4220  los[erg.to_reduce_u].p, c);
4221 #endif
4222  int best = erg.to_reduce_u + 1;
4223  wlen_type qc;
4224  best = find_best (los, erg.to_reduce_l, erg.to_reduce_u, qc, c);
4225  assume (qc == los[best].guess_quality (c));
4226  if(qc < quality_a)
4227  {
4228  los[best].flatten ();
4229  int b_pos = kBucketCanonicalize (los[best].bucket);
4230  los[best].p = los[best].bucket->buckets[b_pos];
4231  qc = pQuality (los[best].bucket->buckets[b_pos], c);
4232  //(best!=erg.to_reduce_u+1)
4233  if(qc < quality_a)
4234  {
4235  red_object h = los[erg.to_reduce_u];
4236  los[erg.to_reduce_u] = los[best];
4237  los[best] = h;
4238  erg.reduce_by = erg.to_reduce_u;
4239  erg.fromS = FALSE;
4240  erg.to_reduce_u--;
4241  }
4242  }
4243  }
4244  else
4245  {
4246  assume (erg.to_reduce_u == erg.to_reduce_l);
4247  wlen_type quality_a = quality_of_pos_in_strat_S (erg.reduce_by, c);
4248  wlen_type qc = los[erg.to_reduce_u].guess_quality (c);
4249  if(qc < 0)
4250  PrintS ("Wrong wlen_type");
4251  if(qc < quality_a)
4252  {
4253  int best = erg.to_reduce_u;
4254  los[best].flatten ();
4255  int b_pos = kBucketCanonicalize (los[best].bucket);
4256  los[best].p = los[best].bucket->buckets[b_pos];
4257  qc = pQuality (los[best].bucket->buckets[b_pos], c);
4258  assume (qc >= 0);
4259  if(qc < quality_a)
4260  {
4261  BOOLEAN exp = FALSE;
4262  if(qc <= 2)
4263  {
4264  //Print("\n qc is %lld \n",qc);
4265  exp = TRUE;
4266  }
4267  else
4268  {
4269  if(qc < quality_a / 2)
4270  exp = TRUE;
4271  else if(erg.reduce_by < c->n / 4)
4272  exp = TRUE;
4273  }
4274  if(exp)
4275  {
4276  poly clear_into;
4277  los[erg.to_reduce_u].flatten ();
4278  kBucketClear (los[erg.to_reduce_u].bucket, &clear_into,
4279  &erg.expand_length);
4280  erg.expand = pCopy (clear_into);
4281  kBucketInit (los[erg.to_reduce_u].bucket, clear_into,
4282  erg.expand_length);
4283  if(TEST_OPT_PROT)
4284  PrintS ("e");
4285  }
4286  }
4287  }
4288  }
4289 
4290  swap_roles = FALSE;
4291  return;
4292  }
4293  }
4294  else
4295  {
4296  if(erg.reduce_by > erg.to_reduce_u)
4297  {
4298  //then lm(rb)>= lm(tru) so =
4299  assume (erg.reduce_by == erg.to_reduce_u + 1);
4300  int best = erg.reduce_by;
4301  wlen_type quality_a = los[erg.reduce_by].guess_quality (c);
4302  wlen_type qc;
4303  best = find_best (los, erg.to_reduce_l, erg.to_reduce_u, qc, c);
4304 
4305  if(qc < quality_a)
4306  {
4307  red_object h = los[erg.reduce_by];
4308  los[erg.reduce_by] = los[best];
4309  los[best] = h;
4310  }
4311  swap_roles = FALSE;
4312  return;
4313  }
4314  else
4315  {
4316  assume (!pLmEqual (los[erg.reduce_by].p, los[erg.to_reduce_l].p));
4317  assume (erg.to_reduce_u == erg.to_reduce_l);
4318  //further assume, that reduce_by is the above all other polys
4319  //with same leading term
4320  int il = erg.reduce_by;
4321  wlen_type quality_a = los[erg.reduce_by].guess_quality (c);
4322  wlen_type qc;
4323  while((il > 0) && pLmEqual (los[il - 1].p, los[il].p))
4324  {
4325  il--;
4326  qc = los[il].guess_quality (c);
4327  if(qc < quality_a)
4328  {
4329  quality_a = qc;
4330  erg.reduce_by = il;
4331  }
4332  }
4333  swap_roles = FALSE;
4334  }
4335  }
4336  if(swap_roles)
4337  {
4338  if(TEST_OPT_PROT)
4339  PrintS ("b");
4340  poly clear_into;
4341  int new_length;
4342  int bp = erg.to_reduce_u; //bucket_positon
4343  //kBucketClear(los[bp].bucket,&clear_into,&new_length);
4344  new_length = los[bp].clear_to_poly ();
4345  clear_into = los[bp].p;
4346  poly p = c->strat->S[erg.reduce_by];
4347  int j = erg.reduce_by;
4348  int old_length = c->strat->lenS[j]; // in view of S
4349  los[bp].p = p;
4350  kBucketInit (los[bp].bucket, p, old_length);
4351  wlen_type qal = pQuality (clear_into, c, new_length);
4352  int pos_in_c = -1;
4353  int z;
4354  int new_pos;
4355  new_pos = simple_posInS (c->strat, clear_into, new_length, qal);
4356  assume (new_pos <= j);
4357  for(z = c->n; z; z--)
4358  {
4359  if(p == c->S->m[z - 1])
4360  {
4361  pos_in_c = z - 1;
4362  break;
4363  }
4364  }
4365 
4366  int tdeg_full = -1;
4367  int tdeg = -1;
4368  if(pos_in_c >= 0)
4369  {
4370 #ifdef TGB_RESORT_PAIRS
4371  c->used_b = TRUE;
4372  c->replaced[pos_in_c] = TRUE;
4373 #endif
4374  tdeg = c->T_deg[pos_in_c];
4375  c->S->m[pos_in_c] = clear_into;
4376  c->lengths[pos_in_c] = new_length;
4377  c->weighted_lengths[pos_in_c] = qal;
4378  if(c->gcd_of_terms[pos_in_c] == NULL)
4379  c->gcd_of_terms[pos_in_c] = gcd_of_terms (clear_into, c->r);
4380  if(c->T_deg_full)
4381  tdeg_full = c->T_deg_full[pos_in_c] =
4382  c->pTotaldegree_full (clear_into);
4383  else
4384  tdeg_full = tdeg;
4385  c_S_element_changed_hook (pos_in_c, c);
4386  }
4387  else
4388  {
4389  if(c->eliminationProblem)
4390  {
4391  tdeg_full = c->pTotaldegree_full (clear_into);
4392  tdeg = c->pTotaldegree (clear_into);
4393  }
4394  }
4395  c->strat->S[j] = clear_into;
4396  c->strat->lenS[j] = new_length;
4397 
4398  assume (pLength (clear_into) == new_length);
4399  if(c->strat->lenSw != NULL)
4400  c->strat->lenSw[j] = qal;
4401  if(!rField_is_Zp (c->r))
4402  {
4403  p_Cleardenom (clear_into, c->r); //should be unnecessary
4404  //includes p_Content(clear_into, c->r);
4405  }
4406  else
4407  pNorm (clear_into);
4408 #ifdef FIND_DETERMINISTIC
4409  erg.reduce_by = j;
4410  //resort later see diploma thesis, find_in_S must be deterministic
4411  //during multireduction if spolys are only in the span of the
4412  //input polys
4413 #else
4414  if(new_pos < j)
4415  {
4416  if(c->strat->honey)
4417  c->strat->ecartS[j] = tdeg_full - tdeg;
4418  move_forward_in_S (j, new_pos, c->strat);
4419  erg.reduce_by = new_pos;
4420  }
4421 #endif
4422  }
4423 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:495
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
BOOLEAN honey
Definition: kutil.h:376
static wlen_type quality_of_pos_in_strat_S_mult_high(int pos, poly high, slimgb_alg *c)
Definition: tgb.cc:4151
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
int find_best(red_object *r, int l, int u, wlen_type &w, slimgb_alg *c)
returns position sets w as weight
Definition: tgb.cc:854
#define TEST_OPT_PROT
Definition: options.h:98
wlen_set lenSw
Definition: kutil.h:316
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
wlen_type * weighted_lengths
Definition: tgb_internal.h:230
int expand_length
Definition: tgb_internal.h:386
kBucket_pt bucket
Definition: tgb_internal.h:309
int to_reduce_u
Definition: tgb_internal.h:387
int pTotaldegree_full(poly p)
Definition: tgb_internal.h:294
int * T_deg_full
Definition: tgb_internal.h:234
#define TRUE
Definition: auxiliary.h:101
static void move_forward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1027
int tdeg(poly p)
Definition: walkSupport.cc:38
static int pLength(poly a)
Definition: p_polys.h:189
static wlen_type quality_of_pos_in_strat_S(int pos, slimgb_alg *c)
Definition: tgb.cc:4142
BOOLEAN nc
Definition: tgb_internal.h:282
int j
Definition: myNF.cc:70
poly expand
Definition: tgb_internal.h:385
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
P bucket
Definition: myNF.cc:79
void PrintS(const char *s)
Definition: reporter.cc:284
polyset S
Definition: kutil.h:302
wlen_type guess_quality(slimgb_alg *c)
Definition: tgb.cc:591
intset lenS
Definition: kutil.h:315
static void c_S_element_changed_hook(int pos, slimgb_alg *c)
Definition: tgb.cc:1971
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
intset ecartS
Definition: kutil.h:305
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
static poly gcd_of_terms(poly p, ring r)
Definition: tgb.cc:4021
int * lengths
Definition: tgb_internal.h:229
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:346
BOOLEAN eliminationProblem
Definition: tgb_internal.h:280
static bool rIsSCA(const ring r)
Definition: nc.h:206
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
p exp[i]
Definition: DebugPrint.cc:39
BOOLEAN fromS
Definition: tgb_internal.h:390
int clear_to_poly()
Definition: tgb.cc:4865
void flatten()
Definition: tgb.cc:4853
int reduce_by
Definition: tgb_internal.h:389
polyrec * poly
Definition: hilb.h:10
int to_reduce_l
Definition: tgb_internal.h:388
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
int kBucketCanonicalize(kBucket_pt bucket)
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2716
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544
#define pLmEqual(p1, p2)
Definition: polys.h:111
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168

§ now_t_rep()

void now_t_rep ( const int &  arg_i,
const int &  arg_j,
slimgb_alg c 
)

Definition at line 3661 of file tgb.cc.

3662 {
3663  int i, j;
3664  if(arg_i == arg_j)
3665  {
3666  return;
3667  }
3668  if(arg_i > arg_j)
3669  {
3670  i = arg_j;
3671  j = arg_i;
3672  }
3673  else
3674  {
3675  i = arg_i;
3676  j = arg_j;
3677  }
3678  c->states[j][i] = HASTREP;
3679 }
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
char ** states
Definition: tgb_internal.h:221

§ p_Init_Special()

static poly p_Init_Special ( const ring  r)
inlinestatic

Definition at line 137 of file tgb.cc.

138 {
139  return p_Init (r, lm_bin);
140 }
const ring r
Definition: syzextra.cc:208
static omBin lm_bin
Definition: tgb.cc:41
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1243

§ pair_better()

static BOOLEAN pair_better ( sorted_pair_node a,
sorted_pair_node b,
slimgb_alg c = NULL 
)
static

Definition at line 3962 of file tgb.cc.

3963 {
3964  if(a->deg < b->deg)
3965  return TRUE;
3966  if(a->deg > b->deg)
3967  return FALSE;
3968 
3969  int comp = pLmCmp (a->lcm_of_lm, b->lcm_of_lm);
3970  if(comp == 1)
3971  return FALSE;
3972  if(-1 == comp)
3973  return TRUE;
3974  if(a->expected_length < b->expected_length)
3975  return TRUE;
3976  if(a->expected_length > b->expected_length)
3977  return FALSE;
3978  if(a->i + a->j < b->i + b->j)
3979  return TRUE;
3980  if(a->i + a->j > b->i + b->j)
3981  return FALSE;
3982  if(a->i < b->i)
3983  return TRUE;
3984  if(a->i > b->i)
3985  return FALSE;
3986  return TRUE;
3987 }
#define FALSE
Definition: auxiliary.h:97
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
#define TRUE
Definition: auxiliary.h:101
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
wlen_type expected_length
Definition: tgb_internal.h:158

§ pair_weighted_length()

static wlen_type pair_weighted_length ( int  i,
int  j,
slimgb_alg c 
)
static

Definition at line 1373 of file tgb.cc.

1374 {
1375  if((c->isDifficultField) && (c->eliminationProblem))
1376  {
1377  int c1 = slim_nsize (p_GetCoeff (c->S->m[i], c->r), c->r);
1378  int c2 = slim_nsize (p_GetCoeff (c->S->m[j], c->r), c->r);
1379  wlen_type el1 = c->weighted_lengths[i] / c1;
1380  assume (el1 != 0);
1381  assume (c->weighted_lengths[i] % c1 == 0);
1382  wlen_type el2 = c->weighted_lengths[j] / c2;
1383  assume (el2 != 0);
1384  //assume (c->weighted_lengths[j] % c2 == 0); // fails in Tst/Plural/dmod_lib.tst
1385  //should be * for function fields
1386  //return (c1+c2) * (el1+el2-2);
1387  wlen_type res = coeff_mult_size_estimate (c1, c2, c->r);
1388  res *= el1 + el2 - 2;
1389  return res;
1390 
1391  }
1392  if(c->isDifficultField)
1393  {
1394  //int cs=slim_nsize(p_GetCoeff(c->S->m[i],c->r),c->r)+
1395  // slim_nsize(p_GetCoeff(c->S->m[j],c->r),c->r);
1396  if(!(TEST_V_COEFSTRAT))
1397  {
1398  wlen_type cs =
1400  (p_GetCoeff (c->S->m[i], c->r), c->r),
1401  slim_nsize (p_GetCoeff (c->S->m[j], c->r),
1402  c->r), c->r);
1403  return (wlen_type) (c->lengths[i] + c->lengths[j] - 2) * (wlen_type) cs;
1404  }
1405  else
1406  {
1407 
1408  wlen_type cs =
1410  (p_GetCoeff (c->S->m[i], c->r), c->r),
1411  slim_nsize (p_GetCoeff (c->S->m[j], c->r),
1412  c->r), c->r);
1413  cs *= cs;
1414  return (wlen_type) (c->lengths[i] + c->lengths[j] - 2) * (wlen_type) cs;
1415  }
1416  }
1417  if(c->eliminationProblem)
1418  {
1419 
1420  return (c->weighted_lengths[i] + c->weighted_lengths[j] - 2);
1421  }
1422  return c->lengths[i] + c->lengths[j] - 2;
1423 
1424 }
wlen_type * weighted_lengths
Definition: tgb_internal.h:230
static wlen_type coeff_mult_size_estimate(int s1, int s2, ring r)
Definition: tgb.cc:1365
poly res
Definition: myNF.cc:322
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
BOOLEAN isDifficultField
Definition: tgb_internal.h:276
int i
Definition: cfEzgcd.cc:123
#define TEST_V_COEFSTRAT
Definition: options.h:132
int64 wlen_type
Definition: kutil.h:56
int * lengths
Definition: tgb_internal.h:229
BOOLEAN eliminationProblem
Definition: tgb_internal.h:280
#define p_GetCoeff(p, r)
Definition: monomials.h:57
int slim_nsize(number n, ring r)
Definition: tgb.cc:73

§ pELength() [1/2]

wlen_type pELength ( poly  p,
slimgb_alg c,
ring   
)

Definition at line 471 of file tgb.cc.

472 {
473  if(p == NULL)
474  return 0;
475  wlen_type s = 0;
476  poly pi = p;
477  int dlm;
478  dlm = c->pTotaldegree (p);
479  s = 1;
480  pi = p->next;
481 
482  while(pi)
483  {
484  int d = c->pTotaldegree (pi);
485  if(d > dlm)
486  s += 1 + d - dlm;
487  else
488  ++s;
489  pi = pi->next;
490  }
491  return s;
492 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
return P p
Definition: myNF.cc:203
#define pi
Definition: libparse.cc:1143
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
polyrec * poly
Definition: hilb.h:10

§ pELength() [2/2]

static int pELength ( poly  p,
slimgb_alg c,
int  l 
)
inlinestatic

Definition at line 535 of file tgb.cc.

536 {
537  if(p == NULL)
538  return 0;
539  if((l > 0) && (elength_is_normal_length (p, c)))
540  return l;
541  return do_pELength (p, c);
542 }
return P p
Definition: myNF.cc:203
static BOOLEAN elength_is_normal_length(poly p, slimgb_alg *c)
Definition: tgb.cc:371
static wlen_type do_pELength(poly p, slimgb_alg *c, int dlm=-1)
Definition: tgb.cc:446
#define NULL
Definition: omList.c:10
int l
Definition: cfEzgcd.cc:94

§ pHasNotCFExtended()

static BOOLEAN pHasNotCFExtended ( poly  p1,
poly  p2,
poly  m 
)
inlinestatic

Definition at line 4061 of file tgb.cc.

4062 {
4063 
4064  if(pGetComp (p1) > 0 || pGetComp (p2) > 0)
4065  return FALSE;
4066  int i = 1;
4067  loop
4068  {
4069  if((pGetExp (p1, i) - pGetExp (m, i) > 0)
4070  && (pGetExp (p2, i) - pGetExp (m, i) > 0))
4071  return FALSE;
4072  if(i == (currRing->N))
4073  return TRUE;
4074  i++;
4075  }
4076 }
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#define pGetComp(p)
Component.
Definition: polys.h:37
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
END_NAMESPACE const void * p2
Definition: syzextra.cc:202

§ poly_crit()

static int poly_crit ( const void *  ap1,
const void *  ap2 
)
static

Definition at line 3121 of file tgb.cc.

3122 {
3123  poly p1, p2;
3124  p1 = *((poly *) ap1);
3125  p2 = *((poly *) ap2);
3126 
3127  int c = pLmCmp (p1, p2);
3128  if(c != 0)
3129  return c;
3130  int l1 = pLength (p1);
3131  int l2 = pLength (p2);
3132  if(l1 < l2)
3133  return -1;
3134  if(l1 > l2)
3135  return 1;
3136  return 0;
3137 }
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
static int pLength(poly a)
Definition: p_polys.h:189
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
polyrec * poly
Definition: hilb.h:10

§ polynomial_root()

static BOOLEAN polynomial_root ( poly  h,
ring  r 
)
static

Definition at line 109 of file tgb.cc.

110 {
111  poly got = gcd_of_terms (h, r);
112  BOOLEAN changed = FALSE;
113  if((got != NULL) && (TEST_V_UPTORADICAL))
114  {
115  poly copy = p_Copy (got, r);
116  //p_wrp(got,c->r);
117  changed = monomial_root (got, r);
118  if(changed)
119  {
120  poly div_by = pDivide (copy, got);
121  poly iter = h;
122  while(iter)
123  {
124  pExpVectorSub (iter, div_by);
125  pIter (iter);
126  }
127  p_Delete (&div_by, r);
128  if(TEST_OPT_PROT)
129  PrintS ("U");
130  }
131  p_Delete (&copy, r);
132  }
133  p_Delete (&got, r);
134  return changed;
135 }
#define pDivide(a, b)
Definition: polys.h:276
CFArray copy(const CFList &list)
write elements of list into an array
#define TEST_OPT_PROT
Definition: options.h:98
#define FALSE
Definition: auxiliary.h:97
CFFListIterator iter
Definition: facAbsBiFact.cc:54
#define pExpVectorSub(p1, p2)
Definition: polys.h:88
static BOOLEAN monomial_root(poly m, ring r)
Definition: tgb.cc:89
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
void PrintS(const char *s)
Definition: reporter.cc:284
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
#define NULL
Definition: omList.c:10
static poly gcd_of_terms(poly p, ring r)
Definition: tgb.cc:4021
#define TEST_V_UPTORADICAL
Definition: options.h:133
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88

§ pOne_Special()

static poly pOne_Special ( const ring  r = currRing)
inlinestatic

Definition at line 142 of file tgb.cc.

143 {
144  poly rc = p_Init_Special (r);
145  pSetCoeff0 (rc, n_Init (1, r));
146  return rc;
147 }
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:542
const ring r
Definition: syzextra.cc:208
static poly p_Init_Special(const ring r)
Definition: tgb.cc:137
#define pSetCoeff0(p, n)
Definition: monomials.h:67
polyrec * poly
Definition: hilb.h:10

§ posInPairs()

static int posInPairs ( sorted_pair_node **  p,
int  pn,
sorted_pair_node qe,
slimgb_alg c,
int  an = 0 
)
static

Definition at line 711 of file tgb.cc.

713 {
714  if(pn == 0)
715  return 0;
716 
717  int length = pn - 1;
718  int i;
719  //int an = 0;
720  int en = length;
721 
722  if(pair_better (qe, p[en], c))
723  return length + 1;
724 
725  while(1)
726  {
727  //if (an >= en-1)
728  if(en - 1 <= an)
729  {
730  if(pair_better (p[an], qe, c))
731  return an;
732  return en;
733  }
734  i = (an + en) / 2;
735  if(pair_better (p[i], qe, c))
736  en = i;
737  else
738  an = i;
739  }
740 }
int i
Definition: cfEzgcd.cc:123
static BOOLEAN pair_better(sorted_pair_node *a, sorted_pair_node *b, slimgb_alg *c=NULL)
Definition: tgb.cc:3962

§ pQuality()

static wlen_type pQuality ( poly  p,
slimgb_alg c,
int  l = -1 
)
inlinestatic

Definition at line 544 of file tgb.cc.

545 {
546  if(l < 0)
547  l = pLength (p);
548  if(c->isDifficultField)
549  {
550  if(c->eliminationProblem)
551  {
552  wlen_type cs;
553  number coef = pGetCoeff (p);
554  if(rField_is_Q (currRing))
555  {
556  cs = nlQlogSize (coef, currRing->cf);
557  }
558  else
559  cs = nSize (coef);
560  wlen_type erg = cs;
561  if(TEST_V_COEFSTRAT)
562  erg *= cs;
563  //erg*=cs;//for quadratic
564  erg *= pELength (p, c, l);
565  //FIXME: not quadratic coeff size
566  //return cs*pELength(p,c,l);
567  return erg;
568  }
569  //PrintS("I am here");
570  wlen_type r = pSLength (p, l);
571  assume (r >= 0);
572  return r;
573  }
574  if(c->eliminationProblem)
575  return pELength (p, c, l);
576  return l;
577 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE int nlQlogSize(number n, const coeffs r)
only used by slimgb (tgb.cc)
Definition: longrat.h:77
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static int pLength(poly a)
Definition: p_polys.h:189
static wlen_type pSLength(poly p, int l)
Definition: tgb.cc:197
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
BOOLEAN isDifficultField
Definition: tgb_internal.h:276
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
#define TEST_V_COEFSTRAT
Definition: options.h:132
wlen_type pELength(poly p, slimgb_alg *c, ring)
Definition: tgb.cc:471
int64 wlen_type
Definition: kutil.h:56
#define nSize(n)
Definition: numbers.h:39
BOOLEAN eliminationProblem
Definition: tgb_internal.h:280
int l
Definition: cfEzgcd.cc:94

§ pSLength()

static wlen_type pSLength ( poly  p,
int  l 
)
inlinestatic

Definition at line 197 of file tgb.cc.

198 {
199  wlen_type c;
200  number coef = pGetCoeff (p);
201  if(rField_is_Q (currRing))
202  {
203  c = nlQlogSize (coef, currRing->cf);
204  }
205  else
206  c = nSize (coef);
207  if(!(TEST_V_COEFSTRAT))
208  {
209  return (wlen_type) c *(wlen_type) l /*pLength(p) */ ;
210  }
211  else
212  {
213  wlen_type res = l;
214  res *= c;
215  res *= c;
216  return res;
217  }
218 }
return P p
Definition: myNF.cc:203
static FORCE_INLINE int nlQlogSize(number n, const coeffs r)
only used by slimgb (tgb.cc)
Definition: longrat.h:77
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
#define TEST_V_COEFSTRAT
Definition: options.h:132
int64 wlen_type
Definition: kutil.h:56
#define nSize(n)
Definition: numbers.h:39
int l
Definition: cfEzgcd.cc:94

§ pTotaldegree_full()

static int pTotaldegree_full ( poly  p)
inlinestatic

Definition at line 579 of file tgb.cc.

580 {
581  int r = 0;
582  while(p)
583  {
584  int d = pTotaldegree (p);
585  r = si_max (r, d);
586  pIter (p);
587  }
588  return r;
589 }
return P p
Definition: myNF.cc:203
#define pIter(p)
Definition: monomials.h:44
const ring r
Definition: syzextra.cc:208
static long pTotaldegree(poly p)
Definition: polys.h:265
static int si_max(const int a, const int b)
Definition: auxiliary.h:123

§ quality_of_pos_in_strat_S()

static wlen_type quality_of_pos_in_strat_S ( int  pos,
slimgb_alg c 
)
inlinestatic

Definition at line 4142 of file tgb.cc.

4143 {
4144  if(c->strat->lenSw != NULL)
4145  return c->strat->lenSw[pos];
4146  return c->strat->lenS[pos];
4147 }
wlen_set lenSw
Definition: kutil.h:316
kStrategy strat
Definition: tgb_internal.h:232
intset lenS
Definition: kutil.h:315
#define NULL
Definition: omList.c:10

§ quality_of_pos_in_strat_S_mult_high()

static wlen_type quality_of_pos_in_strat_S_mult_high ( int  pos,
poly  high,
slimgb_alg c 
)
inlinestatic

Definition at line 4151 of file tgb.cc.

4153 {
4154  poly m = pOne ();
4155  pExpVectorDiff (m, high, c->strat->S[pos]);
4156  poly product = nc_mm_Mult_pp (m, c->strat->S[pos], c->r);
4157  wlen_type erg = pQuality (product, c);
4158  pDelete (&m);
4159  pDelete (&product);
4160  return erg;
4161 }
#define pExpVectorDiff(pr, p1, p2)
Definition: polys.h:91
kStrategy strat
Definition: tgb_internal.h:232
int m
Definition: cfEzgcd.cc:119
#define pOne()
Definition: polys.h:298
polyset S
Definition: kutil.h:302
int64 wlen_type
Definition: kutil.h:56
#define pDelete(p_ptr)
Definition: polys.h:169
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
Definition: nc.h:240
polyrec * poly
Definition: hilb.h:10
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544

§ quick_pop_pair()

sorted_pair_node* quick_pop_pair ( slimgb_alg c)

Definition at line 3900 of file tgb.cc.

3901 {
3902  if(c->pair_top < 0)
3903  return NULL;
3904  else
3905  return (c->apairs[c->pair_top--]);
3906 }
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
#define NULL
Definition: omList.c:10

§ red_object_better_gen()

static int red_object_better_gen ( const void *  ap,
const void *  bp 
)
static

Definition at line 665 of file tgb.cc.

666 {
667  return (pLmCmp (((red_object *) ap)->p, ((red_object *) bp)->p));
668 }
return P p
Definition: myNF.cc:203
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105

§ redNF2()

static poly redNF2 ( poly  h,
slimgb_alg c,
int &  len,
number &  m,
int  n = 0 
)
static

Definition at line 1837 of file tgb.cc.

1838 {
1839  m = nInit (1);
1840  if(h == NULL)
1841  return NULL;
1842 
1843  assume (len == pLength (h));
1844  kStrategy strat = c->strat;
1845  if(0 > strat->sl)
1846  {
1847  return h;
1848  }
1849  int j;
1850 
1851  LObject P (h);
1852  P.SetShortExpVector ();
1853  P.bucket = kBucketCreate (currRing);
1854  // BOOLEAN corr=lenS_correct(strat);
1855  kBucketInit (P.bucket, P.p, len /*pLength(P.p) */ );
1856  //wlen_set lenSw=(wlen_set) c->strat->lenS;
1857  //FIXME: plainly wrong
1858  //strat->lenS;
1859  //if (strat->lenSw!=NULL)
1860  // lenSw=strat->lenSw;
1861  //int max_pos=simple_posInS(strat,P.p);
1862  loop
1863  {
1864  //int dummy=strat->sl;
1865  j = kFindDivisibleByInS_easy (strat, P.p, P.sev);
1866  //j=kFindDivisibleByInS(strat,&dummy,&P);
1867  if((j >= 0) && ((!n) ||
1868  ((strat->lenS[j] <= n) &&
1869  ((strat->lenSw == NULL) || (strat->lenSw[j] <= n)))))
1870  {
1871  nNormalize (pGetCoeff (P.p));
1872 #ifdef KDEBUG
1873  if(TEST_OPT_DEBUG)
1874  {
1875  PrintS ("red:");
1876  wrp (h);
1877  PrintS (" with ");
1878  wrp (strat->S[j]);
1879  }
1880 #endif
1881 
1882  number coef = kBucketPolyRed (P.bucket, strat->S[j],
1883  strat->lenS[j] /*pLength(strat->S[j]) */ ,
1884  strat->kNoether);
1885  number m2 = nMult (m, coef);
1886  nDelete (&m);
1887  m = m2;
1888  nDelete (&coef);
1889  h = kBucketGetLm (P.bucket);
1890 
1891  if(h == NULL)
1892  {
1893  len = 0;
1894  kBucketDestroy (&P.bucket);
1895  return NULL;
1896  }
1897  P.p = h;
1898  P.t_p = NULL;
1899  P.SetShortExpVector ();
1900 #ifdef KDEBUG
1901  if(TEST_OPT_DEBUG)
1902  {
1903  PrintS ("\nto:");
1904  wrp (h);
1905  PrintLn ();
1906  }
1907 #endif
1908  }
1909  else
1910  {
1911  kBucketClear (P.bucket, &(P.p), &len);
1912  kBucketDestroy (&P.bucket);
1913  pNormalize (P.p);
1914  assume (len == (pLength (P.p)));
1915  return P.p;
1916  }
1917  }
1918 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:495
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
void PrintLn()
Definition: reporter.cc:310
class sLObject LObject
Definition: kutil.h:60
#define nNormalize(n)
Definition: numbers.h:30
wlen_set lenSw
Definition: kutil.h:316
loop
Definition: myNF.cc:98
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
Definition: kbuckets.cc:1053
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
poly kNoether
Definition: kutil.h:326
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
Definition: tgb.cc:685
#define TEST_OPT_DEBUG
Definition: options.h:103
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static int pLength(poly a)
Definition: p_polys.h:189
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
#define nMult(n1, n2)
Definition: numbers.h:17
pNormalize(P.p)
int m
Definition: cfEzgcd.cc:119
void PrintS(const char *s)
Definition: reporter.cc:284
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
#define nDelete(n)
Definition: numbers.h:16
int int kStrategy strat
Definition: myNF.cc:68
#define NULL
Definition: omList.c:10
int sl
Definition: kutil.h:346
void wrp(poly p)
Definition: polys.h:293
kBucketDestroy & P
Definition: myNF.cc:191
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
#define nInit(i)
Definition: numbers.h:24
static Poly * h
Definition: janet.cc:978

§ redNFTail()

static poly redNFTail ( poly  h,
const int  sl,
kStrategy  strat,
int  len 
)
static

Definition at line 2972 of file tgb.cc.

2973 {
2975  if(h == NULL)
2976  return NULL;
2977  pTest (h);
2978  if(0 > sl)
2979  return h;
2980  if(pNext (h) == NULL)
2981  return h;
2982 
2983  int j;
2984  poly res = h;
2985  poly act = res;
2986  LObject P (pNext (h));
2987  pNext (res) = NULL;
2988  P.bucket = kBucketCreate (currRing);
2989  len--;
2990  h = P.p;
2991  if(len <= 0)
2992  len = pLength (h);
2993  kBucketInit (P.bucket, h /*P.p */ , len /*pLength(P.p) */ );
2994  pTest (h);
2995  loop
2996  {
2997  P.p = h;
2998  P.t_p = NULL;
2999  P.SetShortExpVector ();
3000  loop
3001  {
3002  //int dummy=strat->sl;
3003  j = kFindDivisibleByInS_easy (strat, P.p, P.sev); //kFindDivisibleByInS(strat,&dummy,&P);
3004  if(j >= 0)
3005  {
3006 #ifdef REDTAIL_PROT
3007  PrintS ("r");
3008 #endif
3009  nNormalize (pGetCoeff (P.p));
3010 #ifdef KDEBUG
3011  if(TEST_OPT_DEBUG)
3012  {
3013  PrintS ("red tail:");
3014  wrp (h);
3015  PrintS (" with ");
3016  wrp (strat->S[j]);
3017  }
3018 #endif
3019  number coef;
3020  pTest (strat->S[j]);
3021 #ifdef HAVE_PLURAL
3022  if(nc)
3023  {
3024  nc_BucketPolyRed_Z (P.bucket, strat->S[j], &coef);
3025  }
3026  else
3027 #endif
3028  coef = kBucketPolyRed (P.bucket, strat->S[j],
3029  strat->lenS[j] /*pLength(strat->S[j]) */ ,
3030  strat->kNoether);
3031  pMult_nn (res, coef);
3032  nDelete (&coef);
3033  h = kBucketGetLm (P.bucket);
3034  pTest (h);
3035  if(h == NULL)
3036  {
3037 #ifdef REDTAIL_PROT
3038  PrintS (" ");
3039 #endif
3040  kBucketDestroy (&P.bucket);
3041  return res;
3042  }
3043  pTest (h);
3044  P.p = h;
3045  P.t_p = NULL;
3046  P.SetShortExpVector ();
3047 #ifdef KDEBUG
3048  if(TEST_OPT_DEBUG)
3049  {
3050  PrintS ("\nto tail:");
3051  wrp (h);
3052  PrintLn ();
3053  }
3054 #endif
3055  }
3056  else
3057  {
3058 #ifdef REDTAIL_PROT
3059  PrintS ("n");
3060 #endif
3061  break;
3062  }
3063  } /* end loop current mon */
3064  // poly tmp=pHead(h /*kBucketGetLm(P.bucket)*/);
3065  //act->next=tmp;pIter(act);
3066  act->next = kBucketExtractLm (P.bucket);
3067  pIter (act);
3068  h = kBucketGetLm (P.bucket);
3069  if(h == NULL)
3070  {
3071 #ifdef REDTAIL_PROT
3072  PrintS (" ");
3073 #endif
3074  kBucketDestroy (&P.bucket);
3075  return res;
3076  }
3077  pTest (h);
3078  }
3079 }
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
void PrintLn()
Definition: reporter.cc:310
class sLObject LObject
Definition: kutil.h:60
#define nNormalize(n)
Definition: numbers.h:30
loop
Definition: myNF.cc:98
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
Definition: kbuckets.cc:1053
#define pTest(p)
Definition: polys.h:399
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
poly kNoether
Definition: kutil.h:326
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
Definition: tgb.cc:685
#define TEST_OPT_DEBUG
Definition: options.h:103
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
static int pLength(poly a)
Definition: p_polys.h:189
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:485
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
int j
Definition: myNF.cc:70
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define pMult_nn(p, n)
Definition: polys.h:183
void PrintS(const char *s)
Definition: reporter.cc:284
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
#define nDelete(n)
Definition: numbers.h:16
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
static scmon act
Definition: hdegree.cc:1078
void wrp(poly p)
Definition: polys.h:293
kBucketDestroy & P
Definition: myNF.cc:191
polyrec * poly
Definition: hilb.h:10
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
static void nc_BucketPolyRed_Z(kBucket_pt b, poly p, number *c)
Definition: nc.h:303

§ redTailShort()

static poly redTailShort ( poly  h,
kStrategy  strat 
)
static

Definition at line 1920 of file tgb.cc.

1921 {
1922  if(h == NULL)
1923  return NULL; //n_Init(1,currRing);
1924  if(TEST_V_MODPSOLVSB)
1925  {
1926  bit_reduce (pNext (h), strat->tailRing);
1927  }
1928  int i;
1929  int len = pLength (h);
1930  for(i = 0; i <= strat->sl; i++)
1931  {
1932  if((strat->lenS[i] > 2)
1933  || ((strat->lenSw != NULL) && (strat->lenSw[i] > 2)))
1934  break;
1935  }
1936  return (redNFTail (h, i - 1, strat, len));
1937 }
wlen_set lenSw
Definition: kutil.h:316
static int pLength(poly a)
Definition: p_polys.h:189
void bit_reduce(poly &f, ring r)
Definition: digitech.cc:15
static poly redNFTail(poly h, const int sl, kStrategy strat, int len)
Definition: tgb.cc:2972
int i
Definition: cfEzgcd.cc:123
intset lenS
Definition: kutil.h:315
#define TEST_V_MODPSOLVSB
Definition: options.h:131
#define NULL
Definition: omList.c:10
ring tailRing
Definition: kutil.h:341
#define pNext(p)
Definition: monomials.h:43
int sl
Definition: kutil.h:346
static Poly * h
Definition: janet.cc:978

§ replace_pair()

static void replace_pair ( int &  i,
int &  j,
slimgb_alg c 
)
static

Definition at line 1215 of file tgb.cc.

1216 {
1217  if(i < 0)
1218  return;
1219  c->soon_free = NULL;
1220  int syz_deg;
1221  poly lm = pOne ();
1222 
1223  pLcm (c->S->m[i], c->S->m[j], lm);
1224  pSetm (lm);
1225 
1226  int *i_con = make_connections (i, j, lm, c);
1227 
1228  for(int n = 0; ((n < c->n) && (i_con[n] >= 0)); n++)
1229  {
1230  if(i_con[n] == j)
1231  {
1232  now_t_rep (i, j, c);
1233  omFree (i_con);
1234  p_Delete (&lm, c->r);
1235  return;
1236  }
1237  }
1238 
1239  int *j_con = make_connections (j, i, lm, c);
1240 
1241 // if(c->n>1)
1242 // {
1243 // if (i_con[1]>=0)
1244 // i=i_con[1];
1245 // else
1246 // {
1247 // if (j_con[1]>=0)
1248 // j=j_con[1];
1249 // }
1250  // }
1251 
1252  int sugar = syz_deg = c->pTotaldegree (lm);
1253 
1254  p_Delete (&lm, c->r);
1255  if(c->T_deg_full) //Sugar
1256  {
1257  int t_i = c->T_deg_full[i] - c->T_deg[i];
1258  int t_j = c->T_deg_full[j] - c->T_deg[j];
1259  sugar += si_max (t_i, t_j);
1260  //Print("\n max: %d\n",max(t_i,t_j));
1261  }
1262 
1263  for(int m = 0; ((m < c->n) && (i_con[m] >= 0)); m++)
1264  {
1265  if(c->T_deg_full != NULL)
1266  {
1267  int s1 = c->T_deg_full[i_con[m]] + syz_deg - c->T_deg[i_con[m]];
1268  if(s1 > sugar)
1269  continue;
1270  }
1271  if(c->weighted_lengths[i_con[m]] < c->weighted_lengths[i])
1272  i = i_con[m];
1273  }
1274  for(int m = 0; ((m < c->n) && (j_con[m] >= 0)); m++)
1275  {
1276  if(c->T_deg_full != NULL)
1277  {
1278  int s1 = c->T_deg_full[j_con[m]] + syz_deg - c->T_deg[j_con[m]];
1279  if(s1 > sugar)
1280  continue;
1281  }
1282  if(c->weighted_lengths[j_con[m]] < c->weighted_lengths[j])
1283  j = j_con[m];
1284  }
1285 
1286  //can also try dependend search
1287  omfree (i_con);
1288  omfree (j_con);
1289  return;
1290 }
unsigned long pTotaldegree(poly p)
Definition: tgb_internal.h:286
#define pSetm(p)
Definition: polys.h:253
wlen_type * weighted_lengths
Definition: tgb_internal.h:230
int * T_deg_full
Definition: tgb_internal.h:234
#define pLcm(a, b, m)
Definition: polys.h:278
int_pair_node * soon_free
Definition: tgb_internal.h:240
static int * make_connections(int from, int to, poly bound, slimgb_alg *c)
Definition: tgb.cc:1101
int j
Definition: myNF.cc:70
#define omFree(addr)
Definition: omAllocDecl.h:261
#define omfree(addr)
Definition: omAllocDecl.h:237
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
int i
Definition: cfEzgcd.cc:123
#define pOne()
Definition: polys.h:298
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
Definition: tgb.cc:3661

§ search_red_object_pos()

int search_red_object_pos ( red_object a,
int  top,
red_object key 
)

Definition at line 4589 of file tgb.cc.

4590 {
4591  int an = 0;
4592  int en = top;
4593  if(top == -1)
4594  return 0;
4595  if(pLmCmp (key->p, a[top].p) == 1)
4596  return top + 1;
4597  int i;
4598  loop
4599  {
4600  if(an >= en - 1)
4601  {
4602  if(pLmCmp (key->p, a[an].p) == -1)
4603  return an;
4604  return en;
4605  }
4606  i = (an + en) / 2;
4607  if(pLmCmp (key->p, a[i].p) == -1)
4608  en = i;
4609  else
4610  an = i;
4611  }
4612 }
loop
Definition: myNF.cc:98
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
int i
Definition: cfEzgcd.cc:123

§ shorten_tails()

static void shorten_tails ( slimgb_alg c,
poly  monom 
)
static

Definition at line 3715 of file tgb.cc.

3716 {
3717  return;
3718 // BOOLEAN corr=lenS_correct(c->strat);
3719  for(int i = 0; i < c->n; i++)
3720  {
3721  //enter tail
3722 
3723  if(c->S->m[i] == NULL)
3724  continue;
3725  poly tail = c->S->m[i]->next;
3726  poly prev = c->S->m[i];
3727  BOOLEAN did_something = FALSE;
3728  while((tail != NULL) && (pLmCmp (tail, monom) >= 0))
3729  {
3730  if(p_LmDivisibleBy (monom, tail, c->r))
3731  {
3732  did_something = TRUE;
3733  prev->next = tail->next;
3734  tail->next = NULL;
3735  p_Delete (&tail, c->r);
3736  tail = prev;
3737  //PrintS("Shortened");
3738  c->lengths[i]--;
3739  }
3740  prev = tail;
3741  tail = tail->next;
3742  }
3743  if(did_something)
3744  {
3745  int new_pos;
3746  wlen_type q;
3747  q = pQuality (c->S->m[i], c, c->lengths[i]);
3748  new_pos = simple_posInS (c->strat, c->S->m[i], c->lengths[i], q);
3749 
3750  int old_pos = -1;
3751  //assume new_pos<old_pos
3752  for(int z = 0; z <= c->strat->sl; z++)
3753  {
3754  if(c->strat->S[z] == c->S->m[i])
3755  {
3756  old_pos = z;
3757  break;
3758  }
3759  }
3760  if(old_pos == -1)
3761  for(int z = new_pos - 1; z >= 0; z--)
3762  {
3763  if(c->strat->S[z] == c->S->m[i])
3764  {
3765  old_pos = z;
3766  break;
3767  }
3768  }
3769  assume (old_pos >= 0);
3770  assume (new_pos <= old_pos);
3771  assume (pLength (c->strat->S[old_pos]) == c->lengths[i]);
3772  c->strat->lenS[old_pos] = c->lengths[i];
3773  if(c->strat->lenSw)
3774  c->strat->lenSw[old_pos] = q;
3775  if(new_pos < old_pos)
3776  move_forward_in_S (old_pos, new_pos, c->strat);
3777  length_one_crit (c, i, c->lengths[i]);
3778  }
3779  }
3780 }
wlen_set lenSw
Definition: kutil.h:316
#define FALSE
Definition: auxiliary.h:97
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
#define TRUE
Definition: auxiliary.h:101
static void move_forward_in_S(int old_pos, int new_pos, kStrategy strat)
Definition: tgb.cc:1027
static int pLength(poly a)
Definition: p_polys.h:189
#define assume(x)
Definition: mod2.h:403
kStrategy strat
Definition: tgb_internal.h:232
int i
Definition: cfEzgcd.cc:123
polyset S
Definition: kutil.h:302
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
Definition: p_polys.h:1768
static void length_one_crit(slimgb_alg *c, int pos, int len)
Definition: tgb.cc:1005
intset lenS
Definition: kutil.h:315
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
#define NULL
Definition: omList.c:10
int64 wlen_type
Definition: kutil.h:56
int * lengths
Definition: tgb_internal.h:229
static int simple_posInS(kStrategy strat, poly p, int len, wlen_type wlen)
Definition: tgb.cc:1308
int sl
Definition: kutil.h:346
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:88
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
Definition: tgb.cc:544

§ simple_posInS()

static int simple_posInS ( kStrategy  strat,
poly  p,
int  len,
wlen_type  wlen 
)
static

Definition at line 1308 of file tgb.cc.

1309 {
1310  if(strat->sl == -1)
1311  return 0;
1312  if(strat->lenSw)
1313  return pos_helper (strat, p, (wlen_type) wlen, (wlen_set) strat->lenSw,
1314  strat->S);
1315  return pos_helper (strat, p, len, strat->lenS, strat->S);
1316 }
wlen_set lenSw
Definition: kutil.h:316
return P p
Definition: myNF.cc:203
int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set)
Definition: tgb_internal.h:394
polyset S
Definition: kutil.h:302
intset lenS
Definition: kutil.h:315
int64 wlen_type
Definition: kutil.h:56
int sl
Definition: kutil.h:346
wlen_type * wlen_set
Definition: kutil.h:57

§ simplify_poly()

static void simplify_poly ( poly  p,
ring  r 
)
static

Definition at line 59 of file tgb.cc.

60 {
61  assume (r == currRing);
62  if(!rField_is_Zp (r))
63  {
64  p_Cleardenom (p, r);
65  //includes p_Content(p,r);
66  }
67  else
68  pNorm (p);
69 }
return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:346
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2716

§ slim_nsize()

int slim_nsize ( number  n,
ring  r 
)

Definition at line 73 of file tgb.cc.

74 {
75  if(rField_is_Zp (r))
76  {
77  return 1;
78  }
79  if(rField_is_Q (r))
80  {
81  return nlQlogSize (n, r->cf);
82  }
83  else
84  {
85  return n_Size (n, r);
86  }
87 }
static FORCE_INLINE int nlQlogSize(number n, const coeffs r)
only used by slimgb (tgb.cc)
Definition: longrat.h:77
const ring r
Definition: syzextra.cc:208
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
static FORCE_INLINE int n_Size(number n, const coeffs r)
return a non-negative measure for the complexity of n; return 0 only when n represents zero; (used fo...
Definition: coeffs.h:574

§ sort_region_down()

static void sort_region_down ( red_object los,
int  l,
int  u,
slimgb_alg  
)
static

Definition at line 4614 of file tgb.cc.

4615 {
4616  int r_size = u - l + 1;
4617  qsort (los + l, r_size, sizeof (red_object), red_object_better_gen);
4618  int i;
4619  int *new_indices = (int *) omalloc ((r_size) * sizeof (int));
4620  int bound = 0;
4621  BOOLEAN at_end = FALSE;
4622  for(i = l; i <= u; i++)
4623  {
4624  if(!(at_end))
4625  {
4626  bound = new_indices[i - l] =
4627  bound + search_red_object_pos (los + bound, l - bound - 1, los + i);
4628  if(bound == l)
4629  at_end = TRUE;
4630  }
4631  else
4632  {
4633  new_indices[i - l] = l;
4634  }
4635  }
4636  red_object *los_region =
4637  (red_object *) omalloc (sizeof (red_object) * (u - l + 1));
4638  for(int i = 0; i < r_size; i++)
4639  {
4640  new_indices[i] += i;
4641  los_region[i] = los[l + i];
4642  assume ((i == 0) || (new_indices[i] > new_indices[i - 1]));
4643  }
4644 
4645  i = r_size - 1;
4646  int j = u;
4647  int j2 = l - 1;
4648  while(i >= 0)
4649  {
4650  if(new_indices[i] == j)
4651  {
4652  los[j] = los_region[i];
4653  i--;
4654  j--;
4655  }
4656  else
4657  {
4658  assume (new_indices[i] < j);
4659  los[j] = los[j2];
4660  assume (j2 >= 0);
4661  j2--;
4662  j--;
4663  }
4664  }
4665  omfree (los_region);
4666  omfree (new_indices);
4667 }
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
static int red_object_better_gen(const void *ap, const void *bp)
Definition: tgb.cc:665
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
int search_red_object_pos(red_object *a, int top, red_object *key)
Definition: tgb.cc:4589
#define omfree(addr)
Definition: omAllocDecl.h:237
int i
Definition: cfEzgcd.cc:123
#define omalloc(size)
Definition: omAllocDecl.h:228
int BOOLEAN
Definition: auxiliary.h:88
int l
Definition: cfEzgcd.cc:94

§ spn_merge()

sorted_pair_node** spn_merge ( sorted_pair_node **  p,
int  pn,
sorted_pair_node **  q,
int  qn,
slimgb_alg c 
)

Definition at line 751 of file tgb.cc.

753 {
754  int i;
755  int *a = (int *) omalloc (qn * sizeof (int));
756 // int mc;
757 // PrintS("Debug\n");
758 // for(mc=0;mc<qn;mc++)
759 // {
760 // wrp(q[mc]->lcm_of_lm);
761 // PrintS("\n");
762 // }
763 // PrintS("Debug they are in\n");
764 // for(mc=0;mc<pn;mc++)
765 // {
766 // wrp(p[mc]->lcm_of_lm);
767 // PrintS("\n");
768 // }
769  int lastpos = 0;
770  for(i = 0; i < qn; i++)
771  {
772  lastpos = posInPairs (p, pn, q[i], c, si_max (lastpos - 1, 0));
773  // cout<<lastpos<<"\n";
774  a[i] = lastpos;
775  }
776  if((pn + qn) > c->max_pairs)
777  {
778  p =
779  (sorted_pair_node **) omrealloc (p,
780  2 * (pn +
781  qn) *
782  sizeof (sorted_pair_node *));
783  c->max_pairs = 2 * (pn + qn);
784  }
785  for(i = qn - 1; i >= 0; i--)
786  {
787  size_t size;
788  if(qn - 1 > i)
789  size = (a[i + 1] - a[i]) * sizeof (sorted_pair_node *);
790  else
791  size = (pn - a[i]) * sizeof (sorted_pair_node *); //as indices begin with 0
792  memmove (p + a[i] + (1 + i), p + a[i], size);
793  p[a[i] + i] = q[i];
794  }
795  omfree (a);
796  return p;
797 }
const poly a
Definition: syzextra.cc:212
return P p
Definition: myNF.cc:203
#define omfree(addr)
Definition: omAllocDecl.h:237
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
static int posInPairs(sorted_pair_node **p, int pn, sorted_pair_node *qe, slimgb_alg *c, int an=0)
Definition: tgb.cc:711
int i
Definition: cfEzgcd.cc:123
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition: cf_ops.cc:600
#define omalloc(size)
Definition: omAllocDecl.h:228
#define omrealloc(addr, size)
Definition: omAllocDecl.h:233

§ state_is()

static BOOLEAN state_is ( calc_state  state,
const int &  i,
const int &  j,
slimgb_alg c 
)
static

Definition at line 3935 of file tgb.cc.

3937 {
3938  assume (0 <= arg_i);
3939  assume (0 <= arg_j);
3940  assume (arg_i < c->n);
3941  assume (arg_j < c->n);
3942  if(arg_i == arg_j)
3943  {
3944  return (TRUE);
3945  }
3946  if(arg_i > arg_j)
3947  {
3948  return (c->states[arg_i][arg_j] == state);
3949  }
3950  else
3951  return (c->states[arg_j][arg_i] == state);
3952 }
#define TRUE
Definition: auxiliary.h:101
#define assume(x)
Definition: mod2.h:403
char ** states
Definition: tgb_internal.h:221

§ super_clean_top_of_pair_list()

static void super_clean_top_of_pair_list ( slimgb_alg c)
static

Definition at line 3908 of file tgb.cc.

3909 {
3910  while((c->pair_top >= 0)
3911  && (c->apairs[c->pair_top]->i >= 0)
3912  &&
3914  (c->apairs[c->pair_top]->j, c->apairs[c->pair_top]->i, c)))
3915  {
3916  free_sorted_pair_node (c->apairs[c->pair_top], c->r);
3917  c->pair_top--;
3918  }
3919 }
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
void free_sorted_pair_node(sorted_pair_node *s, ring r)
Definition: tgb.cc:3954
BOOLEAN good_has_t_rep(int i, int j, slimgb_alg *c)
Definition: tgb.cc:876

§ t2ippa()

void t2ippa ( poly ip,
int *  ia,
exp_number_builder e 
)

obsolete

Definition at line 2044 of file tgb.cc.

2045 {
2046 
2047  int o = 0;
2048  t2ippa_rec (ip, ia, e.top_level, o);
2049 }
poly_tree_node * top_level
Definition: tgb.cc:1992
void t2ippa_rec(poly *ip, int *ia, poly_tree_node *k, int &offset)
obsolete
Definition: tgb.cc:2030

§ t2ippa_rec()

void t2ippa_rec ( poly ip,
int *  ia,
poly_tree_node k,
int &  offset 
)

obsolete

Definition at line 2030 of file tgb.cc.

2031 {
2032  if(!k)
2033  return;
2034  t2ippa_rec (ip, ia, k->l, offset);
2035  ip[offset] = k->p;
2036  ia[k->n] = offset;
2037  ++offset;
2038 
2039  t2ippa_rec (ip, ia, k->r, offset);
2040  delete k;
2041 }
poly_tree_node * r
Definition: tgb.cc:1983
poly_tree_node * l
Definition: tgb.cc:1982
int k
Definition: cfEzgcd.cc:93
void t2ippa_rec(poly *ip, int *ia, poly_tree_node *k, int &offset)
obsolete
Definition: tgb.cc:2030
int offset
Definition: libparse.cc:1091

§ t_rep_gb()

ideal t_rep_gb ( ring  r,
ideal  arg_I,
int  syz_comp,
BOOLEAN  F4_mode 
)

Definition at line 3558 of file tgb.cc.

3559 {
3560  assume (r == currRing);
3561  ring orig_ring = r;
3562  int pos;
3563  ring new_ring = rAssure_TDeg (orig_ring, 1, rVar (orig_ring), pos);
3564  ideal s_h;
3565  if(orig_ring != new_ring)
3566  {
3567  rChangeCurrRing (new_ring);
3568  s_h = idrCopyR_NoSort (arg_I, orig_ring, new_ring);
3569  idTest (s_h);
3570  /*int i;
3571  for(i=0;i<IDELEMS(s_h);i++)
3572  {
3573  poly p=s_h->m[i];
3574  while(p)
3575  {
3576  p_Setm(p,new_ring);
3577  pIter(p);
3578  }
3579  } */
3580  }
3581  else
3582  {
3583  s_h = id_Copy (arg_I, orig_ring);
3584  }
3585 
3586  ideal s_result = do_t_rep_gb (new_ring, s_h, syz_comp, F4_mode, pos);
3587  ideal result;
3588  if(orig_ring != new_ring)
3589  {
3590  idTest (s_result);
3591  rChangeCurrRing (orig_ring);
3592  result = idrMoveR_NoSort (s_result, new_ring, orig_ring);
3593 
3594  idTest (result);
3595  //rChangeCurrRing(new_ring);
3596  rDelete(new_ring);
3597  //rChangeCurrRing(orig_ring);
3598  }
3599  else
3600  result = s_result;
3601  idTest (result);
3602  return result;
3603 }
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
ring rAssure_TDeg(ring r, int start_var, int end_var, int &pos)
Definition: ring.cc:4465
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
ideal do_t_rep_gb(ring, ideal arg_I, int syz_comp, BOOLEAN F4_mode, int deg_pos)
Definition: tgb.cc:3606
const ring r
Definition: syzextra.cc:208
#define assume(x)
Definition: mod2.h:403
void rChangeCurrRing(ring r)
Definition: polys.cc:12
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:206
return result
Definition: facAbsBiFact.cc:76
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
Definition: prCopy.cc:262
#define idTest(id)
Definition: ideals.h:49

§ terms_sort_crit()

int terms_sort_crit ( const void *  a,
const void *  b 
)

Definition at line 2065 of file tgb.cc.

2066 {
2067  return -pLmCmp (*((poly *) a), *((poly *) b));
2068 }
const poly a
Definition: syzextra.cc:212
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
polyrec * poly
Definition: hilb.h:10
const poly b
Definition: syzextra.cc:213

§ tgb_pair_better_gen()

static int tgb_pair_better_gen ( const void *  ap,
const void *  bp 
)
static

Definition at line 3989 of file tgb.cc.

3990 {
3991  sorted_pair_node *a = *((sorted_pair_node **) ap);
3992  sorted_pair_node *b = *((sorted_pair_node **) bp);
3993  assume ((a->i > a->j) || (a->i < 0));
3994  assume ((b->i > b->j) || (b->i < 0));
3995  if(a->deg < b->deg)
3996  return -1;
3997  if(a->deg > b->deg)
3998  return 1;
3999 
4000  int comp = pLmCmp (a->lcm_of_lm, b->lcm_of_lm);
4001 
4002  if(comp == 1)
4003  return 1;
4004  if(-1 == comp)
4005  return -1;
4006  if(a->expected_length < b->expected_length)
4007  return -1;
4008  if(a->expected_length > b->expected_length)
4009  return 1;
4010  if(a->i + a->j < b->i + b->j)
4011  return -1;
4012  if(a->i + a->j > b->i + b->j)
4013  return 1;
4014  if(a->i < b->i)
4015  return -1;
4016  if(a->i > b->i)
4017  return 1;
4018  return 0;
4019 }
const poly a
Definition: syzextra.cc:212
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
#define assume(x)
Definition: mod2.h:403
wlen_type expected_length
Definition: tgb_internal.h:158
const poly b
Definition: syzextra.cc:213

§ tgb_pair_better_gen2()

int tgb_pair_better_gen2 ( const void *  ap,
const void *  bp 
)

Definition at line 680 of file tgb.cc.

681 {
682  return (-tgb_pair_better_gen (ap, bp));
683 }
static int tgb_pair_better_gen(const void *ap, const void *bp)
Definition: tgb.cc:3989

§ top_pair()

sorted_pair_node* top_pair ( slimgb_alg c)

Definition at line 3876 of file tgb.cc.

3877 {
3878  while(c->pair_top >= 0)
3879  {
3880  super_clean_top_of_pair_list (c); //yeah, I know, it's odd that I use a different proc here
3881  if((c->is_homog) && (c->pair_top >= 0)
3882  && (c->apairs[c->pair_top]->deg >= c->lastCleanedDeg + 2))
3883  {
3884  int upper = c->apairs[c->pair_top]->deg - 1;
3885  c->cleanDegs (c->lastCleanedDeg + 1, upper);
3886  c->lastCleanedDeg = upper;
3887  }
3888  else
3889  {
3890  break;
3891  }
3892  }
3893 
3894  if(c->pair_top < 0)
3895  return NULL;
3896  else
3897  return (c->apairs[c->pair_top]);
3898 }
sorted_pair_node ** apairs
Definition: tgb_internal.h:241
void cleanDegs(int lower, int upper)
Definition: tgb.cc:3794
BOOLEAN is_homog
Definition: tgb_internal.h:278
static void super_clean_top_of_pair_list(slimgb_alg *c)
Definition: tgb.cc:3908
int lastCleanedDeg
Definition: tgb_internal.h:272
#define NULL
Definition: omList.c:10

§ trivial_syzygie()

static BOOLEAN trivial_syzygie ( int  pos1,
int  pos2,
poly  bound,
slimgb_alg c 
)
static

Definition at line 800 of file tgb.cc.

801 {
802  poly p1 = c->S->m[pos1];
803  poly p2 = c->S->m[pos2];
804 
805  if(pGetComp (p1) > 0 || pGetComp (p2) > 0)
806  return FALSE;
807  int i = 1;
808  poly m = NULL;
809  poly gcd1 = c->gcd_of_terms[pos1];
810  poly gcd2 = c->gcd_of_terms[pos2];
811 
812  if((gcd1 != NULL) && (gcd2 != NULL))
813  {
814  gcd1->next = gcd2; //may ordered incorrect
815  m = gcd_of_terms (gcd1, c->r);
816  gcd1->next = NULL;
817  }
818  if(m == NULL)
819  {
820  loop
821  {
822  if(pGetExp (p1, i) + pGetExp (p2, i) > pGetExp (bound, i))
823  return FALSE;
824  if(i == (currRing->N))
825  {
826  //PrintS("trivial");
827  return TRUE;
828  }
829  i++;
830  }
831  }
832  else
833  {
834  loop
835  {
836  if(pGetExp (p1, i) - pGetExp (m, i) + pGetExp (p2, i) >
837  pGetExp (bound, i))
838  {
839  pDelete (&m);
840  return FALSE;
841  }
842  if(i == (currRing->N))
843  {
844  pDelete (&m);
845  //PrintS("trivial");
846  return TRUE;
847  }
848  i++;
849  }
850  }
851 }
static CanonicalForm bound(const CFMatrix &M)
Definition: cf_linsys.cc:460
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
#define pGetComp(p)
Component.
Definition: polys.h:37
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
static poly gcd_of_terms(poly p, ring r)
Definition: tgb.cc:4021
#define pDelete(p_ptr)
Definition: polys.h:169
poly * gcd_of_terms
Definition: tgb_internal.h:239
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
polyrec * poly
Definition: hilb.h:10

Variable Documentation

§ bundle_size

const int bundle_size = 100
static

Definition at line 36 of file tgb.cc.

§ bundle_size_noro

const int bundle_size_noro = 10000
static

Definition at line 37 of file tgb.cc.

§ delay_factor

const int delay_factor = 3
static

Definition at line 38 of file tgb.cc.

§ lm_bin

omBin lm_bin = NULL
static

Definition at line 41 of file tgb.cc.