Skip to content

Commit 3bbb6a8

Browse files
committed
chg: distribute content in precomputation of leading coeff
1 parent 04e4511 commit 3bbb6a8

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

factory/facFactorize.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,16 @@ precomputeLeadingCoeff (const CanonicalForm& LCF, const CFList& LCFFactors,
438438
CFList result;
439439
result.append (LCF);
440440
for (int j= 1; j <= factors.length(); j++)
441-
result.append (LCF);
441+
result.append (1);
442+
result= distributeContent (result, differentSecondVarLCs, length);
443+
if (!result.getFirst().inCoeffDomain())
444+
{
445+
CFListIterator iter= result;
446+
CanonicalForm tmp= iter.getItem();
447+
iter++;
448+
for (; iter.hasItem(); iter++)
449+
iter.getItem() *= tmp;
450+
}
442451
y= Variable (1);
443452
delete [] bufSqrfFactors;
444453
return result;

factory/facFqFactorize.cc

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,8 +1530,17 @@ precomputeLeadingCoeff (const CanonicalForm& LCF, const CFList& LCFFactors,
15301530
{
15311531
CFList result;
15321532
result.append (LCF);
1533-
for (int k= 1; k <= factors.length(); k++)
1534-
result.append (LCF);
1533+
for (int j= 1; j <= factors.length(); j++)
1534+
result.append (1);
1535+
result= distributeContent (result, differentSecondVarLCs, lSecondVarLCs);
1536+
if (!result.getFirst().inCoeffDomain())
1537+
{
1538+
CFListIterator iter= result;
1539+
CanonicalForm tmp= iter.getItem();
1540+
iter++;
1541+
for (; iter.hasItem(); iter++)
1542+
iter.getItem() *= tmp;
1543+
}
15351544
y= Variable (1);
15361545
delete [] bufSqrfFactors;
15371546
return result;
@@ -1543,8 +1552,17 @@ precomputeLeadingCoeff (const CanonicalForm& LCF, const CFList& LCFFactors,
15431552
{
15441553
CFList result;
15451554
result.append (LCF);
1546-
for (int k= 1; k <= factors.length(); k++)
1547-
result.append (LCF);
1555+
for (int j= 1; j <= factors.length(); j++)
1556+
result.append (1);
1557+
result= distributeContent (result, differentSecondVarLCs, lSecondVarLCs);
1558+
if (!result.getFirst().inCoeffDomain())
1559+
{
1560+
CFListIterator iter= result;
1561+
CanonicalForm tmp= iter.getItem();
1562+
iter++;
1563+
for (; iter.hasItem(); iter++)
1564+
iter.getItem() *= tmp;
1565+
}
15481566
y= Variable (1);
15491567
delete [] bufSqrfFactors;
15501568
return result;

0 commit comments

Comments
 (0)