Skip to content

Commit 21263cf

Browse files
committed
chg: replaced hack by setMipo
1 parent 5ab7d6c commit 21263cf

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

factory/libfac/factor/Factor.cc

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -391,14 +391,8 @@ specialize_agvariable( CanonicalForm & f, int deg, SFormList & Substitutionlist,
391391
CanonicalForm
392392
generate_mipo( int degree_of_Extension , const Variable & Extension ){
393393
FFRandom gen;
394-
if ( degree(Extension) > 0 ) GFRandom gen;
395-
else {
396-
if ( degree(Extension) == 0 ) FFRandom gen;
397-
else
398-
{
399-
factoryError("libfac: evaluate: Extension not inFF() or inGF() !");
400-
}
401-
}
394+
if (degree (Extension) < 0)
395+
factoryError("libfac: evaluate: Extension not inFF() or inGF() !");
402396
return find_irreducible( degree_of_Extension, gen, Variable(1) );
403397
}
404398

@@ -479,17 +473,18 @@ specializePoly(const CanonicalForm & f, Variable & Extension, int deg, SFormList
479473
extended+= 1;
480474
if ( ! working_over_extension )
481475
{
482-
minpoly= rootOf(generate_mipo( extended,Extension ));
476+
if (!hasMipo(Extension))
477+
minpoly= rootOf (generate_mipo (extended, Extension));
478+
else
479+
{
480+
setReduce (Extension, false);
481+
setMipo (minpoly, generate_mipo ( extended, Extension));
482+
setReduce (Extension, true);
483+
}
483484
Extension= minpoly;
484485
ok= try_specializePoly(f,minpoly,deg,Substitutionlist,i,j);
485486
if (!ok)
486-
{
487487
Substitutionlist=origS;
488-
// very bad hack: TODO
489-
// we want to remove the newly created variable minpoly:
490-
extern char *var_names_ext;
491-
var_names_ext[strlen(var_names_ext)]='\0';
492-
}
493488
}
494489
else
495490
{

0 commit comments

Comments
 (0)