MCPcopy Create free account
hub / github.com/Singular/Singular / kFindSameLMInT_Z

Function kFindSameLMInT_Z

kernel/GBEngine/kstd2.cc:87–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86#ifdef STDZ_EXCHANGE_DURING_REDUCTION
87int kFindSameLMInT_Z(const kStrategy strat, const LObject* L, const int start)
88{
89 unsigned long not_sev = ~L->sev;
90 int j = start;
91 int o = -1;
92
93 const TSet T=strat->T;
94 const unsigned long* sevT=strat->sevT;
95 number gcd, ogcd;
96 if (L->p!=NULL)
97 {
98 const ring r=currRing;
99 const poly p=L->p;
100 ogcd = pGetCoeff(p);
101
102 pAssume(~not_sev == p_GetShortExpVector(p, r));
103
104 loop
105 {
106 if (j > strat->tl) return o;
107 if (p_LmShortDivisibleBy(T[j].p, sevT[j],p, not_sev, r) && p_LmEqual(T[j].p, p, r))
108 {
109 gcd = n_Gcd(pGetCoeff(p), pGetCoeff(T[j].p), r->cf);
110 if (o == -1
111 || n_Greater(n_EucNorm(ogcd, r->cf), n_EucNorm(gcd, r->cf), r->cf))
112 {
113 ogcd = gcd;
114 o = j;
115 }
116 }
117 j++;
118 }
119 }
120 else
121 {

Callers 2

redRing_ZFunction · 0.85
redRing_Z_SFunction · 0.85

Calls 6

p_GetShortExpVectorFunction · 0.85
p_LmShortDivisibleByFunction · 0.85
n_GcdFunction · 0.85
n_GreaterFunction · 0.85
n_EucNormFunction · 0.85
ifFunction · 0.50

Tested by

no test coverage detected