[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:55:25 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit d9226b8973c0430f9d6762edcfa5661416f9ba24
Author: Martin Lee <martinlee84 at web.de>
Date: Thu Mar 22 14:14:26 2012 +0100
chg: use squarefree factorization instead of squarefree part
diff --git a/factory/facFqFactorize.h b/factory/facFqFactorize.h
index c81e98d..5c213fe 100644
--- a/factory/facFqFactorize.h
+++ b/factory/facFqFactorize.h
@@ -149,33 +149,16 @@ CFFList FpFactorize (const CanonicalForm& G,///< [in] a multivariate poly
ExtensionInfo info= ExtensionInfo (false);
Variable a= Variable (1);
CanonicalForm LcF= Lc (F);
- CanonicalForm pthRoot, A;
- CanonicalForm sqrfP= sqrfPart (F/Lc(F), pthRoot, a);
- CFList buf, bufRoot;
- CFFList result, resultRoot;
- int p= getCharacteristic();
- int l;
- if (degree (pthRoot) > 0)
+ CFFList sqrf= FpSqrf (F, false);
+ CFFList result;
+ CFList bufResult;
+ sqrf.removeFirst();
+ CFListIterator i;
+ for (CFFListIterator iter= sqrf; iter.hasItem(); iter++)
{
- pthRoot= maxpthRoot (pthRoot, p, l);
- result= FpFactorize (pthRoot, false);
- result.removeFirst();
- for (CFFListIterator i= result; i.hasItem(); i++)
- i.getItem()= CFFactor(i.getItem().factor(),i.getItem().exp()*ipower(p,l));
- result.insert (CFFactor (LcF, 1));
- return result;
- }
- else
- {
- buf= multiFactorize (sqrfP, info);
- A= F/LcF;
- result= multiplicity (A, buf);
- }
- if (degree (A) > 0)
- {
- resultRoot= FpFactorize (A, false);
- resultRoot.removeFirst();
- result= Union (result, resultRoot);
+ bufResult= multiFactorize (iter.getItem().factor(), info);
+ for (i= bufResult; i.hasItem(); i++)
+ result.append (CFFactor (i.getItem(), iter.getItem().exp()));
}
result.insert (CFFactor (LcF, 1));
return result;
@@ -243,34 +226,16 @@ CFFList FqFactorize (const CanonicalForm& G, ///< [in] a multivariate poly
ExtensionInfo info= ExtensionInfo (alpha, false);
CanonicalForm LcF= Lc (F);
- CanonicalForm pthRoot, A;
- CanonicalForm sqrfP= sqrfPart (F/Lc(F), pthRoot, alpha);
- CFList buf, bufRoot;
- CFFList result, resultRoot;
- int p= getCharacteristic();
- int q= ipower (p, degree (getMipo (alpha)));
- int l;
- if (degree (pthRoot) > 0)
- {
- pthRoot= maxpthRoot (pthRoot, q, l);
- result= FqFactorize (pthRoot, alpha, false);
- result.removeFirst();
- for (CFFListIterator i= result; i.hasItem(); i++)
- i.getItem()= CFFactor(i.getItem().factor(),i.getItem().exp()*ipower(p,l));
- result.insert (CFFactor (LcF, 1));
- return result;
- }
- else
+ CFFList sqrf= FqSqrf (F, alpha, false);
+ CFFList result;
+ CFList bufResult;
+ sqrf.removeFirst();
+ CFListIterator i;
+ for (CFFListIterator iter= sqrf; iter.hasItem(); iter++)
{
- buf= multiFactorize (sqrfP, info);
- A= F/LcF;
- result= multiplicity (A, buf);
- }
- if (degree (A) > 0)
- {
- resultRoot= FqFactorize (A, alpha, false);
- resultRoot.removeFirst();
- result= Union (result, resultRoot);
+ bufResult= multiFactorize (iter.getItem().factor(), info);
+ for (i= bufResult; i.hasItem(); i++)
+ result.append (CFFactor (i.getItem(), iter.getItem().exp()));
}
result.insert (CFFactor (LcF, 1));
return result;
@@ -340,34 +305,16 @@ CFFList GFFactorize (const CanonicalForm& G, ///< [in] a multivariate poly
Variable a= Variable (1);
ExtensionInfo info= ExtensionInfo (getGFDegree(), gf_name, false);
CanonicalForm LcF= Lc (F);
- CanonicalForm pthRoot, A;
- CanonicalForm sqrfP= sqrfPart (F/LcF, pthRoot, a);
- CFList buf;
- CFFList result, resultRoot;
- int p= getCharacteristic();
- int q= ipower (p, getGFDegree());
- int l;
- if (degree (pthRoot) > 0)
- {
- pthRoot= maxpthRoot (pthRoot, q, l);
- result= GFFactorize (pthRoot, false);
- result.removeFirst();
- for (CFFListIterator i= result; i.hasItem(); i++)
- i.getItem()= CFFactor(i.getItem().factor(),i.getItem().exp()*ipower(p,l));
- result.insert (CFFactor (LcF, 1));
- return result;
- }
- else
- {
- buf= multiFactorize (sqrfP, info);
- A= F/LcF;
- result= multiplicity (A, buf);
- }
- if (degree (A) > 0)
+ CFFList sqrf= GFSqrf (F, false);
+ CFFList result;
+ CFList bufResult;
+ sqrf.removeFirst();
+ CFListIterator i;
+ for (CFFListIterator iter= sqrf; iter.hasItem(); iter++)
{
- resultRoot= GFFactorize (A, false);
- resultRoot.removeFirst();
- result= Union (result, resultRoot);
+ bufResult= multiFactorize (iter.getItem().factor(), info);
+ for (i= bufResult; i.hasItem(); i++)
+ result.append (CFFactor (i.getItem(), iter.getItem().exp()));
}
result.insert (CFFactor (LcF, 1));
return result;
--
an open source computer algebra system
More information about the debian-science-commits
mailing list