Go to the source code of this file.
|
int | tdeg (poly p) |
|
int | getMaxTdeg (ideal I) |
|
int | getMaxPosOfNthRow (intvec *v, int n) |
|
int64 | getInvEps64 (ideal G, intvec *targm, int pertdeg) |
|
int | invEpsOk64 (ideal I, intvec *targm, int pertdeg, int64 inveps64) |
|
intvec * | getNthRow (intvec *v, int n) |
|
int64vec * | getNthRow64 (intvec *v, int n) |
|
void | getTaun64 (ideal G, intvec *targm, int pertdeg, int64vec **v64, int64 &i64) |
|
static int64 | scalarProduct64 (int64vec *a, int64vec *b) |
|
ideal | init64 (ideal G, int64vec *currw64) |
|
BOOLEAN | currwOnBorder64 (ideal G, int64vec *currw64) |
|
BOOLEAN | noPolysWithMoreThanTwoTerms (ideal Gw) |
|
int | DIFFspy (ideal G) |
|
intvec * | DIFF (ideal G) |
|
void | gett64 (intvec *listw, int64vec *currw64, int64vec *targw64, int64 &tvec0, int64 &tvec1) |
|
void | nextt64 (ideal G, int64vec *currw64, int64vec *targw64, int64 &tvec0, int64 &tvec1) |
|
int64vec * | nextw64 (int64vec *currw, int64vec *targw, int64 nexttvec0, int64 nexttvec1) |
|
poly | getNthPolyOfId (ideal I, int n) |
|
intvec * | leadExp (poly p) |
|
int64vec * | leadExp64 (poly p) |
|
static long | scalarProduct (intvec *a, intvec *b) |
|
int | gcd (int a, int b) |
|
int64 | gcd64 (int64 a, int64 b) |
|
ideal | idStd (ideal G) |
|
ideal | idInterRed (ideal G) |
|
matrix | matIdLift (ideal Gomega, ideal M) |
|
void | rCopyAndChangeA (int64vec *w) |
|
int64vec * | rGetGlobalOrderMatrix (ring r) |
|
int64vec * | rGetGlobalOrderWeightVec (ring r) |
|
ideal | sortRedSB (ideal G) |
|
intvec * | int64VecToIntVec (int64vec *source) |
|
◆ currwOnBorder64()
Definition at line 350 of file walkSupport.cc.
351{
356 {
357
360 {
362 }
363 }
366}
#define idDelete(H)
delete an ideal
static BOOLEAN length(leftv result, leftv arg)
poly getNthPolyOfId(ideal I, int n)
ideal init64(ideal G, int64vec *currw64)
◆ DIFF()
Definition at line 435 of file walkSupport.cc.
436{
444 int inc=0;
446 {
451 {
452 inc++;
455 delete lep;
458 {
459
461 }
463 }
465 }
466 return(diffm);
467}
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
intvec * ivSub(intvec *a, intvec *b)
#define IMATELEM(M, I, J)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static short rVar(const ring r)
#define rVar(r) (r->N)
◆ DIFFspy()
Definition at line 407 of file walkSupport.cc.
408{
411 int temp;
412 int sum=0;
415 {
417 if((temp=
pLength(
p))>0) {sum += (temp-1);}
418 }
419 return(sum);
420}
static int pLength(poly a)
◆ gcd()
Definition at line 836 of file walkSupport.cc.
837{
838 int r, p0 = a, p1 =
b;
839 if(p0 < 0)
840 p0 = -p0;
841
842 if(p1 < 0)
843 p1 = -p1;
844 while(p1 != 0)
845 {
846 r = p0 % p1;
847 p0 = p1;
848 p1 = r;
849 }
850 return p0;
851}
◆ gcd64()
Definition at line 864 of file walkSupport.cc.
865{
867 if(p0 < 0)
868 p0 = -p0;
869
870 if(p1 < 0)
871 p1 = -p1;
872
873 while(p1 != ((
int64)0) )
874 {
875 r = p0 % p1;
876 p0 = p1;
877 p1 = r;
878 }
879
880 return p0;
881}
◆ getInvEps64()
int64 getInvEps64 |
( |
ideal |
G, |
|
|
intvec * |
targm, |
|
|
int |
pertdeg |
|
) |
| |
Definition at line 109 of file walkSupport.cc.
110{
111 int n;
114
115 for (n=pertdeg; n>1; n--)
116 {
118 sum64 += temp64;
119 }
121
122
123 if( sum64!=0 && (((inveps64-1)/sum64)!=
getMaxTdeg(
G)) )
125
126 return(inveps64);
127}
EXTERN_VAR BOOLEAN overflow_error
int getMaxPosOfNthRow(intvec *v, int n)
◆ getMaxPosOfNthRow()
int getMaxPosOfNthRow |
( |
intvec * |
v, |
|
|
int |
n |
|
) |
| |
Definition at line 80 of file walkSupport.cc.
81{
83 assume( (0<n) && (n<=(
v->rows())) );
84 {
86 int cc=(n-1)*c;
88 for (
int i=c-1;
i>=0;
i--)
89 {
90 int temp=
abs((*
v)[
i+cc ]);
92 }
93 }
95}
Rational abs(const Rational &a)
◆ getMaxTdeg()
int getMaxTdeg |
( |
ideal |
I | ) |
|
Definition at line 54 of file walkSupport.cc.
55{
59 {
61 {
64 }
65 }
67}
static long pTotaldegree(poly p)
◆ getNthPolyOfId()
poly getNthPolyOfId |
( |
ideal |
I, |
|
|
int |
n |
|
) |
| |
Definition at line 686 of file walkSupport.cc.
687{
688 if(0<n && n<=((int)I->ncols))
689 {
690 return (I->m)[n-1];
691 }
692 else
693 {
695 }
696}
◆ getNthRow()
Definition at line 165 of file walkSupport.cc.
166{
170 if((0<n) && (n<=r))
171 {
172 int cc=(n-1)*c;
173 for (
int i=0;
i<c;
i++)
174 {
175 (*res)[
i]=(*v)[
i+cc ];
176 }
177 }
179}
◆ getNthRow64()
Definition at line 181 of file walkSupport.cc.
182{
186 if((0<n) && (n<=r))
187 {
188 int cc=(n-1)*c;
189 for (
int i=0;
i<c;
i++)
190 {
192 }
193 }
195}
◆ gett64()
Definition at line 481 of file walkSupport.cc.
482{
487 int64 temp1,temp2,temp3,temp4;
489 {
490
491 temp3=zaehler64;
492 temp1=((
int64)((*listw)[
j-1]));
493 temp2=((*currw64)[
j-1]);
494 temp4=temp1*temp2;
495 zaehler64=temp3-temp4;
496
497
499
500 if( ( temp3<0 && temp4>0 ) || ( temp3>0 && temp4<0 ) )
501 {
504 }
505
506
507 temp1=((*targw64)[
j-1])-((*currw64)[
j-1]);
508
509
510 temp2=((
int64)((*listw)[
j-1]));
511 temp3=nenner64;
512 temp4=temp1*temp2;
513 nenner64=temp3+temp4;
514
515
517
518 if( (temp3>0 && temp4>0) ||
519 (temp3<0 && temp4<0) )
520 {
522 if( (abs_t3+
abs64(temp4))<abs_t3 )
523 {
525 }
526 }
527 }
528
529 if (nenner64==0)
530 {
531 zaehler64=2;
532 }
533 else
534 {
535 if ( (zaehler64<=0) && (nenner64<0) )
536 {
537 zaehler64=-zaehler64;
538 nenner64=-nenner64;
539 }
540 }
541
543
546
547}
int64 gcd64(int64 a, int64 b)
◆ getTaun64()
Definition at line 209 of file walkSupport.cc.
210{
215
216 int n;
217
218 for (n=2; n<=pertdeg; n++)
219 {
220 if (inveps64!=1)
221 {
223 (*taun64)*=inveps64;
225 {
226 if((*temp64)[
i]!=0 && (((*taun64)[
i])/((*temp64)[
i]))!=inveps64)
228 }
229 delete temp64;
230 }
235 {
236 if( ( ((*temp64)[
i]) > 0 ) && ( ((*add64)[
i]) > 0 ) )
237 {
238 if( ((*taun64)[
i]) < ((*temp64)[
i]) )
240 }
241 if( ( ((*temp64)[
i]) < 0 ) && ( ((*add64)[
i]) < 0 ) )
242 {
243 if( ((*taun64)[
i]) > ((*temp64)[
i]) )
245 }
246 }
247 delete temp64;
248 }
249
250
251
252 *v64=taun64;
253 i64=inveps64;
254}
int64vec * iv64Add(int64vec *a, int64vec *b)
int64vec * iv64Copy(int64vec *o)
int64vec * getNthRow64(intvec *v, int n)
int64 getInvEps64(ideal G, intvec *targm, int pertdeg)
◆ idInterRed()
ideal idInterRed |
( |
ideal |
G | ) |
|
Definition at line 958 of file walkSupport.cc.
959{
961
965}
ideal kInterRedOld(ideal F, ideal Q)
◆ idStd()
Definition at line 938 of file walkSupport.cc.
939{
943}
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
◆ init64()
ideal init64 |
( |
ideal |
G, |
|
|
int64vec * |
currw64 |
|
) |
| |
Definition at line 299 of file walkSupport.cc.
300{
304 int64 leadingweight,templeadingweight;
308 {
312 delete tt;
314 {
317 delete tt;
318 if(templeadingweight==leadingweight)
319 {
321 }
322 if(templeadingweight>leadingweight)
323 {
326 leadingweight=templeadingweight;
327 }
329 }
333 }
334 return(I);
335}
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
ideal idInit(int idsize, int rank)
initialise an ideal / module
int64vec * leadExp64(poly p)
static int64 scalarProduct64(int64vec *a, int64vec *b)
◆ int64VecToIntVec()
Definition at line 1181 of file walkSupport.cc.
1182{
1183 int r=source->
rows();
1184 int c=source->
cols();
1186 for(
int i=0;
i<r;
i++){
1187 for(
int j=0;
j<c;
j++){
1188 (*res)[
i*c+
j]=(int)(*source)[
i*c+
j];
1189 }
1190 }
1191 delete source;
1193}
◆ invEpsOk64()
int invEpsOk64 |
( |
ideal |
I, |
|
|
intvec * |
targm, |
|
|
int |
pertdeg, |
|
|
int64 |
inveps64 |
|
) |
| |
Definition at line 141 of file walkSupport.cc.
142{
144 if (inveps64>=temp64)
145 {
146 return(1);
147 }
148 else
149 {
150 return(0);
151 }
152}
◆ leadExp()
Definition at line 746 of file walkSupport.cc.
747{
749 int *e=(
int*)
omAlloc((
N+1)*
sizeof(int));
752 for(
int i=
N;
i>0;
i--) { (*iv)[
i-1]=e[
i];}
754 return(iv);
755}
const CanonicalForm CFMap CFMap & N
static void p_GetExpV(poly p, int *ev, const ring r)
◆ leadExp64()
◆ matIdLift()
matrix matIdLift |
( |
ideal |
Gomega, |
|
|
ideal |
M |
|
) |
| |
Definition at line 978 of file walkSupport.cc.
979{
985}
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
◆ nextt64()
Definition at line 560 of file walkSupport.cc.
561{
567 for(
int j=1;
j<=
s;
j++)
568 {
570 int64 temptvec0, temptvec1;
571 gett64(tt,currw64,targw64,temptvec0, temptvec1);
572 delete tt;
573
574
575 if ( (temptvec1!=0)
576 &&
577 (temptvec0>0) && (temptvec1>0)
578 )
579 {
580 if( ( (temptvec0) <= (temptvec1) )
581 &&
582 ( ( (temptvec0) * (tvec1) ) <
583 ( (temptvec1) * (tvec0) ) )
584 )
585 {
586 tvec0=temptvec0;
587 tvec1=temptvec1;
588 }
589 }
590 }
591 delete diffm;
592 return;
593}
intvec * getNthRow(intvec *v, int n)
void gett64(intvec *listw, int64vec *currw64, int64vec *targw64, int64 &tvec0, int64 &tvec1)
◆ nextw64()
Definition at line 604 of file walkSupport.cc.
606{
607
611
612
613
615 *a *= (nexttvec0);
617 {
618 if( (nexttvec0) !=0 &&
619 (((*a)[
i])/(nexttvec0))!=((*tempv)[
i]) )
620 {
622 break;
623 }
624 }
625 delete tempv;
630 {
631 if( (nexttvec1) !=0 &&
632 (((*b)[
i])/(nexttvec1))!=((*tempv)[
i]) )
633 {
635 break;
636 }
637 }
638 delete tempv;
640
642 {
643 if( (((*a)[
i])>=0 && ((*
b)[
i])>=0) ||
644 (((*a)[
i])<0 && ((*
b)[
i])<0) )
645 {
648 )
649 {
651 break;
652 }
653 }
654 }
655
656
660 for (
int i=1;
i<
s;
i++)
661 {
662 temp=(*nextweight)[
i];
665 }
666
667 if (
g!=1) *nextweight /=
g;
668
669 return(nextweight);
670}
int64vec * iv64Sub(int64vec *a, int64vec *b)
int iv64Size(int64vec *v)
◆ noPolysWithMoreThanTwoTerms()
BOOLEAN noPolysWithMoreThanTwoTerms |
( |
ideal |
Gw | ) |
|
◆ rCopyAndChangeA()
Definition at line 1000 of file walkSupport.cc.
1001{
1006}
void rChangeCurrRing(ring r)
void rSetWeightVec(ring r, int64 *wv)
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
◆ rGetGlobalOrderMatrix()
int64vec * rGetGlobalOrderMatrix |
( |
ring |
r | ) |
|
Definition at line 1019 of file walkSupport.cc.
1020{
1024 int pos1=0;
1025 int pos2=0;
1027 while(r->order[
i]!=0 && pos2<n)
1028 {
1029 pos2=pos2+r->block1[
i] - r->block0[
i];
1030
1032 {
1033 for(
int j=pos1;
j<=pos2;
j++)
1035 }
1037 {
1038 for(
int j=pos1;
j<=pos2;
j++)
1040 for(
int j=1;
j<=(pos2-pos1);
j++)
1042 }
1044 {
1045 for(
int j=pos1;
j<=pos2;
j++)
1047 for(
int j=1;
j<=(pos2-pos1);
j++)
1049 }
1051 {
1052 int* weights=r->wvhdl[
i];
1053 for(
int j=pos1;
j<=pos2;
j++)
1055 for(
int j=1;
j<=(pos2-pos1);
j++)
1057 }
1059 {
1060 int* weights=r->wvhdl[
i];
1061 for(
int j=pos1;
j<=pos2;
j++)
1063 for(
int j=1;
j<=(pos2-pos1);
j++)
1065 }
1066
1068 {
1069 int* weights=r->wvhdl[0];
1070 for(
int j=pos1;
j<((pos2+1)*(pos2+1));
j++)
1072 }
1073
1074 pos1=pos2+1;
1075 pos2=pos2+1;
1077 }
1078
1080}
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
◆ rGetGlobalOrderWeightVec()
int64vec * rGetGlobalOrderWeightVec |
( |
ring |
r | ) |
|
Definition at line 1094 of file walkSupport.cc.
1095{
1098
1100
1102
1104 {
1106 }
1108 {
1109 length=r->block1[0] - r->block0[0];
1112 }
1115 {
1116 int* weights=r->wvhdl[0];
1117 length=r->block1[0] - r->block0[0];
1120 }
1122 {
1124 length=r->block1[0] - r->block0[0];
1126 (*
res)[
j]=weights[
j];
1127 }
1128
1130}
for(j=0;j< factors.length();j++)
@ ringorder_a64
for int64 weights
◆ scalarProduct()
◆ scalarProduct64()
Definition at line 266 of file walkSupport.cc.
267{
272 for(
i=n-1;
i>=0;
i--)
273 {
274 temp1=(*a)[
i] * (*b)[
i];
276
279
280
281
283 }
284
286}
◆ sortRedSB()
ideal sortRedSB |
( |
ideal |
G | ) |
|
Definition at line 1146 of file walkSupport.cc.
1147{
1151 for (
int i=0;
i<(
s-1);
i++)
1152 {
1153 for (
int j=0;
j<((
s-1)-
i);
j++)
1154 {
1158 {
1161 }
1162 }
1163 }
1165}
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
◆ tdeg()
◆ overflow_error