[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:52:54 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit 2e07680536270ccc53e0da529e82fbfcc9937bf9
Author: Martin Lee <martinlee84 at web.de>
Date: Mon Jan 23 22:56:15 2012 +0100
chg: use shape of Newton polygon for factor detection and
use lower lift bound
diff --git a/factory/facFqBivar.cc b/factory/facFqBivar.cc
index d12c4f2..c636f86 100644
--- a/factory/facFqBivar.cc
+++ b/factory/facFqBivar.cc
@@ -850,6 +850,9 @@ henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
CanonicalForm delta= info.getDelta();
bool extension= info.isInExtension();
+ int sizeOfLiftPre;
+ int * liftPre= getLiftPrecisions (A, sizeOfLiftPre, degree (LC (A, 1), 2));
+
Variable x= Variable (1);
Variable y= Variable (2);
CFArray Pi;
@@ -859,72 +862,127 @@ henselLiftAndEarly (CanonicalForm& A, bool& earlySuccess, CFList&
CFMatrix M= CFMatrix (liftBound, bufUniFactors.length() - 1);
earlySuccess= false;
int newLiftBound= 0;
- int smallFactorDeg= 11; //this is a tunable parameter
- if (smallFactorDeg >= liftBound)
+
+ int smallFactorDeg= tmin (11, liftPre [sizeOfLiftPre- 1] + 1);//this is a tunable parameter
+ int dummy;
+ if (smallFactorDeg >= liftBound || degree (A,y) <= 4)
henselLift12 (A, bufUniFactors, liftBound, Pi, diophant, M);
- else if (smallFactorDeg >= degree (A, y) + 1)
+ else if (sizeOfLiftPre > 1 && sizeOfLiftPre < 30)
{
- henselLift12 (A, bufUniFactors, degree (A, y) + 1, Pi, diophant, M);
+ henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M);
if (!extension)
earlyFactors= earlyFactorDetection (A, bufUniFactors, newLiftBound,
- degs, earlySuccess, degree (A, y) + 1);
+ degs, earlySuccess, smallFactorDeg);
else
earlyFactors= extEarlyFactorDetection (A, bufUniFactors,
newLiftBound, degs, earlySuccess, info, eval,
- degree (A, y) + 1);
- if (degs.getLength() > 1 && !earlySuccess)
+ smallFactorDeg);
+ if (degs.getLength() > 1 && !earlySuccess &&
+ smallFactorDeg != liftPre [sizeOfLiftPre-1] + 1)
{
- if (newLiftBound > degree (A, y) + 1)
+ if (newLiftBound >= liftPre[sizeOfLiftPre-1]+1)
{
- liftBound= newLiftBound;
- bufUniFactors.insert (LC(A, x));
- henselLiftResume12 (A, bufUniFactors, degree (A, y) + 1, liftBound,
- Pi, diophant, M);
+ bufUniFactors.insert (LC (A, x));
+ henselLiftResume12 (A, bufUniFactors, smallFactorDeg,
+ liftPre[sizeOfLiftPre-1] + 1, Pi, diophant, M);
+ if (!extension)
+ earlyFactors= earlyFactorDetection (A, bufUniFactors, newLiftBound,
+ degs, earlySuccess, liftPre[sizeOfLiftPre-1] + 1);
+ else
+ earlyFactors= extEarlyFactorDetection (A, bufUniFactors,
+ newLiftBound, degs, earlySuccess, info, eval,
+ liftPre[sizeOfLiftPre-1] + 1);
}
}
else if (earlySuccess)
liftBound= newLiftBound;
+
+ int i= sizeOfLiftPre - 1;
+ while (degs.getLength() > 1 && !earlySuccess && i - 1 >= 0)
+ {
+ if (newLiftBound >= liftPre[i] + 1)
+ {
+ bufUniFactors.insert (LC (A, x));
+ henselLiftResume12 (A, bufUniFactors, liftPre[i] + 1,
+ liftPre[i-1] + 1, Pi, diophant, M);
+ if (!extension)
+ earlyFactors= earlyFactorDetection (A, bufUniFactors, newLiftBound,
+ degs, earlySuccess, liftPre[i-1] + 1);
+ else
+ earlyFactors= extEarlyFactorDetection (A, bufUniFactors,
+ newLiftBound, degs, earlySuccess, info, eval,
+ liftPre[i-1] + 1);
+ }
+ else
+ {
+ liftBound= newLiftBound;
+ break;
+ }
+ i--;
+ }
+ if (earlySuccess)
+ liftBound= newLiftBound;
+ //after here all factors are lifted to liftPre[sizeOfLiftPre-1]
}
- else if (smallFactorDeg < degree (A, y) + 1)
+ else
{
henselLift12 (A, bufUniFactors, smallFactorDeg, Pi, diophant, M);
if (!extension)
earlyFactors= earlyFactorDetection (A, bufUniFactors, newLiftBound,
- degs, earlySuccess,
- smallFactorDeg);
+ degs, earlySuccess, smallFactorDeg);
else
earlyFactors= extEarlyFactorDetection (A, bufUniFactors,
- newLiftBound, degs, earlySuccess,
- info, eval, smallFactorDeg);
- if (degs.getLength() > 1 && !earlySuccess)
+ newLiftBound, degs, earlySuccess, info, eval,
+ smallFactorDeg);
+ int i= 1;
+ while ((degree (A,y)/4)*i + 4 <= smallFactorDeg)
+ i++;
+ dummy= tmin (degree (A,y)+1, (degree (A,y)/4)*i+4);
+ if (degs.getLength() > 1 && !earlySuccess && dummy > smallFactorDeg)
{
bufUniFactors.insert (LC (A, x));
- henselLiftResume12 (A, bufUniFactors, smallFactorDeg, degree (A, y)
- + 1, Pi, diophant, M);
+ henselLiftResume12 (A, bufUniFactors, smallFactorDeg,
+ dummy, Pi, diophant, M);
if (!extension)
earlyFactors= earlyFactorDetection (A, bufUniFactors, newLiftBound,
- degs, earlySuccess, degree (A, y) + 1);
+ degs, earlySuccess, dummy);
else
earlyFactors= extEarlyFactorDetection (A, bufUniFactors,
- newLiftBound, degs, earlySuccess,
- info, eval, degree(A,y) + 1);
- if (degs.getLength() > 1 && !earlySuccess)
+ newLiftBound, degs, earlySuccess, info, eval,
+ dummy);
+ }
+ while (degs.getLength() > 1 && !earlySuccess && i < 4)
+ {
+ if (newLiftBound >= dummy)
{
- if (newLiftBound > degree (A, y) + 1)
- {
- bufUniFactors.insert (LC(A, x));
- henselLiftResume12 (A, bufUniFactors, degree (A, y) + 1, liftBound,
- Pi, diophant, M);
- }
+ bufUniFactors.insert (LC (A, x));
+ dummy= tmin (degree (A,y)+1, (degree (A,y)/4)*(i+1)+4);
+ henselLiftResume12 (A, bufUniFactors, (degree (A,y)/4)*i + 4,
+ dummy, Pi, diophant, M);
+ if (!extension)
+ earlyFactors= earlyFactorDetection (A, bufUniFactors, newLiftBound,
+ degs, earlySuccess, dummy);
+ else
+ earlyFactors= extEarlyFactorDetection (A, bufUniFactors,
+ newLiftBound, degs, earlySuccess, info, eval,
+ dummy);
}
- else if (earlySuccess)
+ else
+ {
liftBound= newLiftBound;
+ break;
+ }
+ i++;
}
- else if (earlySuccess)
+ if (earlySuccess)
liftBound= newLiftBound;
}
- if (newLiftBound > 0)
- liftBound= newLiftBound;
+
+ if (!earlySuccess)
+ liftBound= degree (A,y) + 1;
+
+ delete [] liftPre;
+
return bufUniFactors;
}
--
an open source computer algebra system
More information about the debian-science-commits
mailing list