29#define NORO_SPARSE_ROWS_PRE 1
30#define NORO_NON_POLY 1
37#ifdef HAVE_BOOST_DYNAMIC_BITSET_HPP
44using boost::dynamic_bitset;
233 #ifdef TGB_RESORT_PAIRS
268 #ifdef TGB_RESORT_PAIRS
409#define slim_prec_cast(a) (unsigned int) (unsigned long) (a)
410#define F4mat_to_number_type(a) (number_type) slim_prec_cast(a)
534 #ifdef NORO_SPARSE_ROWS_PRE
547 #ifdef NORO_SPARSE_ROWS_PRE
584#ifdef NORO_RED_ARRAY_RESERVER
617 #ifdef NORO_SPARSE_ROWS_PRE
642#ifdef NORO_RED_ARRAY_RESERVER
661#ifdef NORO_RED_ARRAY_RESERVER
682#ifdef NORO_RED_ARRAY_RESERVER
705 #ifdef NORO_SPARSE_ROWS_PRE
827for(
i=0;
i<
cache->nIrreducibleMonomials;
i++)
832 res->idx_array[pos]=
i;
896 int*
const idx_array=row->idx_array;
897 const int len=row->len;
902 for(
j=0;
j<len;
j=
j+256)
904 const int bound=std::min(
j+256,len);
909 buffer[
bpos++]=coef_array[
i];
918 buffer[
i]=buffer[
i]%prime;
923 int idx=idx_array[
i];
950 for(
j=0;
j<len;
j=
j+256)
952 const int bound=std::min(
j+256,len);
957 buffer[
bpos++]=coef_array[
i];
966 buffer[
i]=buffer[
i]%prime;
1043 int*
const idx_array=row->idx_array;
1044 const int len=row->len;
1047 int idx=idx_array[
j];
1063 int*
const idx_array=row->idx_array;
1064 const int len=row->len;
1067 int idx=idx_array[
j];
1143 for(
i=0;
i<
cache->nIrreducibleMonomials;
i++)
1183 ci.idx=idx_array[
j];
1193 if (coef_array[
j]!=0)
1210 if (coef_array[
j]!=0)
1214 ci.coef=coef_array[
j];
1228 if (coef_array[
j]!=0)
1246 ci.coef=coef_array[
j];
1247 ci.idx=idx_array[
j];
1260 ci.idx=idx_array[
j];
1271 if ((red.ref) &&( red.ref->row))
1292 if ((red.ref) &&( red.ref->row))
1295 int* idx_array=red.ref->row->idx_array;
1297 int rlen=red.ref->row->len;
1342 ci.idx=red.ref->term_index;
1381 int* idx_array=
res->idx_array;
1411 if ((red.ref) && (red.ref->row))
1468 for(
j=
tn-1;
j>=0;
j--)
1470 if (!(zero==(row[
j])))
1716 this->startIndices=
p.startIndices;
1718 this->ncols=
p.ncols;
1719 this->nrows=
p.nrows;
1846 while(
mat.findPivot(r,c))
1849 mat.reduceOtherRowsForward(r);
1881 std::vector<DataNoroCacheNode<number_type>*>
irr_nodes;
1886 cache.nIrreducibleMonomials=n;
1889 Print(
"Irred Mon:%d\n",n);
1890 Print(
"red Mon:%d\n",
cache.nReducibleMonomials);
1932 int*
const idx_array=
srow->idx_array;
1934 const int len=
srow->len;
1935 if (
srow->idx_array)
1971 #ifdef NORO_NON_POLY
1982 for(
i=0;
i<root.branches_len;
i++)
1984 collectIrreducibleMonomials(1,root.branches[
i],
res);
1990 if (node==
NULL)
return;
2002 if (
dn->value_len==backLinkCode)
static int si_max(const int a, const int b)
static CanonicalForm bound(const CFMatrix &M)
bool operator<(const CoefIdx< number_type > &other) const
DataNoroCacheNode(SparseRow< number_type > *row)
DataNoroCacheNode(poly p, int len)
SparseRow< number_type > * row
void updateLastReducibleIndex(int r, int upper_bound)
void multiplyRow(int row, number_type coef)
void backwardSubstitute()
int * lastReducibleIndices
void backwardSubstitute(int r)
ModPMatrixProxyOnArray(number_type *array, int nnrows, int nncols)
int getStartIndex(int row)
BOOLEAN findPivot(int &r, int &c)
void reduceOtherRowsForward(int r)
void permRows(int i, int j)
~ModPMatrixProxyOnArray()
void multiplyRow(int row, number_type coef)
void updateStartIndex(int row, int lower_bound)
DataNoroCacheNode< number_type > * ref
NoroCacheNode ** branches
NoroCacheNode * getBranch(int branch)
NoroCacheNode * getOrInsertBranch(int branch)
NoroCacheNode * setNode(int branch, NoroCacheNode *node)
int nIrreducibleMonomials
DataNoroCacheNode< number_type > * treeInsert(poly term, poly nf, int len)
DataNoroCacheNode< number_type > * treeInsert(poly term, SparseRow< number_type > *srow)
void ensureTempBufferSize(size_t size)
DataNoroCacheNode< number_type > * getCacheReference(poly term)
poly lookup(poly term, BOOLEAN &succ, int &len)
DataNoroCacheNode< number_type > * insertAndTransferOwnerShip(poly t, ring)
std::vector< PolySimple > poly_vec
DataNoroCacheNode< number_type > * treeInsertBackLink(poly term)
DataNoroCacheNode< number_type > * insert(poly term, SparseRow< number_type > *srow)
DataNoroCacheNode< number_type > * insert(poly term, poly nf, int len)
void collectIrreducibleMonomials(std::vector< DataNoroCacheNode< number_type > * > &res)
static const int backLinkCode
bool operator==(const PolySimple &other)
PolySimple(const PolySimple &a)
PolySimple & operator=(const PolySimple &p2)
bool operator<(const PolySimple &other) const
wlen_type initial_quality
wlen_type guess_quality(slimgb_alg *c)
void adjust_coefs(number c_r, number c_ac_r)
makes on each red_object in a region a single_step
virtual ~reduction_step()
virtual void reduce(red_object *r, int l, int u)
we assume that all occurring red_objects have same lm, and all occ. lm's in r[l......
virtual void pre_reduce(red_object *r, int l, int u)
simple_reducer(poly pp, int pp_len, int pp_reducer_deg, slimgb_alg *pp_c=NULL)
virtual void reduce(red_object *r, int l, int u)
we assume that all occurring red_objects have same lm, and all occ. lm's in r[l......
virtual void do_reduce(red_object &ro)
unsigned long pTotaldegree(poly p)
int_pair_node * soon_free
sorted_pair_node ** apairs
BOOLEAN use_noro_last_block
int extended_product_crit
sorted_pair_node ** tmp_spn
void introduceDelayedPairs(poly *pa, int s)
unsigned int reduction_steps
poly_array_list * F_minus
slimgb_alg(ideal I, int syz_comp, BOOLEAN F4, int deg_pos)
void cleanDegs(int lower, int upper)
int syz_comp
array_lengths should be greater equal n;
int pTotaldegree_full(poly p)
BOOLEAN eliminationProblem
wlen_type * weighted_lengths
poly_list_node * to_destroy
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static BOOLEAN pa(leftv res, leftv args)
const CanonicalForm int s
static BOOLEAN length(leftv result, leftv arg)
static BOOLEAN npIsOne(number a, const coeffs)
static number npAddM(number a, number b, const coeffs r)
static number npMultM(number a, number b, const coeffs r)
static number npNegM(number a, const coeffs r)
static number npInversM(number c, const coeffs r)
static number npSubM(number a, number b, const coeffs r)
static number npInit(long i, const coeffs r)
static number nvMult(number a, number b, const coeffs r)
static number npMult(number a, number b, const coeffs r)
static BOOLEAN npIsZero(number a, const coeffs r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
#define omrealloc(addr, size)
unsigned long p_GetShortExpVector(const poly p, const ring r)
static int pLength(poly a)
static poly p_LmInit(poly p, const ring r)
static poly pp_Mult_mm(poly p, poly m, const ring r)
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
static int p_LmCmp(poly p, poly q, const ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static void p_Delete(poly *p, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_Totaldegree(poly p, const ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
void write_minus_coef_idx_to_buffer_dense(CoefIdx< number_type > *const pairs, int &pos, number_type *const coef_array, const int rlen)
void add_dense(number_type *const temp_array, int, const number_type *row, int len)
int tgb_pair_better_gen2(const void *ap, const void *bp)
void write_minus_coef_idx_to_buffer(CoefIdx< number_type > *const pairs, int &pos, int *const idx_array, number_type *const coef_array, const int rlen)
MonRedResNP< number_type > noro_red_mon_to_non_poly(poly t, NoroCache< number_type > *cache, slimgb_alg *c)
sorted_pair_node ** spn_merge(sorted_pair_node **p, int pn, sorted_pair_node **q, int qn, slimgb_alg *c)
void now_t_rep(const int &arg_i, const int &arg_j, slimgb_alg *c)
void clean_top_of_pair_list(slimgb_alg *c)
void simplest_gauss_modp(number_type *a, int nrows, int ncols)
SparseRow< number_type > * noro_red_to_non_poly_dense(MonRedResNP< number_type > *mon, int len, NoroCache< number_type > *cache)
SparseRow< number_type > * noro_red_to_non_poly_sparse(MonRedResNP< number_type > *mon, int len, NoroCache< number_type > *cache)
ideal do_t_rep_gb(ring r, ideal arg_I, int syz_comp, BOOLEAN F4_mode, int deg_pos)
sorted_pair_node ** add_to_basis_ideal_quotient(poly h, slimgb_alg *c, int *ip)
int slim_nsize(number n, ring r)
void write_coef_idx_to_buffer(CoefIdx< number_type > *const pairs, int &pos, int *const idx_array, number_type *const coef_array, const int rlen)
void write_poly_to_row(number_type *row, poly h, poly *terms, int tn)
void sub_dense(number_type *const temp_array, int, const number_type *row, int len)
void add_coef_times_sparse(number_type *const temp_array, int, SparseRow< number_type > *row, number coef)
int pos_helper(kStrategy strat, poly p, len_type len, set_type setL, polyset set)
sorted_pair_node * quick_pop_pair(slimgb_alg *c)
int kFindDivisibleByInS_easy(kStrategy strat, const red_object &obj)
sorted_pair_node * top_pair(slimgb_alg *c)
poly row_to_poly(number_type *row, poly *terms, int tn, ring r)
void sub_sparse(number_type *const temp_array, int, SparseRow< number_type > *row)
SparseRow< number_type > * noro_red_to_non_poly_t(poly p, int &len, NoroCache< number_type > *cache, slimgb_alg *c)
wlen_type expected_length
void write_coef_times_xx_idx_to_buffer(CoefIdx< number_type > *const pairs, int &pos, int *const idx_array, number_type *const coef_array, const int rlen, const number coef)
#define F4mat_to_number_type(a)
SparseRow< number_type > * convert_to_sparse_row(number_type *temp_array, int temp_size, int non_zeros)
void add_sparse(number_type *const temp_array, int, SparseRow< number_type > *row)
DataNoroCacheNode< number_type > * node
int modP_lastIndexRow(number_type *row, int ncols)
void add_coef_times_dense(number_type *const temp_array, int, const number_type *row, int len, number coef)
unsigned short tgb_uint16
void free_sorted_pair_node(sorted_pair_node *s, const ring r)
void noro_step(poly *p, int &pn, slimgb_alg *c)
int terms_sort_crit(const void *a, const void *b)
void write_coef_times_xx_idx_to_buffer_dense(CoefIdx< number_type > *const pairs, int &pos, number_type *const coef_array, const int rlen, const number coef)
int term_nodes_sort_crit(const void *a, const void *b)
void write_coef_idx_to_buffer_dense(CoefIdx< number_type > *const pairs, int &pos, number_type *const coef_array, const int rlen)