Skip to content

Commit b1abf09

Browse files
committed
chg: deleted some unused code
chg: joined precomputeLeadingCoeff from facFactorize.cc and facFqFactorize.cc
1 parent db9ebe9 commit b1abf09

File tree

4 files changed

+39
-637
lines changed

4 files changed

+39
-637
lines changed

factory/facBivar.cc

Lines changed: 0 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -184,171 +184,6 @@ CanonicalForm evalPoint (const CanonicalForm& F, int& i)
184184
} while (1);
185185
}
186186

187-
CFList
188-
earlyFactorDetection0 (CanonicalForm& F, CFList& factors,int& adaptedLiftBound,
189-
DegreePattern& degs, bool& success, int deg)
190-
{
191-
DegreePattern bufDegs1= degs;
192-
DegreePattern bufDegs2;
193-
CFList result;
194-
CFList T= factors;
195-
CanonicalForm buf= F;
196-
CanonicalForm LCBuf= LC (buf, Variable (1));
197-
CanonicalForm g, quot;
198-
CanonicalForm M= power (F.mvar(), deg);
199-
adaptedLiftBound= 0;
200-
int d= degree (F) + degree (LCBuf, F.mvar());
201-
for (CFListIterator i= factors; i.hasItem(); i++)
202-
{
203-
if (!bufDegs1.find (degree (i.getItem(), 1)))
204-
continue;
205-
else
206-
{
207-
g= i.getItem() (0, 1);
208-
g *= LCBuf;
209-
g= mod (g, M);
210-
if (fdivides (LC (g), LCBuf))
211-
{
212-
g= mulMod2 (i.getItem(), LCBuf, M);
213-
g /= content (g, Variable (1));
214-
if (fdivides (g, buf, quot))
215-
{
216-
result.append (g);
217-
buf= quot;
218-
d -= degree (g) + degree (LC (g, Variable (1)), F.mvar());
219-
LCBuf= LC (buf, Variable (1));
220-
T= Difference (T, CFList (i.getItem()));
221-
222-
// compute new possible degree pattern
223-
bufDegs2= DegreePattern (T);
224-
bufDegs1.intersect (bufDegs2);
225-
bufDegs1.refine ();
226-
if (bufDegs1.getLength() <= 1)
227-
{
228-
result.append (buf);
229-
break;
230-
}
231-
}
232-
}
233-
}
234-
}
235-
adaptedLiftBound= d + 1;
236-
if (d < deg)
237-
{
238-
factors= T;
239-
degs= bufDegs1;
240-
F= buf;
241-
success= true;
242-
}
243-
if (bufDegs1.getLength() <= 1)
244-
degs= bufDegs1;
245-
return result;
246-
}
247-
248-
249-
CFList
250-
henselLiftAndEarly0 (CanonicalForm& A, bool& earlySuccess, CFList&
251-
earlyFactors, DegreePattern& degs, int& liftBound,
252-
const CFList& uniFactors, const CanonicalForm& eval)
253-
{
254-
int sizeOfLiftPre;
255-
int * liftPre= getLiftPrecisions (A, sizeOfLiftPre, degree (LC (A, 1), 2));
256-
257-
Variable x= Variable (1);
258-
Variable y= Variable (2);
259-
CFArray Pi;
260-
CFList diophant;
261-
CFList bufUniFactors= uniFactors;
262-
bufUniFactors.insert (LC (A, x));
263-
CFMatrix M= CFMatrix (liftBound, bufUniFactors.length() - 1);
264-
earlySuccess= false;
265-
int newLiftBound= 0;
266-
int smallFactorDeg= tmin (11, liftPre [sizeOfLiftPre- 1] + 1);//this is a tunable parameter
267-
if (smallFactorDeg >= liftBound || degree (A,y) <= 4)
268-
henselLift12 (A, bufUniFactors, liftBound, Pi, diophant, M);
269-
else if (sizeOfLiftPre > 1 && sizeOfLiftPre < 30)
270-
{
271-
henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M);
272-
earlyFactors= earlyFactorDetection0 (A, bufUniFactors, newLiftBound,
273-
degs, earlySuccess,
274-
smallFactorDeg);
275-
if (degs.getLength() > 1 && !earlySuccess &&
276-
smallFactorDeg != liftPre [sizeOfLiftPre-1] + 1)
277-
{
278-
if (newLiftBound > liftPre[sizeOfLiftPre-1]+1)
279-
{
280-
bufUniFactors.insert (LC (A, x));
281-
henselLiftResume12 (A, bufUniFactors, smallFactorDeg,
282-
liftPre[sizeOfLiftPre-1] + 1, Pi, diophant, M);
283-
earlyFactors= earlyFactorDetection0 (A, bufUniFactors, newLiftBound,
284-
degs, earlySuccess, liftPre[sizeOfLiftPre-1] + 1);
285-
}
286-
}
287-
else if (earlySuccess)
288-
liftBound= newLiftBound;
289-
int i= sizeOfLiftPre - 1;
290-
while (degs.getLength() > 1 && !earlySuccess && i - 1 >= 0)
291-
{
292-
if (newLiftBound > liftPre[i] + 1)
293-
{
294-
bufUniFactors.insert (LC (A, x));
295-
henselLiftResume12 (A, bufUniFactors, liftPre[i] + 1,
296-
liftPre[i-1] + 1, Pi, diophant, M);
297-
earlyFactors= earlyFactorDetection0 (A, bufUniFactors, newLiftBound,
298-
degs, earlySuccess, liftPre[i-1] + 1);
299-
}
300-
else
301-
{
302-
liftBound= newLiftBound;
303-
break;
304-
}
305-
i--;
306-
}
307-
if (earlySuccess)
308-
liftBound= newLiftBound;
309-
//after here all factors are lifted to liftPre[sizeOfLiftPre-1]
310-
}
311-
else
312-
{
313-
henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M);
314-
earlyFactors= earlyFactorDetection0 (A, bufUniFactors, newLiftBound,
315-
degs, earlySuccess,
316-
smallFactorDeg);
317-
int i= 1;
318-
while ((degree (A,y)/4)*i + 4 <= smallFactorDeg)
319-
i++;
320-
if (degs.getLength() > 1 && !earlySuccess)
321-
{
322-
bufUniFactors.insert (LC (A, x));
323-
henselLiftResume12 (A, bufUniFactors, smallFactorDeg,
324-
(degree (A, y)/4)*i + 4, Pi, diophant, M);
325-
earlyFactors= earlyFactorDetection0 (A, bufUniFactors, newLiftBound,
326-
degs, earlySuccess, (degree (A, y)/4)*i + 4);
327-
}
328-
while (degs.getLength() > 1 && !earlySuccess && i < 4)
329-
{
330-
if (newLiftBound > (degree (A, y)/4)*i + 4)
331-
{
332-
bufUniFactors.insert (LC (A, x));
333-
henselLiftResume12 (A, bufUniFactors, (degree (A,y)/4)*i + 4,
334-
(degree (A, y)/4)*(i+1) + 4, Pi, diophant, M);
335-
earlyFactors= earlyFactorDetection0 (A, bufUniFactors, newLiftBound,
336-
degs, earlySuccess, (degree (A, y)/4)*(i+1) + 4);
337-
}
338-
else
339-
{
340-
liftBound= newLiftBound;
341-
break;
342-
}
343-
i++;
344-
}
345-
if (earlySuccess)
346-
liftBound= newLiftBound;
347-
}
348-
349-
return bufUniFactors;
350-
}
351-
352187
CFList biFactorize (const CanonicalForm& F, const Variable& v)
353188
{
354189
if (F.inCoeffDomain())

0 commit comments

Comments
 (0)