1 #ifndef __JANET_INTERFACE__ 2 #define __JANET_INTERFACE__ 3 4 #include "kernel/structs.h" 5 6 #define GCM(sz) omAlloc((sz)) 7 #define GCMA(sz) omAlloc((sz)) 8 #define GCF(x) omFree((x)) 9 10 #define ListNode struct LISTNODE 11 #define TreeM struct TREEM 12 #define NodeM struct NODEM 13 14 typedef struct 15 { 16 poly root; //poly for parent, NULL for prol 17 kBucket_pt root_b; 18 int root_l; 19 poly history; //parent 20 poly lead; //leading monomial for prolongation 21 char *mult; //[multi].[prol] 22 int changed; 23 int prolonged; //number of prolonged variable for prolongation, otherwise = -1; 24 } Poly; 25 26 typedef void (*poly_function)(Poly *); 27 28 ListNode 29 { 30 Poly *info; 31 ListNode *next; 32 }; 33 34 typedef struct 35 { 36 ListNode *root; 37 } jList; 38 39 NodeM 40 { 41 NodeM *left,*right; 42 Poly *ended; 43 }; 44 45 TreeM 46 { 47 NodeM *root; 48 }; 49 50 typedef ListNode* LCI; 51 typedef ListNode** LI; 52 53 //-------FUNCS---------- 54 Poly* FindMinList(jList *); 55 void DestroyTree(NodeM *); 56 NodeM* create(); 57 //void ForEach(TreeM *,poly_function); 58 void ControlProlong(Poly *); 59 Poly* is_div_(TreeM *root, poly item); 60 void insert_(TreeM **tree, Poly *item); 61 Poly* NewPoly(poly p=NULL); 62 void DestroyPoly(); 63 64 void NFL(Poly *,TreeM *); 65 void PNF(Poly *,TreeM *); 66 void ClearProl(Poly *x, int i); 67 void InitProl(Poly *p); 68 void InitHistory(Poly *p); 69 Poly *is_present(jList *,poly); 70 int GetMult(Poly *,int); 71 int GB_length(); 72 73 void InsertInList(jList *,Poly *); 74 void ForEachPNF(jList *,int); 75 void ClearMult(Poly *,int); 76 void ProlVar(Poly *,int); 77 void SetMult(Poly *,int); 78 void InitLead(Poly *); 79 void InsertInCount(jList *,Poly *); 80 int GetProl(Poly *, int); 81 void SetProl(Poly *, int); 82 int ProlCompare(Poly *, Poly *); 83 int ValidatePoly(Poly *,TreeM *); 84 int ListGreatMoveDegree(jList *,jList *,poly); 85 int ListGreatMoveOrder(jList *,jList *,poly); 86 void ForEachControlProlong(jList *); 87 void NFListQ(); 88 int CountList(jList *); 89 void DestroyList(jList *); 90 91 int ReducePoly(Poly *x,Poly *y); 92 int ReducePolyLead(Poly *x,Poly *y); 93 void Define(TreeM **G); 94 ListNode* CreateListNode(Poly *x); 95 void DestroyListNode(ListNode *x); 96 void DestroyFreeNodes(); 97 98 int ComputeBasis(jList *,jList *); 99 void Initialization(char *); 100 101 #endif //JANET_INTERFACE 102