 |
My Project
UNKNOWN_GIT_VERSION
|
#include <kernel/GBEngine/syz.h>
#include <omalloc/omalloc.h>
#include <coeffs/numbers.h>
#include <kernel/polys.h>
#include <kernel/ideals.h>
#include <vector>
#include <map>
Go to the source code of this file.
|
static void | update_variables (std::vector< bool > &variables, const ideal L) |
|
static bool | check_variables (const std::vector< bool > &variables, const poly m) |
|
static void | initialize_hash (lt_struct **C, const ideal L) |
|
static poly | find_reducer (const poly multiplier, const poly t, const lt_struct *const *const hash_previous_module) |
|
static poly | traverse_tail (const poly multiplier, const int comp, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module) |
|
static poly | compute_image (const poly multiplier, const int comp, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module, const bool use_cache) |
|
static poly | reduce_term (const poly multiplier, const poly term, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module, const bool use_cache) |
|
static void | initialize_cache (const int size) |
|
static void | delete_cache (const int size) |
|
static void | insert_into_cache_term (cache_term *T, const poly multiplier, const poly p) |
|
static poly | get_from_cache_term (const cache_term::const_iterator itr, const poly multiplier) |
|
static poly | lift_ext_LT (const poly a, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module, const bool use_cache) |
|
static void | id_DelDiv_no_test (ideal id) |
|
static poly | syzHeadFrame (const ideal G, const int i, const int j) |
|
static poly | syzHeadExtFrame (const ideal G, const int i, const int j) |
|
static ideal | syzM_i_unsorted (const ideal G, const int i, syzHeadFunction *syzHead) |
|
static ideal | syzM_i_sorted (const ideal G, const int i, syzHeadFunction *syzHead) |
|
static ideal | idConcat (const ideal *M, const int size, const int rank) |
|
static int | compare_comp (const poly p_a, const poly p_b) |
|
static int | compare_deg (const poly p_a, const poly p_b) |
|
static int | compare_lex (const poly p_a, const poly p_b) |
|
static int | compare_Mi (const void *a, const void *b) |
|
static ideal | computeFrame (const ideal G, syzM_i_Function syzM_i, syzHeadFunction *syzHead) |
|
static void | computeLiftings (const resolvente res, const int index, const std::vector< bool > &variables, const bool use_cache) |
|
static bool | contains_unused_variable (const poly m, const std::vector< bool > &variables) |
|
static void | delete_variables (resolvente res, const int index, const std::vector< bool > &variables) |
|
static void | delete_tails (resolvente res, const int index) |
|
static int | computeResolution_iteration (resolvente res, const int max_index, syzHeadFunction *syzHead, const bool do_lifting, const bool single_module, const bool use_cache, const bool use_tensor_trick, std::vector< bool > &variables) |
|
static int | computeResolution (resolvente res, const int max_index, syzHeadFunction *syzHead, const bool do_lifting, const bool single_module, const bool use_cache, const bool use_tensor_trick) |
|
static void | set_options (syzHeadFunction **syzHead_ptr, bool *do_lifting_ptr, bool *single_module_ptr, const char *method) |
|
static void | insert_ext_induced_LTs (const resolvente res, const int length, const bool single_module) |
|
syStrategy | syFrank (const ideal arg, const int length, const char *method, const bool use_cache, const bool use_tensor_trick) |
|
◆ lt_struct
Definition at line 75 of file syz4.cc.
Data Fields |
unsigned long |
comp |
|
poly |
lt |
|
unsigned long |
sev |
|
◆ insert_first_term
#define insert_first_term |
( |
|
r, |
|
|
|
p, |
|
|
|
q, |
|
|
|
R |
|
) |
| |
Value:do \
{ \
p = r; \
pIter(q); \
} \
p->next = q->next; \
} \
} \
while (0)
Definition at line 769 of file syz4.cc.
◆ cache_term
◆ syzHeadFunction
typedef poly syzHeadFunction(ideal, int, int) |
◆ syzM_i_Function
◆ check_variables()
static bool check_variables |
( |
const std::vector< bool > & |
variables, |
|
|
const poly |
m |
|
) |
| |
|
inlinestatic |
Definition at line 50 of file syz4.cc.
60 for (
int j =
R->N;
j > 0;
j--)
◆ compare_comp()
static int compare_comp |
( |
const poly |
p_a, |
|
|
const poly |
p_b |
|
) |
| |
|
static |
Definition at line 502 of file syz4.cc.
507 return (comp_a > comp_b) - (comp_a < comp_b);
◆ compare_deg()
static int compare_deg |
( |
const poly |
p_a, |
|
|
const poly |
p_b |
|
) |
| |
|
static |
Definition at line 510 of file syz4.cc.
513 long deg_a =
p_Deg(p_a, r);
514 long deg_b =
p_Deg(p_b, r);
515 return (deg_a > deg_b) - (deg_a < deg_b);
◆ compare_lex()
static int compare_lex |
( |
const poly |
p_a, |
|
|
const poly |
p_b |
|
) |
| |
|
static |
Definition at line 518 of file syz4.cc.
526 for (
int i = r->N;
i > 0;
i--)
528 cmp = (exp_a[
i] > exp_b[
i]) - (exp_a[
i] < exp_b[
i]);
◆ compare_Mi()
static int compare_Mi |
( |
const void * |
a, |
|
|
const void * |
b |
|
) |
| |
|
static |
Definition at line 537 of file syz4.cc.
539 poly p_a = *((poly *)a);
540 poly p_b = *((poly *)
b);
◆ compute_image()
Definition at line 193 of file syz4.cc.
198 const poly tail = previous_module->m[
comp]->next;
207 hash_previous_module, use_cache);
◆ computeFrame()
Definition at line 555 of file syz4.cc.
558 ideal *
M = (ideal *)
omalloc((
G->ncols-1)*
sizeof(ideal));
559 for (
int i =
G->ncols-2;
i >= 0;
i--)
561 M[
i] = syzM_i(
G,
i+1, syzHead);
564 for (
int i =
G->ncols-2;
i >= 0;
i--)
573 qsort(frame->m, frame->ncols,
sizeof(poly),
compare_Mi);
◆ computeLiftings()
◆ computeResolution()
Definition at line 701 of file syz4.cc.
715 if (use_tensor_trick)
725 do_lifting, single_module, use_cache, use_tensor_trick,
◆ computeResolution_iteration()
Definition at line 664 of file syz4.cc.
685 if (use_tensor_trick)
690 if (
index >= max_index) {
break; }
◆ contains_unused_variable()
static bool contains_unused_variable |
( |
const poly |
m, |
|
|
const std::vector< bool > & |
variables |
|
) |
| |
|
inlinestatic |
Definition at line 609 of file syz4.cc.
613 for (
int j =
R->N;
j > 0;
j--)
◆ delete_cache()
static void delete_cache |
( |
const int |
size | ) |
|
|
static |
Definition at line 238 of file syz4.cc.
244 for (cache_term::iterator itr =
T->begin(); itr !=
T->end(); ++itr)
247 p_Delete(
const_cast<poly*
>(&(itr->first)), r);
◆ delete_tails()
◆ delete_variables()
static void delete_variables |
( |
resolvente |
res, |
|
|
const int |
index, |
|
|
const std::vector< bool > & |
variables |
|
) |
| |
|
static |
Definition at line 627 of file syz4.cc.
635 while (p_iter->next !=
NULL)
◆ find_reducer()
Definition at line 119 of file syz4.cc.
124 unsigned long count =
v[0].comp;
129 const poly q =
p_New(r);
133 for(
unsigned long i = 1;
i <
count;
i++)
◆ get_from_cache_term()
static poly get_from_cache_term |
( |
const cache_term::const_iterator |
itr, |
|
|
const poly |
multiplier |
|
) |
| |
|
static |
◆ id_DelDiv_no_test()
static void id_DelDiv_no_test |
( |
ideal |
id | ) |
|
|
static |
Definition at line 327 of file syz4.cc.
332 for (
i =
k;
i >= 0;
i--)
334 for (
j =
k;
j >
i;
j--)
336 if (id->m[
j] !=
NULL)
◆ idConcat()
◆ initialize_cache()
static void initialize_cache |
( |
const int |
size | ) |
|
|
static |
◆ initialize_hash()
Definition at line 81 of file syz4.cc.
84 const unsigned long n_elems = L->ncols;
86 = (
unsigned int *)
omAlloc0((L->rank+1)*
sizeof(
unsigned int));
93 for (
int i = 0;
i <= L->rank;
i++)
104 const poly a = L->m[
k-1];
◆ insert_ext_induced_LTs()
◆ insert_into_cache_term()
◆ lift_ext_LT()
Definition at line 298 of file syz4.cc.
306 hash_previous_module, use_cache);
311 previous_module,
variables, hash_previous_module);
314 previous_module,
variables, hash_previous_module,
false);
◆ reduce_term()
Definition at line 165 of file syz4.cc.
181 hash_previous_module);
184 hash_previous_module,
false);
◆ set_options()
static void set_options |
( |
syzHeadFunction ** |
syzHead_ptr, |
|
|
bool * |
do_lifting_ptr, |
|
|
bool * |
single_module_ptr, |
|
|
const char * |
method |
|
) |
| |
|
static |
Definition at line 732 of file syz4.cc.
735 if (strcmp(method,
"complete") == 0)
738 *do_lifting_ptr =
true;
739 *single_module_ptr =
false;
741 else if (strcmp(method,
"frame") == 0)
744 *do_lifting_ptr =
false;
745 *single_module_ptr =
false;
747 else if (strcmp(method,
"extended frame") == 0)
750 *do_lifting_ptr =
false;
751 *single_module_ptr =
false;
753 else if (strcmp(method,
"single module") == 0)
756 *do_lifting_ptr =
true;
757 *single_module_ptr =
true;
761 *do_lifting_ptr =
true;
762 *single_module_ptr =
false;
◆ syFrank()
Definition at line 823 of file syz4.cc.
828 if (strcmp(method,
"frame") != 0)
839 set_options(&syzHead, &do_lifting, &single_module, method);
841 single_module, use_cache, use_tensor_trick);
845 (new_length+1)*
sizeof(ideal));
847 if (strcmp(method,
"frame") != 0)
852 result->length = new_length;
853 result->list_length = new_length;
◆ syzHeadExtFrame()
Definition at line 381 of file syz4.cc.
384 const poly f_i =
G->m[
i];
385 const poly f_j =
G->m[
j];
388 poly head_ext =
p_Init(r);
391 long exp_i, exp_j,
lcm;
392 for (
int k = (
int)r->N;
k > 0;
k--)
404 head->next = head_ext;
◆ syzHeadFrame()
Definition at line 357 of file syz4.cc.
360 const poly f_i =
G->m[
i];
361 const poly f_j =
G->m[
j];
364 long exp_i, exp_j,
lcm;
365 for (
int k = (
int)r->N;
k > 0;
k--)
◆ syzM_i_sorted()
◆ syzM_i_unsorted()
Definition at line 415 of file syz4.cc.
422 for (
int j =
i-1;
j >= 0;
j--)
430 for (
int j =
i-1;
j >= 0;
j--)
434 M_i->m[
k] = syzHead(
G,
i,
j);
◆ traverse_tail()
Definition at line 279 of file syz4.cc.
284 cache_term::const_iterator itr =
T->find(multiplier);
290 hash_previous_module,
true);
◆ update_variables()
static void update_variables |
( |
std::vector< bool > & |
variables, |
|
|
const ideal |
L |
|
) |
| |
|
static |
Definition at line 22 of file syz4.cc.
25 const int l = L->ncols-1;
27 for (
int j =
R->N;
j > 0;
j--)
31 for (
k =
l;
k >= 0;
k--)
◆ Cache
static void delete_variables(resolvente res, const int index, const std::vector< bool > &variables)
static BOOLEAN _p_LmDivisibleByNoComp(poly a, poly b, const ring r)
return: FALSE, if there exists i, such that a->exp[i] > b->exp[i] TRUE, otherwise (1) Consider long v...
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
#define p_MemSum_LengthGeneral(r, s1, s2, length)
static ideal idConcat(const ideal *M, const int size, const int rank)
static ideal syzM_i_unsorted(const ideal G, const int i, syzHeadFunction *syzHead)
static void insert_into_cache_term(cache_term *T, const poly multiplier, const poly p)
#define p_SetCoeff0(p, n, r)
static int computeResolution_iteration(resolvente res, const int max_index, syzHeadFunction *syzHead, const bool do_lifting, const bool single_module, const bool use_cache, const bool use_tensor_trick, std::vector< bool > &variables)
static poly compute_image(const poly multiplier, const int comp, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module, const bool use_cache)
static void p_ExpVectorDiff(poly pr, poly p1, poly p2, const ring r)
static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
multiplication of 'a' and 'b'; replacement of 'a' by the product a*b
#define insert_first_term(r, p, q, R)
static poly p_Head(poly p, const ring r)
static ideal syzM_i_sorted(const ideal G, const int i, syzHeadFunction *syzHead)
static BOOLEAN length(leftv result, leftv arg)
static void initialize_hash(lt_struct **C, const ideal L)
#define __p_GetComp(p, r)
static void p_MemAdd_NegWeightAdjust(poly p, const ring r)
static bool contains_unused_variable(const poly m, const std::vector< bool > &variables)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static void set_options(syzHeadFunction **syzHead_ptr, bool *do_lifting_ptr, bool *single_module_ptr, const char *method)
static poly lift_ext_LT(const poly a, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module, const bool use_cache)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static poly get_from_cache_term(const cache_term::const_iterator itr, const poly multiplier)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static unsigned pLength(poly a)
static poly p_Copy(poly p, const ring r)
returns a copy of p
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static poly traverse_tail(const poly multiplier, const int comp, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module)
static void delete_tails(resolvente res, const int index)
static void insert_ext_induced_LTs(const resolvente res, const int length, const bool single_module)
static bool check_variables(const std::vector< bool > &variables, const poly m)
static int computeResolution(resolvente res, const int max_index, syzHeadFunction *syzHead, const bool do_lifting, const bool single_module, const bool use_cache, const bool use_tensor_trick)
static int compare_comp(const poly p_a, const poly p_b)
#define omFreeSize(addr, size)
void sBucket_Add_p(sBucket_pt bucket, poly p, int length)
adds poly p to bucket destroys p!
static poly find_reducer(const poly multiplier, const poly t, const lt_struct *const *const hash_previous_module)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
sBucket_pt sBucketCreate(const ring r)
static poly p_New(const ring, omBin bin)
static void update_variables(std::vector< bool > &variables, const ideal L)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static BOOLEAN p_DivisibleBy(poly a, poly b, const ring r)
static void p_GetExpV(poly p, int *ev, const ring r)
static poly p_Init(const ring r, omBin bin)
static int p_LmCmp(poly p, poly q, const ring r)
static poly syzHeadExtFrame(const ideal G, const int i, const int j)
static ideal computeFrame(const ideal G, syzM_i_Function syzM_i, syzHeadFunction *syzHead)
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
static poly syzHeadFrame(const ideal G, const int i, const int j)
static void p_LmFree(poly p, ring)
long p_Deg(poly a, const ring r)
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
static void computeLiftings(const resolvente res, const int index, const std::vector< bool > &variables, const bool use_cache)
static int si_max(const int a, const int b)
std::map< poly, poly, cache_compare > cache_term
static void initialize_cache(const int size)
ideal idInit(int idsize, int rank)
initialise an ideal / module
static int compare_lex(const poly p_a, const poly p_b)
static void id_DelDiv_no_test(ideal id)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void sBucketClearAdd(sBucket_pt bucket, poly *p, int *length)
static void p_Setm(poly p, const ring r)
static int compare_Mi(const void *a, const void *b)
const Variable & v
< [in] a sqrfree bivariate poly
static int compare_deg(const poly p_a, const poly p_b)
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
const CanonicalForm int s
int status int void size_t count
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
poly syzHeadFunction(ideal, int, int)
Class Cache is a template-implementation of a cache with arbitrary classes for representing keys and ...
int comp(const CanonicalForm &A, const CanonicalForm &B)
compare polynomials
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
void sBucketDestroy(sBucket_pt *bucket)
#define omFreeBin(addr, bin)
unsigned long p_GetShortExpVector(const poly p, const ring r)
static void delete_cache(const int size)
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
static int index(p_Length length, p_Ord ord)
static cache_term * Cache
static poly p_Mult_nn(poly p, number n, const ring r)
static poly reduce_term(const poly multiplier, const poly term, const ideal previous_module, const std::vector< bool > &variables, const lt_struct *const *const hash_previous_module, const bool use_cache)
#define omReallocSize(addr, o_size, size)