#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <coeffs/numbers.h>
#include <polys/monomials/ring.h>
#include <polys/monomials/p_polys.h>
#include <polys/kbuckets.h>
#include <kernel/ideals.h>
#include <kernel/polys.h>
#include <kernel/GBEngine/kutil.h>
#include <kernel/GBEngine/janet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <time.h>
Go to the source code of this file.
|
int | ReducePolyLead (Poly *x, Poly *y) |
|
int | ReducePoly (Poly *x, poly from, Poly *y) |
|
void | PNF (Poly *p, TreeM *F) |
|
void | NFL (Poly *p, TreeM *F) |
|
int | ValidatePoly (Poly *x, TreeM *) |
|
Poly * | NewPoly (poly p) |
|
void | DestroyPoly (Poly *x) |
|
void | ControlProlong (Poly *x) |
|
void | InitHistory (Poly *p) |
|
void | InitLead (Poly *p) |
|
void | InitProl (Poly *p) |
|
int | GetMult (Poly *x, int i) |
|
void | SetMult (Poly *x, int i) |
|
void | ClearMult (Poly *x, int i) |
|
int | GetProl (Poly *x, int i) |
|
void | SetProl (Poly *x, int i) |
|
void | ClearProl (Poly *x, int i) |
|
int | LengthCompare (poly p1, poly p2) |
|
int | ProlCompare (Poly *item1, Poly *item2) |
|
void | ProlVar (Poly *temp, int i) |
|
void | DestroyListNode (ListNode *x) |
|
ListNode * | CreateListNode (Poly *x) |
|
Poly * | FindMinList (jList *L) |
|
void | InsertInList (jList *x, Poly *y) |
|
void | InsertInCount (jList *x, Poly *y) |
|
int | ListGreatMoveOrder (jList *A, jList *B, poly x) |
|
int | ListGreatMoveDegree (jList *A, jList *B, poly x) |
|
int | CountList (jList *Q) |
|
void | NFListQ () |
|
void | ForEachPNF (jList *x, int i) |
|
void | ForEachControlProlong (jList *x) |
|
void | DestroyList (jList *x) |
|
Poly * | is_present (jList *F, poly x) |
|
int | GB_length () |
|
NodeM * | create () |
|
void | DestroyFreeNodes () |
|
void | DestroyTree (NodeM *G) |
|
void | Define (TreeM **G) |
|
int | sp_div (poly m1, poly m2, int from) |
|
void | div_l (poly item, NodeM *x, int from) |
|
Poly * | is_div_upper (poly item, NodeM *x, int from) |
|
Poly * | is_div_ (TreeM *tree, poly item) |
|
static void | ClearMultiplicative (NodeM *xx, int i) |
|
void | insert_ (TreeM **tree, Poly *item) |
|
void | Initialization (char *Ord) |
|
void | T2G () |
|
int | ComputeBasis (jList *_lT, jList *_lQ) |
|
§ pow_
§ ClearMult()
void ClearMult |
( |
Poly * |
x, |
|
|
int |
i |
|
) |
| |
§ ClearMultiplicative()
static void ClearMultiplicative |
( |
NodeM * |
xx, |
|
|
int |
i |
|
) |
| |
|
static |
Definition at line 901 of file janet.cc.
910 if ((xx->ended) && (
GetMult(xx->ended,
i)))
static void ClearMultiplicative(NodeM *xx, int i)
void ClearMult(Poly *x, int i)
void ProlVar(Poly *temp, int i)
int GetMult(Poly *x, int i)
§ ClearProl()
void ClearProl |
( |
Poly * |
x, |
|
|
int |
i |
|
) |
| |
§ ComputeBasis()
Definition at line 1007 of file janet.cc.
1043 WarnS(
"Constant in basis\n");
static int degree_compatible
void insert_(TreeM **tree, Poly *item)
Poly * FindMinList(jList *L)
static int(* ListGreatMove)(jList *, jList *, poly)
void ControlProlong(Poly *x)
int ValidatePoly(Poly *x, TreeM *)
void DestroyPoly(Poly *x)
#define pIsConstant(p)
like above, except that Comp might be != 0
void InsertInList(jList *x, Poly *y)
void ForEachPNF(jList *x, int i)
void ForEachControlProlong(jList *x)
void DestroyTree(NodeM *G)
void PNF(Poly *p, TreeM *F)
void NFL(Poly *p, TreeM *F)
§ ControlProlong()
void ControlProlong |
( |
Poly * |
x | ) |
|
§ CountList()
int CountList |
( |
jList * |
Q | ) |
|
Definition at line 624 of file janet.cc.
const CanonicalForm int const CFList const Variable & y
§ create()
Definition at line 764 of file janet.cc.
778 y->left=y->right=
NULL;
const CanonicalForm int const CFList const Variable & y
§ CreateListNode()
§ Define()
void Define |
( |
TreeM ** |
G | ) |
|
§ DestroyFreeNodes()
void DestroyFreeNodes |
( |
| ) |
|
Definition at line 783 of file janet.cc.
const CanonicalForm int const CFList const Variable & y
§ DestroyList()
void DestroyList |
( |
jList * |
x | ) |
|
Definition at line 721 of file janet.cc.
const CanonicalForm int const CFList const Variable & y
void DestroyPoly(Poly *x)
§ DestroyListNode()
Definition at line 509 of file janet.cc.
void DestroyPoly(Poly *x)
§ DestroyPoly()
void DestroyPoly |
( |
Poly * |
x | ) |
|
Definition at line 390 of file janet.cc.
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
§ DestroyTree()
void DestroyTree |
( |
NodeM * |
G | ) |
|
Definition at line 811 of file janet.cc.
void DestroyTree(NodeM *G)
§ div_l()
void div_l |
( |
poly |
item, |
|
|
NodeM * |
x, |
|
|
int |
from |
|
) |
| |
Definition at line 839 of file janet.cc.
844 if ((
x->ended) &&
sp_div(item,
x->ended->root,from))
849 div_l(item,
x->right,from);
void div_l(poly item, NodeM *x, int from)
int sp_div(poly m1, poly m2, int from)
§ FindMinList()
Definition at line 524 of file janet.cc.
533 while ((*min) && ((*min)->info->root ==
NULL))
537 if (!(*min))
return NULL;
543 if ((*l)->info->root !=
NULL)
static int degree_compatible
static int min(int a, int b)
int ProlCompare(Poly *item1, Poly *item2)
§ ForEachControlProlong()
void ForEachControlProlong |
( |
jList * |
x | ) |
|
Definition at line 710 of file janet.cc.
const CanonicalForm int const CFList const Variable & y
void ControlProlong(Poly *x)
§ ForEachPNF()
void ForEachPNF |
( |
jList * |
x, |
|
|
int |
i |
|
) |
| |
Definition at line 699 of file janet.cc.
705 if (
pow_(y->info->root) ==
i)
PNF(y->info,
G);
const CanonicalForm int const CFList const Variable & y
void PNF(Poly *p, TreeM *F)
§ GB_length()
Definition at line 747 of file janet.cc.
754 if (
pow_(iT->info->lead) ==
pow_(iT->info->history))
§ GetMult()
int GetMult |
( |
Poly * |
x, |
|
|
int |
i |
|
) |
| |
§ GetProl()
int GetProl |
( |
Poly * |
x, |
|
|
int |
i |
|
) |
| |
§ InitHistory()
void InitHistory |
( |
Poly * |
p | ) |
|
Definition at line 409 of file janet.cc.
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
§ Initialization()
void Initialization |
( |
char * |
Ord | ) |
|
Definition at line 959 of file janet.cc.
962 if (strstr(Ord,
"dp\0") || strstr(Ord,
"Dp\0"))
static int degree_compatible
int ListGreatMoveDegree(jList *A, jList *B, poly x)
static long p_Totaldegree(poly p, const ring r)
static int(* ListGreatMove)(jList *, jList *, poly)
int ListGreatMoveOrder(jList *A, jList *B, poly x)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
long p_Deg(poly a, const ring r)
§ InitLead()
void InitLead |
( |
Poly * |
p | ) |
|
Definition at line 416 of file janet.cc.
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
§ InitProl()
void InitProl |
( |
Poly * |
p | ) |
|
§ insert_()
Definition at line 919 of file janet.cc.
922 NodeM *curr=(*tree)->root;
924 for ( ; (i_con>=0) && !
pGetExp(item->
root,i_con+1) ; i_con--)
927 for (i = 0; i<= i_con; i++)
948 if (!curr->left)
SetMult(item,i);
949 if (!curr->right) curr->right=
create();
static void ClearMultiplicative(NodeM *xx, int i)
void ClearMult(Poly *x, int i)
void ProlVar(Poly *temp, int i)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
void SetMult(Poly *x, int i)
§ InsertInCount()
Definition at line 578 of file janet.cc.
ListNode * CreateListNode(Poly *x)
§ InsertInList()
Definition at line 559 of file janet.cc.
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
ListNode * CreateListNode(Poly *x)
§ is_div_()
Definition at line 860 of file janet.cc.
863 NodeM *curr=tree->root;
865 if (!curr)
return NULL;
868 for ( ; i_con>=0 && !
pGetExp(item,i_con+1) ; i_con--)
871 for (i=0; i <= i_con ; i++)
877 if (curr->ended)
return curr->ended;
890 if (curr->ended)
return curr->ended;
892 if (!curr->right)
return NULL;
897 if (curr->ended)
return curr->ended;
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
Poly * is_div_upper(poly item, NodeM *x, int from)
§ is_div_upper()
Definition at line 853 of file janet.cc.
void div_l(poly item, NodeM *x, int from)
§ is_present()
Definition at line 736 of file janet.cc.
740 if (
pLmCmp(iF->info->root,
x) == 0)
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
§ LengthCompare()
§ ListGreatMoveDegree()
Definition at line 606 of file janet.cc.
611 if (!y ||
pow_(y->info->lead) <= pow_x)
return 0;
613 while(y &&
pow_(y->info->lead) > pow_x)
const CanonicalForm int const CFList const Variable & y
void InsertInCount(jList *x, Poly *y)
§ ListGreatMoveOrder()
Definition at line 589 of file janet.cc.
593 if (!y ||
pLmCmp(y->info->lead,
x) < 0)
return 0;
595 while(y &&
pLmCmp(y->info->lead,
x) >= 0)
const CanonicalForm int const CFList const Variable & y
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
void InsertInCount(jList *x, Poly *y)
§ NewPoly()
Definition at line 368 of file janet.cc.
void ClearMult(Poly *x, int i)
void ClearProl(Poly *x, int i)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
§ NFL()
Definition at line 195 of file janet.cc.
243 if ((pX == pF) && (pF == phF))
268 pSimpleContent(p->
root,old_size);
int status int void size_t count
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
int ReducePolyLead(Poly *x, Poly *y)
void p_SimpleContent(poly ph, int smax, const ring r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Poly * is_div_(TreeM *tree, poly item)
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void kBucketDestroy(kBucket_pt *bucket_pt)
void p_Content(poly ph, const ring r)
void InitHistory(Poly *p)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
§ NFListQ()
Definition at line 638 of file janet.cc.
654 int ploc=
pow_(ll->info->lead);
655 if (ploc < p) p=ploc;
666 int ploc=
pow_((*l)->info->lead);
678 (*l)->info->changed=0;
682 if (!(*l)->info->root)
void DestroyListNode(ListNode *x)
int ValidatePoly(Poly *x, TreeM *)
void NFL(Poly *p, TreeM *F)
§ PNF()
Definition at line 151 of file janet.cc.
int status int void size_t count
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Poly * is_div_(TreeM *tree, poly item)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
int ReducePoly(Poly *x, poly from, Poly *y)
void p_Content(poly ph, const ring r)
§ ProlCompare()
int ProlCompare |
( |
Poly * |
item1, |
|
|
Poly * |
item2 |
|
) |
| |
Definition at line 470 of file janet.cc.
int LengthCompare(poly p1, poly p2)
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
§ ProlVar()
void ProlVar |
( |
Poly * |
temp, |
|
|
int |
i |
|
) |
| |
Definition at line 487 of file janet.cc.
void SetProl(Poly *x, int i)
int GetMult(Poly *x, int i)
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
void InsertInCount(jList *x, Poly *y)
int GetProl(Poly *x, int i)
§ ReducePoly()
Definition at line 127 of file janet.cc.
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
§ ReducePolyLead()
int ReducePolyLead |
( |
Poly * |
x, |
|
|
Poly * |
y |
|
) |
| |
Definition at line 81 of file janet.cc.
void kBucketInit(kBucket_pt bucket, poly lm, int length)
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
const poly kBucketGetLm(kBucket_pt bucket)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void kBucketDestroy(kBucket_pt *bucket_pt)
static unsigned pLength(poly a)
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
§ SetMult()
void SetMult |
( |
Poly * |
x, |
|
|
int |
i |
|
) |
| |
§ SetProl()
void SetProl |
( |
Poly * |
x, |
|
|
int |
i |
|
) |
| |
§ sp_div()
int sp_div |
( |
poly |
m1, |
|
|
poly |
m2, |
|
|
int |
from |
|
) |
| |
Definition at line 828 of file janet.cc.
831 if (
pow_(m2) == 0 &&
pow_(m1))
return 0;
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
§ T2G()
Definition at line 1092 of file janet.cc.
void insert_(TreeM **tree, Poly *item)
§ ValidatePoly()
Definition at line 306 of file janet.cc.
311 if (x->
root)
return 1;
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Poly * is_present(jList *F, poly x)
#define pCopy(p)
return a copy of the poly
§ degree_compatible
§ FreeNodes
§ jDeg
§ ListGreatMove
§ Mask
int Mask[8] ={0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x1} |
|
static |
§ offset
§ temp_l