34 #define BUCKETS_FOR_NORO_RED 1 35 #define SR_HDL(A) ((long)(A)) 39 #define ADD_LATER_SIZE 500 93 for(i = 1; i <=
rVar (r); i++)
153 #define degbound(p) assume(pTotaldegree(p)<10) 240 for(i = b->buckets_used; i >= 0; i--)
242 assume ((b->buckets_length[i] == 0) || (b->buckets[i] !=
NULL));
243 s += b->buckets_length[
i] ;
245 #ifdef HAVE_COEF_BUCKETS 247 if(b->coef[0] !=
NULL)
313 for(i = b->buckets_used; i >= 0; i--)
315 assume ((b->buckets_length[i] == 0) || (b->buckets[i] !=
NULL));
316 s += b->buckets_length[
i] ;
318 #ifdef HAVE_COEF_BUCKETS 320 if(b->coef[0] !=
NULL)
363 if(b->buckets[i] ==
NULL)
442 return r->block0[last_block];
516 for(i = b->buckets_used; i >= 0; i--)
518 if(b->buckets[i] ==
NULL)
524 s += b->buckets_length[
i];
614 #ifdef HAVE_COEF_BUCKETS 615 if(bucket->coef[0] !=
NULL)
651 #if 0 //currently unused 657 #if 0 //currently unused 658 static int LObject_better_gen (
const void *
ap,
const void *bp)
662 return (
pLmCmp (a->p, b->p));
670 #if 0 //currently unused 671 static int pLmCmp_func_inverted (
const void *ap1,
const void *ap2)
674 p1 = *((poly *) ap1);
675 p2 = *((poly *) ap2);
689 long not_sev = ~obj.
sev;
690 for(
int i = 0;
i <= strat->
sl;
i++)
702 for(
int i = 0;
i <= strat->
sl;
i++)
746 if(i[top] < i[top - 1])
755 int *a = (
int *)
omalloc (qn *
sizeof (
int));
770 for(i = 0; i < qn; i++)
785 for(i = qn - 1; i >= 0; i--)
792 memmove (p + a[i] + (1 + i), p + a[i], size);
802 poly p1 = c->
S->m[pos1];
803 poly p2 = c->
S->m[pos2];
812 if((gcd1 !=
NULL) && (gcd2 !=
NULL))
859 for(i = l + 1; i <= u; i++)
886 pLcm (c->
S->m[i], c->
S->m[j], lm);
893 for(
int n = 0; ((n < c->
n) && (i_con[n] >= 0)); n++)
910 for(i = 0; i <= strat->
sl; i++)
923 while(i <= strat->sl)
926 P.sev = strat->
sevS[
i];
935 for(j = 0; j < c->
n; j++)
937 if(c->
S->m[j] == P.p)
956 for(i = bucket->buckets_used; i >= 0; i--)
958 if(bucket->buckets[i])
959 sum += bucket->buckets_length[
i];
978 memset (&P, 0,
sizeof (P));
982 P.FDeg = c->
r->pFDeg (P.p, c->
r);
1012 for(i = 0; i < pos; i++)
1017 for(i = pos + 1; i < c->
n; i++)
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];
1038 length_w = strat->
lenSw[old_pos];
1040 for(i = old_pos; i > new_pos; i--)
1042 strat->
S[
i] = strat->
S[i - 1];
1048 for(i = old_pos; i > new_pos; i--)
1049 strat->
lenS[i] = strat->
lenS[i - 1];
1051 for(i = old_pos; i > new_pos; i--)
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;
1060 strat->
lenSw[new_pos] = length_w;
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];
1075 length_w = strat->
lenSw[old_pos];
1077 for(i = old_pos; i < new_pos; i++)
1079 strat->
S[
i] = strat->
S[i + 1];
1085 for(i = old_pos; i < new_pos; i++)
1086 strat->
lenS[i] = strat->
lenS[i + 1];
1088 for(i = old_pos; i < new_pos; i++)
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;
1097 strat->
lenSw[new_pos] = length_w;
1104 int *cans = (
int *)
omAlloc (c->
n * sizeof (
int));
1105 int *connected = (
int *)
omAlloc (c->
n * sizeof (
int));
1107 int cans_length = 1;
1108 connected[0] = from;
1109 int last_cans_pos = -1;
1110 int connected_length = 1;
1113 int not_yet_found = cans_length;
1114 int con_checked = 0;
1119 if((con_checked < connected_length) && (not_yet_found > 0))
1121 pos = connected[con_checked];
1122 for(
int i = 0;
i < cans_length;
i++)
1131 connected[connected_length] = cans[
i];
1136 if(connected[connected_length - 1] == to)
1138 if(connected_length < c->n)
1140 connected[connected_length] = -1;
1151 for(last_cans_pos++; last_cans_pos <= c->
n; last_cans_pos++)
1153 if(last_cans_pos == c->
n)
1155 if(connected_length < c->n)
1157 connected[connected_length] = -1;
1162 if((last_cans_pos == from) || (last_cans_pos == to))
1165 (I->m[last_cans_pos], c->
short_Exps[last_cans_pos], bound,
1166 neg_bounds_short, c->
r))
1168 cans[cans_length] = last_cans_pos;
1174 for(
int i = 0;
i < con_checked;
i++)
1176 if(
has_t_rep (connected[
i], last_cans_pos, c))
1178 connected[connected_length] = last_cans_pos;
1180 cans[cans_length - 1] = -1;
1182 if(connected[connected_length - 1] == to)
1184 if(connected_length < c->n)
1186 connected[connected_length] = -1;
1196 if(connected_length < c->n)
1198 connected[connected_length] = -1;
1205 static inline poly p_MoveHead (poly
p,
omBin b)
1223 pLcm (c->
S->m[i], c->
S->m[j], lm);
1228 for(
int n = 0; ((n < c->
n) && (i_con[n] >= 0)); n++)
1259 sugar +=
si_max (t_i, t_j);
1263 for(
int m = 0; ((
m < c->
n) && (i_con[
m] >= 0));
m++)
1274 for(
int m = 0; ((
m < c->
n) && (j_con[
m] >= 0));
m++)
1328 if(l >= strat->
lenS[*at])
1388 res *= el1 + el2 - 2;
1439 poly div_by =
pMDivide (copy, got);
1452 #define ENLARGE(pointer, type) pointer=(type*) omrealloc(pointer, c->array_lengths*sizeof(type)) 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));} 1478 #ifndef USE_STDVECBOOL 1496 ecart = sugar - c->
T_deg[
i];
1518 c->
states.push_back (dynamic_bitset <> (i));
1521 #ifdef USE_STDVECBOOL 1523 c->
states.push_back (vector < bool > (i));
1537 #undef ENLARGE_ALIGN 1540 for(j = 0; j <
i; j++)
1657 pLcm (c->
S->m[i], c->
S->m[j], lm);
1697 for(upper = lower + 1; upper < spc; upper++)
1699 if(!
pLmEqual (nodes[lower]->lcm_of_lm, nodes[upper]->lcm_of_lm))
1703 if(
has_t_rep (nodes[upper]->i, nodes[upper]->j, c))
1709 for(z = 0; z < spc_final; z++)
1712 (nodes_final[z]->lcm_of_lm, nodes[lower]->lcm_of_lm, c->
r))
1721 for(; lower <= upper; lower++)
1725 nodes[lower] =
NULL;
1732 p_Test (nodes[lower]->lcm_of_lm, c->
r);
1736 nodes_final[spc_final] =
1739 *(nodes_final[spc_final++]) = *(nodes[lower]);
1741 nodes[lower] =
NULL;
1742 for(lower = lower + 1; lower <= upper; lower++)
1746 nodes[lower] =
NULL;
1755 assume (spc_final <= spc);
1790 m_iLastAltVar - m_iFirstAltVar + 1;
1793 poly *array_arg = (poly *)
omalloc (N *
sizeof (poly));
1797 for(
unsigned short v = m_iFirstAltVar;
v <= m_iLastAltVar;
v++)
1815 #endif // if SCAlgebra 1852 P.SetShortExpVector ();
1867 if((j >= 0) && ((!n) ||
1868 ((strat->
lenS[j] <= n) &&
1885 number m2 =
nMult (m, coef);
1899 P.SetShortExpVector ();
1930 for(i = 0; i <= strat->
sl; i++)
1932 if((strat->
lenS[i] > 2)
1936 return (
redNFTail (h, i - 1, strat, len));
1947 for(i = 0; i < fixpos; i++)
1957 for(i = fixpos + 1; i < c->
n; i++)
2002 while(*node !=
NULL)
2004 int c =
pLmCmp (p, (*node)->p);
2008 node = &((*node)->r);
2010 node = &((*node)->l);
2025 if((r2.
p != ro.
p) || (r2.
sev != ro.
sev))
2032 return -
pLmCmp (*((poly *) a), *((poly *) b));
2035 #if 0 // currently unused 2036 static void unify_terms (poly * terms,
int &sum)
2044 if(!(
pLmEqual (terms[curr], terms[last])))
2046 terms[++
last] = terms[curr];
2053 #if 0 // currently unused 2055 export_mat (number *
number_array,
int pn,
int tn,
const char *format_str,
2059 sprintf (matname, format_str, mat_nr);
2060 FILE *out = fopen (matname,
"w");
2062 fprintf (out,
"mat=[\n");
2063 for(i = 0; i < pn; i++)
2065 fprintf (out,
"[\n");
2066 for(j = 0; j < tn; j++)
2070 fprintf (out,
", ");
2075 fprintf (out,
"],\n");
2077 fprintf (out,
"],\n");
2079 fprintf (out,
"]\n");
2089 linalg_step_modp (poly *
p, poly * p_out,
int &pn, poly * terms,
int tn,
2092 static int export_n = 0;
2096 const number_type zero = 0;
2097 int array_size = pn * tn;
2099 (number_type *)
omalloc (pn * tn *
sizeof (number_type));
2101 for(i = 0; i < array_size; i++)
2103 number_array[
i] = zero;
2105 for(i = 0; i < pn; i++)
2114 export_mat (number_array, pn, tn,
"mat%i.py", ++export_n);
2120 for(i = 0; i < pn; i++)
2125 number *row = number_array +
base;
2137 p_out[p_pos++] =
NULL;
2140 export_mat (number_array, pn, tn,
"mat%i.py", ++export_n);
2148 int *ibuf = (
int *)
omalloc (pn *
sizeof (
int));
2151 for(j = 0; j < pn; j++)
2157 for(j = 0; j < pn; j++)
2164 for(j = 0; j < pn; j++)
2166 memmove (big_sbuf + partsum, sbuf[j],
2191 #ifndef NORO_NON_POLY 2192 void NoroCache::evaluateRows ()
2196 buffer = (number *)
omAlloc (nIrreducibleMonomials *
sizeof (number));
2197 for(i = 0; i < root.branches_len; i++)
2199 evaluateRows (1, root.branches[i]);
2224 #ifndef NORO_SPARSE_ROWS_PRE 2227 memset (buffer, 0,
sizeof (number) * nIrreducibleMonomials);
2254 row->
array = (number *)
omalloc ((len) *
sizeof (number));
2255 memcpy (row->
array, a + row->
begin, len * sizeof (number));
2274 PrintS (
"F4 calc wrong, as poly len was wrong\n");
2283 NoroCache::evaluatePlaceHolder (number * row,
2284 std::vector < NoroPlaceHolder >
2288 int s = place_holders.size ();
2289 for(i = 0; i <
s; i++)
2292 number coef = place_holders[
i].coef;
2299 #ifndef NORO_SPARSE_ROWS_PRE 2303 number *ref_begin = ref_row->
array;
2304 number *ref_end = ref_row->
array + (ref_row->
end - ref_row->
begin);
2305 number *my_pos = row + ref_row->
begin;
2309 while(ref_begin != ref_end)
2319 while(ref_begin != ref_end)
2322 *my_pos =
npAddM (*my_pos, *ref_begin);
2332 int n = ref_row->
len;
2336 for(j = 0; j < n; j++)
2338 int idx = idx_array[
j];
2339 number ref_coef = coef_array[
j];
2350 #ifndef NORO_NON_POLY 2354 MonRedRes res_holder;
2357 res_holder.changed =
TRUE;
2370 res_holder.ref = ref;
2371 res_holder.onlyBorrowed =
TRUE;
2372 res_holder.changed =
TRUE;
2380 poly cache_lookup = cache->
lookup (t, succ, res_holder.len);
2383 if(cache_lookup == t)
2388 res_holder.changed =
FALSE;
2390 res_holder.coef =
npInit (1);
2392 res_holder.onlyBorrowed =
FALSE;
2399 res_holder.p = cache_lookup;
2401 res_holder.onlyBorrowed =
TRUE;
2429 res = noro_red_non_unique (res, res_holder.len, cache, c);
2435 res_holder.changed =
TRUE;
2437 res_holder.coef = coef_bak;
2438 res_holder.onlyBorrowed =
TRUE;
2439 res_holder.ref = ref;
2450 res_holder.ref = cache->
insert (t, t, res_holder.len);
2455 res_holder.changed =
FALSE;
2458 res_holder.coef =
npInit (1);
2459 res_holder.onlyBorrowed =
FALSE;
2465 res_holder.coef = coef_bak;
2466 res_holder.onlyBorrowed =
TRUE;
2467 res_holder.changed =
FALSE;
2476 #ifndef NORO_NON_POLY 2489 poly unchanged_head =
NULL;
2490 poly unchanged_tail =
NULL;
2491 int unchanged_size = 0;
2501 MonRedRes red = noro_red_mon (t,
FALSE, cache, c);
2502 if((!(red.changed)) && (!(red.onlyBorrowed)))
2509 pNext (unchanged_tail) = red.p;
2510 pIter (unchanged_tail);
2514 unchanged_tail = red.p;
2515 unchanged_head = red.p;
2521 if(red.onlyBorrowed)
2548 #ifdef NORO_SPARSE_ROWS_PRE 2571 #ifndef NORO_NON_POLY 2572 std::vector < NoroPlaceHolder > noro_red (poly
p,
int &len,
NoroCache * cache,
2575 std::vector < NoroPlaceHolder >
res;
2582 MonRedRes red = noro_red_mon (t,
TRUE, cache, c);
2583 assume (red.onlyBorrowed);
2589 assume (!((h.ref->value_poly ==
NULL) && (h.ref->value_len != 0)));
2590 if(h.ref->value_poly)
2602 poly *reduced = (poly *)
omalloc (pn *
sizeof (poly));
2604 int *reduced_len = (
int *)
omalloc (pn *
sizeof (
int));
2611 for(j = 0; j < pn; j++)
2621 h = noro_red (
p_Copy (h, c->
r), h_len, &cache, c);
2631 reduced[reduced_c] =
h;
2632 reduced_len[reduced_c] = h_len;
2635 Print (
"%d ", h_len);
2638 int reduced_sum = 0;
2639 for(j = 0; j < reduced_c; j++)
2641 reduced_sum += reduced_len[
j];
2643 poly *terms = (poly *)
omalloc (reduced_sum *
sizeof (poly));
2645 for(j = 0; j < reduced_c; j++)
2647 poly
h = reduced[
j];
2653 assume (tc <= reduced_sum);
2656 assume (tc == reduced_sum);
2658 int nterms = reduced_sum;
2661 unify_terms (terms, nterms);
2664 int rank = reduced_c;
2665 linalg_step_modp (reduced,
p, rank, terms, nterms, c);
2690 for(i = 0; i < c->
n; i++)
2702 poly *
p = (poly *)
omAlloc ((max_pairs + 1) *
sizeof (poly));
2705 while(i < max_pairs)
2714 if(s->
deg > curr_deg)
2760 if((!c->
nc) & (!(use_noro)))
2762 h =
redNF2 (h, c, mlen, coef, 2);
2780 #ifdef TGB_RESORT_PAIRS 2781 c->replaced =
new bool[c->
n];
2831 for(j = 0; j <
i; j++)
2848 Print (
"%dM[%d,", curr_deg, i);
2852 #ifdef TGB_RESORT_PAIRS 2863 if((c->replaced[c->
apairs[e]->
i]) || (c->replaced[c->
apairs[e]->
j]))
2876 for(k = 0; k <
i; k++)
2880 for(k2 = 0; k2 <
i; k2++)
2885 || (
wrp (buf[k].p),
Print (
" k %d k2 %d ", k, k2),
2896 poly *add_those = (poly *)
omalloc (i *
sizeof (poly));
2897 for(j = 0; j <
i; j++)
2927 #ifdef TGB_RESORT_PAIRS 2964 P.SetShortExpVector ();
3009 P.SetShortExpVector ();
3068 poly *set_this = &
p;
3073 (*set_this) =
pLmInit (monoms[monom_index - 1 - r->
exp]);
3075 set_this = &((*set_this)->next);
3087 p1 = *((poly *) ap1);
3088 p2 = *((poly *) ap2);
3109 for(
int i = 0;
i <
s;
i++)
3133 apairs =
spn_merge (apairs, pair_top + 1, si_array, s,
this);
3140 this->deg_pos = deg_pos;
3141 lastCleanedDeg = -1;
3143 this->syz_comp = syz_comp;
3151 for(hzz = 0; hzz <
IDELEMS (I); hzz++)
3155 poly t = I->m[hzz]->next;
3169 eliminationProblem = ((!(is_homog)) && ((
currRing->pLexOrder) || (I->rank > 1)));
3175 easy_product_crit = 0;
3176 extended_product_crit = 0;
3178 isDifficultField =
FALSE;
3180 isDifficultField =
TRUE;
3185 reduction_steps = 0;
3212 T_deg = (
int *)
omAlloc (n *
sizeof (
int));
3213 if(eliminationProblem)
3214 T_deg_full = (
int *)
omAlloc (n *
sizeof (
int));
3217 tmp_pair_lm = (poly *)
omAlloc (n *
sizeof (poly));
3225 #ifdef USE_STDVECBOOL 3227 h =
omAlloc (n *
sizeof (
char *));
3229 states = (
char **) h;
3232 h =
omAlloc (n *
sizeof (
int));
3233 lengths = (
int *) h;
3237 short_Exps = (
long *)
omAlloc (n *
sizeof (
long));
3243 if(eliminationProblem)
3245 strat->syzComp = syz_comp;
3249 strat->tailRing = r;
3258 strat->sevS = (
unsigned long *)
omAlloc0 (i *
sizeof (
unsigned long));
3260 strat->S_2_R = (
int *)
omAlloc0 (i *
sizeof (
int));
3261 strat->fromQ =
NULL;
3262 strat->Shdl =
idInit (1, 1);
3263 strat->S = strat->Shdl->m;
3264 strat->lenS = (
int *)
omAlloc0 (i *
sizeof (
int));
3265 if((isDifficultField) || (eliminationProblem))
3268 strat->lenSw =
NULL;
3275 poly *array_arg = I->m;
3277 introduceDelayedPairs (array_arg, n - 1);
3300 for(i = 1; i < n; i++)
3303 for(i = 0; i <
IDELEMS (I); i++)
3310 use_noro = ((!(nc)) && (S->rank <= 1) && (
rField_is_Zp (r))
3312 use_noro_last_block =
false;
3313 if((!(use_noro)) && (lastDpBlockStart <= (
currRing->N)))
3315 use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (
rField_is_Zp (r))
3320 use_noro_last_block =
false;
3331 poly *
add = (poly *)
omAlloc ((pair_top + 2) *
sizeof (poly));
3334 for(piter = 0; piter <= pair_top; piter++)
3347 apairs[piter] =
NULL;
3352 while(add[pos] !=
NULL)
3357 for(piter = 0; piter <= pair_top; piter++)
3362 apairs[piter] =
NULL;
3378 for(i = 0; i < c->
F->
size; i++)
3401 #ifndef USE_STDVECBOOL 3402 for(
int z = 1 ; z < c->
n; z++)
3412 for(
int z = 0; z < c->
n; z++)
3434 for(i = 0; i < c->
n; i++)
3445 Print (
"\nNF:%i product criterion:%i, ext_product criterion:%i \n",
3449 for(i = 0; i <= c->
strat->
sl; i++)
3454 for(j = 0; j < c->
n; j++)
3456 if(c->
S->m[j] == c->
strat->
S[i])
3484 for(i = 0; i < c->
n; i++)
3489 for(j = 0; j < c->
n; j++)
3491 if((c->
S->m[j] ==
NULL) || (i == j))
3512 for(i = 0; i <= c->
strat->
sl; i++)
3527 if(orig_ring != new_ring)
3544 s_h =
id_Copy (arg_I, orig_ring);
3548 ideal s_result =
do_t_rep_gb (new_ring, s_h, syz_comp, F4_mode, pos);
3550 if(orig_ring != new_ring)
3584 for(i = 0; i <
IDELEMS (I); i++)
3590 qsort (I->m, IDELEMS (I),
sizeof (poly),
poly_crit);
3648 assume (arg_i < state->n);
3649 assume (arg_j < state->n);
3665 static int pLcmDeg (poly a, poly b)
3681 for(
int i = 0;
i < c->
n;
i++)
3687 poly tail = c->
S->m[
i]->next;
3688 poly prev = c->
S->m[
i];
3690 while((tail !=
NULL) && (
pLmCmp (tail, monom) >= 0))
3694 did_something =
TRUE;
3695 prev->next = tail->next;
3714 for(
int z = 0; z <= c->
strat->
sl; z++)
3723 for(
int z = new_pos - 1; z >= 0; z--)
3732 assume (new_pos <= old_pos);
3737 if(new_pos < old_pos)
3744 #if 0 // currently unused 3764 for(deg = lower; deg <= upper; deg++)
3767 for(i = 0; i < n; i++)
3773 h =
redNFTail (h, strat->sl, strat, lengths[i]);
3786 if(weighted_lengths)
3787 weighted_lengths[
i] = wlen;
3791 for(j = 0; j <= strat->sl; j++)
3793 if(h == strat->S[j])
3798 strat->lenS[
j] = len;
3802 strat->lenSw[
j] = wlen;
3811 new_pos = new_pos - 1;
3823 for(i = 0; i < this->n; i++)
3825 for(j = 0; j <
i; j++)
3827 if(T_deg[i] + T_deg[j] <= upper)
3910 return (c->
states[arg_i][arg_j] == state);
3913 return (c->
states[arg_j][arg_i] == state);
3940 if(a->
i + a->
j < b->
i + b->
j)
3942 if(a->
i + a->
j > b->
i + b->
j)
3972 if(a->
i + a->
j < b->
i + b->
j)
3974 if(a->
i + a->
j > b->
i + b->
j)
4003 for(i = max_g_0;
i; i--)
4009 if((max_g_0 == 0) && (
pGetExp (m, i) > 0))
4062 #if 0 //currently unused 4063 static poly kBucketGcd (
kBucket * b, ring r)
4071 if(b->buckets[i] !=
NULL)
4156 los[best].
p = los[best].
bucket->buckets[b_pos];
4157 qc =
pQuality (los[best].bucket->buckets[b_pos], c);
4192 los[best].
p = los[best].
bucket->buckets[b_pos];
4193 qc =
pQuality (los[best].bucket->buckets[b_pos], c);
4212 PrintS (
"Wrong wlen_type");
4218 los[best].
p = los[best].
bucket->buckets[b_pos];
4219 qc =
pQuality (los[best].bucket->buckets[b_pos], c);
4231 if(qc < quality_a / 2)
4285 while((il > 0) &&
pLmEqual (los[il - 1].
p, los[il].
p))
4307 clear_into = los[bp].
p;
4319 for(z = c->
n; z; z--)
4321 if(p == c->
S->m[z - 1])
4332 #ifdef TGB_RESORT_PAIRS 4334 c->replaced[pos_in_c] =
TRUE;
4336 tdeg = c->
T_deg[pos_in_c];
4337 c->
S->m[pos_in_c] = clear_into;
4338 c->
lengths[pos_in_c] = new_length;
4370 #ifdef FIND_DETERMINISTIC 4399 step =
si_min (i2, step);
4411 if((!incr) && (step == 1))
4417 step =
si_min (i - i2, step);
4436 step = (step + 1) / 2;
4449 for(i = l; i <= u; i++)
4469 assume ((startf == losl - 1)
4470 || (
pLmCmp (los[startf].
p, los[startf + 1].p) == -1));
4478 assume ((i == losl - 1) || (
pLmCmp (los[i].p, los[i + 1].p) <= 0));
4487 int i2 =
fwbw (los, i);
4494 assume ((i == losl - 1) || (
pLmCmp (los[i].p, los[i + 1].p) == -1));
4502 int i2 =
fwbw (los, i);
4513 assume ((i == losl - 1) || (
pLmCmp (los[i].p, los[i + 1].p) == -1));
4538 if(los[i].
p ==
NULL)
4545 memmove (los + (
int) (last + 1 - deleted), los + (last + 1),
4553 if((last >= 0) && (last != losl - 1))
4554 memmove (los + (
int) (last + 1 - deleted), los + last + 1,
4586 int r_size = u - l + 1;
4589 int *new_indices = (
int *)
omalloc ((r_size) *
sizeof (int));
4592 for(i = l; i <= u; i++)
4596 bound = new_indices[i -
l] =
4603 new_indices[i -
l] =
l;
4608 for(
int i = 0; i < r_size; i++)
4610 new_indices[
i] +=
i;
4611 los_region[
i] = los[l +
i];
4612 assume ((i == 0) || (new_indices[i] > new_indices[i - 1]));
4620 if(new_indices[i] == j)
4622 los[
j] = los_region[
i];
4628 assume (new_indices[i] < j);
4642 poly *delay = (poly *)
omAlloc (losl *
sizeof (poly));
4650 for(i = 0; i < losl; i++)
4662 int curr_pos = losl - 1;
4666 while(curr_pos >= 0)
4671 int pn_noro = curr_pos + 1;
4672 poly *p_noro = (poly *)
omAlloc (pn_noro *
sizeof (poly));
4673 for(i = 0; i < pn_noro; i++)
4696 for(i = 0; i < pn_noro; i++)
4698 los[
i].
p = p_noro[
i];
4707 curr_pos -= deleted;
4730 if(los[i].p !=
NULL)
4746 delay[delay_s] = los[
i].
p;
4761 curr_pos -= deleted;
4773 #ifdef FIND_DETERMINISTIC 4861 this->pre_reduce (r, l, u);
4872 for(i = l; i <= u; i++)
4874 this->do_reduce (r[i]);
4876 for(i = l; i <= u; i++)
4889 if(fill_back !=
NULL)
4936 work_on_copy =
TRUE;
4973 int reducer_deg = 0;
4986 reducer_deg = lm_deg + ecart;
4990 if((!work_on_copy) && (!erg.
fromS))
5014 template int pos_helper<long, long*>(skStrategy*, spolyrec*, long,
long*, spolyrec**);
5016 template void noro_step<unsigned char>(spolyrec**,
int&,
slimgb_alg*);
5017 template void noro_step<unsigned int>(spolyrec**,
int&,
slimgb_alg*);
5018 template void noro_step<unsigned short>(spolyrec**,
int&,
slimgb_alg*);
5021 template int term_nodes_sort_crit<unsigned char>(
void const*,
void const*);
5022 template int term_nodes_sort_crit<unsigned int>(
void const*,
void const*);
5023 template int term_nodes_sort_crit<unsigned short>(
void const*,
void const*);
5025 template spolyrec* row_to_poly<unsigned char>(
unsigned char*, spolyrec**, int,
ip_sring*);
5026 template spolyrec* row_to_poly<unsigned int>(
unsigned int*, spolyrec**, int,
ip_sring*);
5027 template spolyrec* row_to_poly<unsigned short>(
unsigned short*, spolyrec**, int,
ip_sring*);
5029 template void simplest_gauss_modp<unsigned char>(
unsigned char*, int, int);
5030 template void simplest_gauss_modp<unsigned int>(
unsigned int*, int, int);
5031 template void simplest_gauss_modp<unsigned short>(
unsigned short*, int, int);
5034 template int modP_lastIndexRow<unsigned char>(
unsigned char*, int);
5035 template int modP_lastIndexRow<unsigned int>(
unsigned int*, int);
5036 template int modP_lastIndexRow<unsigned short>(
unsigned short*, int);
5048 template SparseRow<unsigned char>* noro_red_to_non_poly_sparse<unsigned char>(MonRedResNP<unsigned char>*, int, NoroCache<unsigned char>*);
5050 template SparseRow<unsigned int>* noro_red_to_non_poly_sparse<unsigned int>(MonRedResNP<unsigned int>*, int, NoroCache<unsigned int>*);
5052 template SparseRow<unsigned short>* noro_red_to_non_poly_sparse<unsigned short>(MonRedResNP<unsigned short>*, int, NoroCache<unsigned short>*);
5060 template class NoroCache<unsigned char>;
5061 template class NoroCache<unsigned int>;
5062 template class NoroCache<unsigned short>;
5066 template void add_coef_times_dense<unsigned char>(
unsigned char*, int,
unsigned char const*, int,
snumber*);
5067 template void add_coef_times_dense<unsigned int>(
unsigned int*, int,
unsigned int const*, int,
snumber*);
5068 template void add_coef_times_dense<unsigned short>(
unsigned short*, int,
unsigned short const*, int,
snumber*);
5072 template void add_dense<unsigned char>(
unsigned char*, int,
unsigned char const*, int);
5073 template void add_dense<unsigned int>(
unsigned int*, int,
unsigned int const*, int);
5074 template void add_dense<unsigned short>(
unsigned short*, int,
unsigned short const*, int);
5075 template void add_sparse<unsigned char>(
unsigned char*, int, SparseRow<unsigned char>*);
5076 template void add_sparse<unsigned int>(
unsigned int*, int, SparseRow<unsigned int>*);
5077 template void add_sparse<unsigned short>(
unsigned short*, int, SparseRow<unsigned short>*);
5080 template void sub_dense<unsigned char>(
unsigned char*, int,
unsigned char const*, int);
5081 template void sub_dense<unsigned int>(
unsigned int*, int,
unsigned int const*, int);
5082 template void sub_dense<unsigned short>(
unsigned short*, int,
unsigned short const*, int);
5083 template void sub_sparse<unsigned char>(
unsigned char*, int, SparseRow<unsigned char>*);
5084 template void sub_sparse<unsigned int>(
unsigned int*, int, SparseRow<unsigned int>*);
5085 template void sub_sparse<unsigned short>(
unsigned short*, int, SparseRow<unsigned short>*);
5086 template void write_coef_idx_to_buffer_dense<unsigned char>(
CoefIdx<unsigned char>*,
int&,
unsigned char*, int);
5087 template void write_coef_idx_to_buffer_dense<unsigned int>(
CoefIdx<unsigned int>*,
int&,
unsigned int*, int);
5088 template void write_coef_idx_to_buffer_dense<unsigned short>(
CoefIdx<unsigned short>*,
int&,
unsigned short*, int);
5089 template void write_coef_idx_to_buffer<unsigned char>(CoefIdx<unsigned char>*,
int&,
int*,
unsigned char*, int);
5090 template void write_coef_idx_to_buffer<unsigned int>(CoefIdx<unsigned int>*,
int&,
int*,
unsigned int*, int);
5091 template void write_coef_idx_to_buffer<unsigned short>(CoefIdx<unsigned short>*,
int&,
int*,
unsigned short*, int);
5092 template void write_coef_times_xx_idx_to_buffer_dense<unsigned char>(CoefIdx<unsigned char>*,
int&,
unsigned char*, int,
snumber*);
5093 template void write_coef_times_xx_idx_to_buffer_dense<unsigned int>(CoefIdx<unsigned int>*,
int&,
unsigned int*, int,
snumber*);
5094 template void write_coef_times_xx_idx_to_buffer_dense<unsigned short>(CoefIdx<unsigned short>*,
int&,
unsigned short*, int,
snumber*);
5095 template void write_coef_times_xx_idx_to_buffer<unsigned char>(CoefIdx<unsigned char>*,
int&,
int*,
unsigned char*, int,
snumber*);
5096 template void write_coef_times_xx_idx_to_buffer<unsigned int>(CoefIdx<unsigned int>*,
int&,
int*,
unsigned int*, int,
snumber*);
5097 template void write_coef_times_xx_idx_to_buffer<unsigned short>(CoefIdx<unsigned short>*,
int&,
int*,
unsigned short*, int,
snumber*);
5098 template void write_minus_coef_idx_to_buffer_dense<unsigned char>(CoefIdx<unsigned char>*,
int&,
unsigned char*, int);
5099 template void write_minus_coef_idx_to_buffer_dense<unsigned int>(CoefIdx<unsigned int>*,
int&,
unsigned int*, int);
5100 template void write_minus_coef_idx_to_buffer_dense<unsigned short>(CoefIdx<unsigned short>*,
int&,
unsigned short*, int);
5101 template void write_minus_coef_idx_to_buffer<unsigned char>(CoefIdx<unsigned char>*,
int&,
int*,
unsigned char*, int);
5102 template void write_minus_coef_idx_to_buffer<unsigned int>(CoefIdx<unsigned int>*,
int&,
int*,
unsigned int*, int);
5103 template void write_minus_coef_idx_to_buffer<unsigned short>(CoefIdx<unsigned short>*,
int&,
int*,
unsigned short*, int);
5106 template class std::vector<DataNoroCacheNode<unsigned char>*>;
5107 template class std::vector<DataNoroCacheNode<unsigned int>*>;
5108 template class std::vector<DataNoroCacheNode<unsigned short>*>;
5109 template class std::vector<PolySimple>;
5111 template void std::sort( CoefIdx<unsigned char>* , CoefIdx<unsigned char>* );
5112 template void std::sort( CoefIdx<unsigned int>* , CoefIdx<unsigned int>* );
5113 template void std::sort( CoefIdx<unsigned short>*, CoefIdx<unsigned short>* );
5115 template void std::sort_heap<CoefIdx<unsigned char>*>(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*);
5116 template void std::sort_heap<CoefIdx<unsigned int>*>(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*);
5117 template void std::sort_heap<CoefIdx<unsigned short>*>(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*);
5119 template void std::make_heap<CoefIdx<unsigned char>*>(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*);
5120 template void std::make_heap<CoefIdx<unsigned int>*>(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*);
5121 template void std::make_heap<CoefIdx<unsigned short>*>(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*);
5125 template void std::__final_insertion_sort<CoefIdx<unsigned char>*>(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*);
5126 template void std::__final_insertion_sort<CoefIdx<unsigned int>*>(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*);
5127 template void std::__final_insertion_sort<CoefIdx<unsigned short>*>(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*);
5129 template void std::__introsort_loop<CoefIdx<unsigned char>*,
long>(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*, long);
5130 template void std::__introsort_loop<CoefIdx<unsigned int>*,
long>(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*, long);
5131 template void std::__introsort_loop<CoefIdx<unsigned short>*,
long>(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*, long);
5133 template void std::__heap_select<CoefIdx<unsigned char>*>(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*, CoefIdx<unsigned char>*);
5134 template void std::__heap_select<CoefIdx<unsigned int>*>(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*, CoefIdx<unsigned int>*);
5135 template void std::__heap_select<CoefIdx<unsigned short>*>(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*, CoefIdx<unsigned short>*);
5137 template void std::__insertion_sort<CoefIdx<unsigned char>*>(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*);
5138 template void std::__insertion_sort<CoefIdx<unsigned int>*>(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*);
5139 template void std::__insertion_sort<CoefIdx<unsigned short>*>(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*);
5141 template void std::__move_median_first<CoefIdx<unsigned char>*>(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*, CoefIdx<unsigned char>*);
5142 template void std::__move_median_first<CoefIdx<unsigned int>*>(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*, CoefIdx<unsigned int>*);
5143 template void std::__move_median_first<CoefIdx<unsigned short>*>(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*, CoefIdx<unsigned short>*);
5145 template void std::__unguarded_linear_insert<CoefIdx<unsigned char>*>(CoefIdx<unsigned char>*);
5146 template void std::__unguarded_linear_insert<CoefIdx<unsigned int>*>(CoefIdx<unsigned int>*);
5147 template void std::__unguarded_linear_insert<CoefIdx<unsigned short>*>(CoefIdx<unsigned short>*);
5149 template void std::__adjust_heap<CoefIdx<unsigned char>*, long, CoefIdx<unsigned char> >(CoefIdx<unsigned char>*, long, long, CoefIdx<unsigned char>);
5150 template void std::__adjust_heap<CoefIdx<unsigned int>*, long, CoefIdx<unsigned int> >(CoefIdx<unsigned int>*, long, long, CoefIdx<unsigned int>);
5151 template void std::__adjust_heap<CoefIdx<unsigned short>*, long, CoefIdx<unsigned short> >(CoefIdx<unsigned short>*, long, long, CoefIdx<unsigned short>);
5153 template void std::__push_heap<CoefIdx<unsigned char>*, long, CoefIdx<unsigned char> >(CoefIdx<unsigned char>*, long, long, CoefIdx<unsigned char>);
5154 template void std::__push_heap<CoefIdx<unsigned int>*, long, CoefIdx<unsigned int> >(CoefIdx<unsigned int>*, long, long, CoefIdx<unsigned int>);
5155 template void std::__push_heap<CoefIdx<unsigned short>*, long, CoefIdx<unsigned short> >(CoefIdx<unsigned short>*, long, long, CoefIdx<unsigned short>);
5157 template CoefIdx<unsigned char>* std::__unguarded_partition<CoefIdx<unsigned char>*, CoefIdx<unsigned char> >(CoefIdx<unsigned char>*, CoefIdx<unsigned char>*, CoefIdx<unsigned char>
const&);
5158 template CoefIdx<unsigned int>* std::__unguarded_partition<CoefIdx<unsigned int>*, CoefIdx<unsigned int> >(CoefIdx<unsigned int>*, CoefIdx<unsigned int>*, CoefIdx<unsigned int>
const&);
5159 template CoefIdx<unsigned short>* std::__unguarded_partition<CoefIdx<unsigned short>*, CoefIdx<unsigned short> >(CoefIdx<unsigned short>*, CoefIdx<unsigned short>*, CoefIdx<unsigned short>
const&);
DataNoroCacheNode< number_type > * insertAndTransferOwnerShip(poly t, ring)
static int iq_crit(const void *ap, const void *bp)
static void multi_reduction_find(red_object *los, int, slimgb_alg *c, int startf, find_erg &erg)
#define __p_GetComp(p, r)
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)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
void noro_step(poly *p, int &pn, slimgb_alg *c)
static void replace_pair(int &i, int &j, slimgb_alg *c)
poly_tree_node * top_level
const CanonicalForm int s
void introduceDelayedPairs(poly *pa, int s)
unsigned long pTotaldegree(poly p)
poly lookup(poly term, BOOLEAN &succ, int &len)
static wlen_type quality_of_pos_in_strat_S_mult_high(int pos, poly high, slimgb_alg *c)
CFArray copy(const CFList &list)
write elements of list into an array
static void sort_region_down(red_object *los, int l, int u, slimgb_alg *)
static void add_later(poly p, const char *prot, slimgb_alg *c)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static BOOLEAN pHasNotCFExtended(poly p1, poly p2, poly m)
static CanonicalForm bound(const CFMatrix &M)
sorted_pair_node ** add_to_basis_ideal_quotient(poly h, slimgb_alg *c, int *ip)
#define TEST_OPT_DEGBOUND
void initBuchMoraPos(kStrategy strat)
static BOOLEAN extended_product_criterion(poly p1, poly gcd1, poly p2, poly gcd2, slimgb_alg *c)
number npInit(long i, const coeffs r)
void simplest_gauss_modp(number_type *a, int nrows, int ncols)
static int red_object_better_gen(const void *ap, const void *bp)
#define idDelete(H)
delete an ideal
'SR_INT' is the type of those integers small enough to fit into 29 bits.
int find_best(red_object *r, int l, int u, wlen_type &w, slimgb_alg *c)
returns position sets w as weight
gmp_float exp(const gmp_float &a)
sorted_pair_node ** apairs
static void move_backward_in_S(int old_pos, int new_pos, kStrategy strat)
long npInt(number &n, const coeffs r)
static int si_min(const int a, const int b)
static int get_last_dp_block_start(ring r)
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
sorted_pair_node ** tmp_spn
wlen_type * weighted_lengths
virtual void reduce(red_object *r, int l, int u)
we assume hat all occuring red_objects have same lm, and all occ. lm's in r[l...u] are the same...
#define pExpVectorDiff(pr, p1, p2)
BOOLEAN use_noro_last_block
static poly redNF2(poly h, slimgb_alg *c, int &len, number &m, int n=0)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
template void noro_step< tgb_uint8 >(poly *p, int &pn, slimgb_alg *c)
int pTotaldegree_full(poly p)
static int multi_reduction_clear_zeroes(red_object *los, int losl, int l, int u)
const poly kBucketGetLm(kBucket_pt bucket)
static short rVar(const ring r)
#define rVar(r) (r->N)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
static BOOLEAN polynomial_root(poly h, ring r)
#define MAX_BUCKET
Bucket definition (should be no one elses business, though)
static void multi_reduce_step(find_erg &erg, red_object *r, slimgb_alg *c)
static void multi_reduction_lls_trick(red_object *los, int, slimgb_alg *c, find_erg &erg)
#define omUnGetSpecBin(bin_ptr)
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static poly pp_Mult_mm(poly p, poly m, const ring r)
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
static void shorten_tails(slimgb_alg *c, poly monom)
static FORCE_INLINE int nlQlogSize(number n, const coeffs r)
only used by slimgb (tgb.cc)
#define pHasNotCF(p1, p2)
void deleteInS(int i, kStrategy strat)
poly free_row_to_poly(tgb_sparse_matrix *mat, int row, poly *monoms, int monom_index)
BOOLEAN is_valid_ro(red_object &ro)
static poly redTailShort(poly h, kStrategy strat)
void cleanDegs(int lower, int upper)
int_pair_node * soon_free
static void move_forward_in_S(int old_pos, int new_pos, kStrategy strat)
#define pExpVectorSub(p1, p2)
static poly pOne_Special(const ring r=currRing)
DataNoroCacheNode< number_type > * insert(poly term, poly nf, int len)
static BOOLEAN monomial_root(poly m, ring r)
static BOOLEAN trivial_syzygie(int pos1, int pos2, poly bound, slimgb_alg *c)
#define omTypeAllocBin(type, addr, bin)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing)
static BOOLEAN elength_is_normal_length(poly p, slimgb_alg *c)
void clean_top_of_pair_list(slimgb_alg *c)
static int tgb_pair_better_gen(const void *ap, const void *bp)
static number p_SetCoeff(poly p, number n, ring r)
int terms_sort_crit(const void *a, const void *b)
int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set)
#define pGetComp(p)
Component.
poly kBucketExtractLm(kBucket_pt bucket)
static int * make_connections(int from, int to, poly bound, slimgb_alg *c)
static poly p_Copy(poly p, const ring r)
returns a copy of p
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
static wlen_type pSLength(poly p, int l)
static void multi_reduction(red_object *los, int &losl, slimgb_alg *c)
static wlen_type coeff_mult_size_estimate(int s1, int s2, ring r)
sorted_pair_node * top_pair(slimgb_alg *c)
void bit_reduce(poly &f, ring r)
#define pGetExp(p, i)
Exponent.
virtual void do_reduce(red_object &ro)
static int rBlocks(ring r)
static wlen_type quality_of_pos_in_strat_S(int pos, slimgb_alg *c)
ideal do_t_rep_gb(ring, ideal arg_I, int syz_comp, BOOLEAN F4_mode, int deg_pos)
void free_sorted_pair_node(sorted_pair_node *s, const ring r)
static int pTotaldegree_full(poly p)
static BOOLEAN has_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *state)
sorted_pair_node * quick_pop_pair(slimgb_alg *c)
poly row_to_poly(number_type *row, poly *terms, int tn, ring r)
void kBucketDestroy(kBucket_pt *bucket_pt)
#define TEST_OPT_INTSTRATEGY
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
const CanonicalForm CFMap CFMap & N
static void go_on(slimgb_alg *c)
static wlen_type do_pELength(poly p, slimgb_alg *c, int dlm=-1)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
virtual ~reduction_step()
wlen_type kEBucketLength(kBucket *b, poly lm, slimgb_alg *ca)
#define omFreeBinAddr(addr)
int tgb_pair_better_gen2(const void *ap, const void *bp)
static long pTotaldegree(poly p)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
DataNoroCacheNode< number_type > * getCacheReference(poly term)
int status int void * buf
slimgb_alg(ideal I, int syz_comp, BOOLEAN F4, int deg_pos)
void initEcartBBA(TObject *h)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
#define pGetShortExpVector(a)
returns the "Short Exponent Vector" – used to speed up divisibility tests (see polys-impl.cc )
#define pLmShortDivisibleBy(a, sev_a, b, not_sev_b)
Divisibility tests based on Short Exponent vectors sev_a == pGetShortExpVector(a) not_sev_b == ~ pGet...
void init_with_mac_poly(tgb_sparse_matrix *mat, int row, mac_poly m)
int search_red_object_pos(red_object *a, int top, red_object *key)
void(* enterS)(LObject &h, int pos, kStrategy strat, int atR)
poly sca_pp_Mult_xi_pp(short i, const poly pPoly, const ring rRing)
static poly p_Init_Special(const ring r)
static BOOLEAN p_LmShortDivisibleBy(poly a, unsigned long sev_a, poly b, unsigned long not_sev_b, const ring r)
ideal kInterRed(ideal F, ideal Q)
ideal t_rep_gb(const ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode)
static number npAddM(number a, number b, const coeffs r)
void write_poly_to_row(number_type *row, poly h, poly *terms, int tn, ring r)
makes on each red_object in a region a single_step
BOOLEAN lenS_correct(kStrategy strat)
int extended_product_crit
void initBuchMoraCrit(kStrategy strat)
static int si_max(const int a, const int b)
#define __pp_Mult_nn(p, n, r)
static int bucket_guess(kBucket *bucket)
static poly redNFTail(poly h, const int sl, kStrategy strat, int len)
static int posInPairs(sorted_pair_node **p, int pn, sorted_pair_node *qe, slimgb_alg *c, int an=0)
void PrintS(const char *s)
ring rAssure_TDeg(ring r, int &pos)
static BOOLEAN rField_is_Q(const ring r)
static unsigned pLength(poly a)
static BOOLEAN p_LmDivisibleBy(poly a, poly b, const ring r)
static void length_one_crit(slimgb_alg *c, int pos, int len)
wlen_type guess_quality(slimgb_alg *c)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static short scaFirstAltVar(ring r)
static BOOLEAN pair_better(sorted_pair_node *a, sorted_pair_node *b, slimgb_alg *c=NULL)
static const int delay_factor
static const int bundle_size_noro
void rChangeCurrRing(ring r)
static void c_S_element_changed_hook(int pos, slimgb_alg *c)
wlen_type pELength(poly p, slimgb_alg *c, ring)
static BOOLEAN rField_is_Zp(const ring r)
static void p_Delete(poly *p, const ring r)
#define omGetSpecBin(size)
static int poly_crit(const void *ap1, const void *ap2)
static void super_clean_top_of_pair_list(slimgb_alg *c)
unsigned long p_GetShortExpVector(const poly p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
#define p_LmEqual(p1, p2, r)
const Variable & v
< [in] a sqrfree bivariate poly
wlen_type expected_length
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
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
#define ENLARGE(pointer, type)
static void clearS(poly p, unsigned long p_sev, int l, int *at, int *k, kStrategy strat)
#define __p_Mult_nn(p, n, r)
virtual void pre_reduce(red_object *r, int l, int u)
#define omrealloc(addr, size)
#define TEST_V_MODPSOLVSB
static void mass_add(poly *p, int pn, slimgb_alg *c)
void pEnlargeSet(poly **p, int l, int increment)
static void cleanS(kStrategy strat, slimgb_alg *c)
static const int backLinkCode
static poly gcd_of_terms(poly p, ring r)
static BOOLEAN ascending(int *i, int top)
void rDelete(ring r)
unconditionally deletes fields in r
number npNeg(number c, const coeffs r)
virtual void reduce(red_object *r, int l, int u)
we assume hat all occuring red_objects have same lm, and all occ. lm's in r[l...u] are the same...
void pNorm(poly p, const ring R=currRing)
static BOOLEAN state_is(calc_state state, const int &i, const int &j, slimgb_alg *c)
static BOOLEAN length(leftv result, leftv arg)
#define omSizeWOfBin(bin_ptr)
static short scaLastAltVar(ring r)
template void noro_step< tgb_uint16 >(poly *p, int &pn, slimgb_alg *c)
number npMult(number a, number b, const coeffs r)
BOOLEAN eliminationProblem
static bool rIsSCA(const ring r)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static void p_Setm(poly p, const ring r)
NoroCacheNode ** branches
wlen_type initial_quality
static int simple_posInS(kStrategy strat, poly p, int len, wlen_type wlen)
static wlen_type pair_weighted_length(int i, int j, slimgb_alg *c)
void sort(CFArray &A, int l=0)
quick sort A
poly_array_list * F_minus
BOOLEAN good_has_t_rep(int i, int j, slimgb_alg *c)
static poly nc_mm_Mult_pp(const poly m, const poly p, const ring r)
static void simplify_poly(poly p, ring r)
static poly nc_CreateSpoly(const poly p1, const poly p2, const ring r)
sorted_pair_node ** spn_merge(sorted_pair_node **p, int pn, sorted_pair_node **q, int qn, slimgb_alg *c)
static BOOLEAN lies_in_last_dp_block(poly p, slimgb_alg *c)
static const int bundle_size
#define TEST_V_UPTORADICAL
static void canonicalize_region(red_object *los, int l, int u, slimgb_alg *)
#define TEST_OPT_REDTHROUGH
int syz_comp
array_lengths should be greater equal n;
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
int slim_nsize(number n, ring r)
int kBucketCanonicalize(kBucket_pt bucket)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static poly p_Init(const ring r, omBin bin)
poly p_Cleardenom(poly p, const ring r)
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
BOOLEAN rRing_has_CompLastBlock(ring r)
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
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...
void id_Compactify(ideal id, const ring r)
static void line_of_extended_prod(int fixpos, slimgb_alg *c)
BOOLEAN npIsOne(number a, const coeffs r)
static wlen_type pQuality(poly p, slimgb_alg *c, int l=-1)
void kBucketSimpleContent(kBucket_pt bucket)
static void nc_BucketPolyRed_Z(kBucket_pt b, poly p, number *c)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
void enterSBba(LObject &p, int atS, kStrategy strat, int atR)
#define ENLARGE_ALIGN(pointer, type)
poly_list_node * to_destroy
#define pCopy(p)
return a copy of the poly
static int fwbw(red_object *los, int i)
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
void kBucket_Add_q(kBucket_pt bucket, poly q, int *l)
Add to Bucket a poly ,i.e. Bpoly == q+Bpoly.
wlen_type kSBucketLength(kBucket *b, poly lm=NULL)
TODO CoefBuckets bercksichtigen.
SparseRow< number_type > * row