#include "kernel/mod2.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()
Definition at line 431 of file janet.cc.
432{
433 x->mult[
i/8] &= ~Mask[
i%8];
434}
◆ ClearMultiplicative()
Definition at line 894 of file janet.cc.
895{
897
899 {
902 }
904 {
907 }
908 else
910}
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()
◆ ComputeBasis()
Definition at line 1000 of file janet.cc.
1001{
1002
1003
1005
1006
1007
1009 {
1010
1011
1012
1014 {
1016 {
1018 continue;
1019 }
1020
1022
1024
1026 {
1028 continue;
1029 }
1030 }
1031
1033 {
1035 {
1036 WarnS(
"Constant in basis\n");
1037 return 0;
1038 }
1039
1041 {
1042
1046 }
1047 }
1048
1049
1051
1054
1055
1058
1059
1062 else
1064
1065
1066
1067
1070
1071 }
1072
1073
1074
1076
1077
1081
1082 return 1;
1083}
void ForEachControlProlong(jList *x)
void DestroyTree(NodeM *G)
int ValidatePoly(Poly *x, TreeM *)
void ControlProlong(Poly *x)
void InsertInList(jList *x, Poly *y)
void ForEachPNF(jList *x, int i)
Poly * FindMinList(jList *L)
void NFL(Poly *p, TreeM *F)
STATIC_VAR int degree_compatible
void PNF(Poly *p, TreeM *F)
STATIC_VAR int(* ListGreatMove)(jList *, jList *, poly)
void insert_(TreeM **tree, Poly *item)
#define pIsConstant(p)
like above, except that Comp must be 0
◆ ControlProlong()
Definition at line 392 of file janet.cc.
393{
395 {
397
398
399 }
400}
◆ CountList()
Definition at line 617 of file janet.cc.
618{
621
623 {
626 }
627
629}
const CanonicalForm int const CFList const Variable & y
◆ create()
Definition at line 757 of file janet.cc.
758{
760
762 {
764 }
765 else
766 {
769 }
770
774}
STATIC_VAR NodeM * FreeNodes
◆ CreateListNode()
◆ Define()
◆ DestroyFreeNodes()
void DestroyFreeNodes |
( |
| ) |
|
Definition at line 776 of file janet.cc.
777{
779
781 {
784 }
785}
◆ DestroyList()
Definition at line 714 of file janet.cc.
715{
717
719 {
724 }
725
727}
◆ DestroyListNode()
◆ DestroyPoly()
Definition at line 383 of file janet.cc.
384{
390}
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
◆ DestroyTree()
◆ div_l()
Definition at line 832 of file janet.cc.
833{
835 {
837 if ((
x->ended) &&
sp_div(item,
x->ended->root,from))
838 {
840 return;
841 };
842 div_l(item,
x->right,from);
843 }
844}
int sp_div(poly m1, poly m2, int from)
void div_l(poly item, NodeM *x, int from)
◆ FindMinList()
Definition at line 517 of file janet.cc.
518{
523
525 {
526 while ((*
min) && ((*min)->info->root ==
NULL))
528 }
529
531
533
535 {
536 if ((*l)->info->root !=
NULL)
537 {
540 }
541
543 }
548
550}
static int min(int a, int b)
int ProlCompare(Poly *item1, Poly *item2)
◆ ForEachControlProlong()
Definition at line 703 of file janet.cc.
704{
706
708 {
711 }
712}
◆ ForEachPNF()
Definition at line 692 of file janet.cc.
693{
695
697 {
700 }
701}
◆ GB_length()
Definition at line 740 of file janet.cc.
741{
744
746 {
750 }
751
753}
◆ GetMult()
◆ GetProl()
◆ InitHistory()
Definition at line 402 of file janet.cc.
403{
407}
#define pLmInit(p)
like pInit, except that expvector is initialized to that of p, p must be != NULL
◆ Initialization()
Definition at line 952 of file janet.cc.
953{
956 {
960 }
961 else
962 {
966 }
967
969}
int ListGreatMoveOrder(jList *A, jList *B, poly x)
int ListGreatMoveDegree(jList *A, jList *B, poly x)
long p_Deg(poly a, const ring r)
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 ...
◆ InitLead()
◆ InitProl()
◆ insert_()
Definition at line 912 of file janet.cc.
913{
915 NodeM *curr=(*tree)->root;
916
919
921
922 {
924
926
928 {
929 if (!curr->left)
930 {
934 };
935 curr=curr->left;
937 };
938
940 {
942 if (!curr->right) curr->right=
create();
943 curr=curr->right;
944
946 }
947 }
948
949 curr->ended=item;
950}
void SetMult(Poly *x, int i)
#define pGetExp(p, i)
Exponent.
◆ InsertInCount()
Definition at line 571 of file janet.cc.
572{
575
579 return;
580}
ListNode * CreateListNode(Poly *x)
◆ InsertInList()
Definition at line 552 of file janet.cc.
553{
556
558 {
559 if (
pLmCmp(
y->lead,(*ix)->info->lead) == -1)
561 else
562 break;
563 }
564
568 return;
569}
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
◆ is_div_()
Definition at line 853 of file janet.cc.
854{
857
858 if (!curr)
return NULL;
860
862 ;
863
865 {
867
869 {
870 if (curr->ended) return curr->ended;
871
872 if (!curr->left)
873 {
874 if (curr->right)
877 }
878
879 curr=curr->left;
881 }
882
883 if (curr->ended) return curr->ended;
884
885 if (!curr->right)
return NULL;
886
887 curr=curr->right;
888 }
889
890 if (curr->ended) return curr->ended;
892}
Poly * is_div_upper(poly item, NodeM *x, int from)
◆ is_div_upper()
◆ is_present()
◆ LengthCompare()
int LengthCompare |
( |
poly |
p1, |
|
|
poly |
p2 |
|
) |
| |
Definition at line 451 of file janet.cc.
452{
453 do
454 {
455 if (p1 ==
NULL)
return 1;
456 if (p2 ==
NULL)
return 0;
459 }while(p1 && p2);
460 return 1;
461}
◆ ListGreatMoveDegree()
Definition at line 599 of file janet.cc.
600{
603
605
607 {
612 }
613
614 return 1;
615}
void InsertInCount(jList *x, Poly *y)
◆ ListGreatMoveOrder()
Definition at line 582 of file janet.cc.
583{
585
586 if (!
y ||
pLmCmp(
y->info->lead,
x) < 0)
return 0;
587
589 {
594 }
595
596 return 1;
597}
◆ NewPoly()
Definition at line 361 of file janet.cc.
362{
364
371
373 {
376 };
377
379
381}
void ClearProl(Poly *x, int i)
◆ NFL()
Definition at line 187 of file janet.cc.
188{
190
191
193
196
198 {
201 {
203
204 return;
205 }
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
234
236 {
238 if (
p->history!=
NULL)
240 }
241 }
242
243
247 {
248
249
250#if 0
252#endif
255 {
257#if 0
260 {
263 }
264#else
266 {
271
272 }
273#endif
275 }
276 }
277#if 1
279 {
283 }
284#endif
285
287 return;
288
293
295
297}
void InitHistory(Poly *p)
int ReducePolyLead(Poly *x, Poly *y)
Poly * is_div_(TreeM *tree, poly item)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
void kBucketDestroy(kBucket_pt *bucket_pt)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
void p_SimpleContent(poly ph, int smax, const ring r)
void p_ContentForGB(poly ph, const ring r)
static poly p_Copy_noCheck(poly p, const ring r)
returns a copy of p (without any additional testing)
int status int void size_t count
◆ NFListQ()
Definition at line 631 of file janet.cc.
632{
636
637 do
638 {
640
642
644
646 {
650 }
651
652 p1=1;
653
655
657 {
658
660
662 {
664 {
668 continue;
669 };
670
671 (*l)->info->changed=0;
672
674
675 if (!(*l)->info->root)
676 {
680 continue;
681 };
682 p1=0;
683 }
684
686 }
687 }while(p1);
688
689}
void DestroyListNode(ListNode *x)
◆ PNF()
Definition at line 143 of file janet.cc.
144{
145 if (
p->root==
NULL)
return;
146
150
151
157 {
160 {
162 {
164
168 )
169 {
171
173
174 }
175 }
177 }
178 else
180 }
181
183
185}
int ReducePoly(Poly *x, poly from, Poly *y)
◆ ProlCompare()
Definition at line 463 of file janet.cc.
464{
466 {
467 case -1:
468 return 1;
469
470 case 1:
471 return 0;
472
473 default:
477 }
478}
int LengthCompare(poly p1, poly p2)
◆ ProlVar()
Definition at line 480 of file janet.cc.
481{
483
485 {
488
495
497
499 }
500}
int GetProl(Poly *x, int i)
void SetProl(Poly *x, int i)
◆ ReducePoly()
Definition at line 119 of file janet.cc.
120{
121 if (!
x->root || !
y->root)
122 return 0;
123
124
125
126
127
128
129
130
131
132
133
134
135
136
139
140 return 1;
141}
void ksOldSpolyTail(poly p1, poly q, poly q2, poly spNoether, ring r)
◆ ReducePolyLead()
Definition at line 74 of file janet.cc.
75{
76 if (!
x->root || !
y->root)
77 return 0;
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93#if 1
95 {
99 }
106 {
110 }
111#else
113#endif
114
115
116 return 1;
117}
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
const poly kBucketGetLm(kBucket_pt bucket)
static int pLength(poly a)
◆ SetMult()
◆ SetProl()
◆ sp_div()
int sp_div |
( |
poly |
m1, |
|
|
poly |
m2, |
|
|
int |
from |
|
) |
| |
Definition at line 821 of file janet.cc.
822{
823
824 if (
pow_(m2) == 0 &&
pow_(m1))
return 0;
825
828
829 return 1;
830}
◆ T2G()
Definition at line 1085 of file janet.cc.
1086{
1089 {
1092 }
1093}
◆ ValidatePoly()
Definition at line 299 of file janet.cc.
300{
302
303
304 if (
x->root)
return 1;
305
307
309
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
351
353
355
357
358 return 1;
359}
Poly * is_present(jList *F, poly x)
#define pCopy(p)
return a copy of the poly
◆ degree_compatible
◆ FreeNodes
◆ jDeg
◆ ListGreatMove
◆ Mask
Definition at line 36 of file janet.cc.
36{0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x1};
◆ offset
◆ temp_l