Skip to content

Commit

Permalink
FIX: output the Frank's extension fields in the old Singular way (in …
Browse files Browse the repository at this point in the history
…order to avoid changing the testsuite result)
  • Loading branch information
Oleksandr Motsak authored and mohamed-barakat committed Nov 9, 2011
1 parent 0475978 commit a55ef03
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 5 deletions.
38 changes: 35 additions & 3 deletions libpolys/polys/ext_fields/algext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,40 @@ BOOLEAN naGreaterZero(number a, const coeffs cf)

void naCoeffWrite(const coeffs cf)
{
char *x = rRingVar(0, naRing);
assume( cf != NULL );

const ring A = cf->extRing;

assume( A != NULL );
assume( A->cf != NULL );

n_CoeffWrite(A->cf);

// rWrite(A);

const int P = rVar(A);
assume( P > 0 );

Print("// %d parameter : ", P);

for (int nop=0; nop < P; nop ++)
Print("%s ", rRingVar(nop, A));

const ideal I = A->minideal;

assume( I != NULL );
assume( IDELEMS(I) == 1 );

PrintS("\n// minpoly : ("); p_Write0( I->m[0], A); PrintS(")\n");

/*
char *x = rRingVar(0, A);
Print("// Coefficients live in the extension field K[%s]/<f(%s)>\n", x, x);
Print("// with the minimal polynomial f(%s) = %s\n", x,
p_String(naMinpoly, naRing));
PrintS("// and K: "); n_CoeffWrite(cf->extRing->cf);
p_String(A->minideal->m[0], A));
PrintS("// and K: ");
*/
}

number naAdd(number a, number b, const coeffs cf)
Expand Down Expand Up @@ -621,6 +650,9 @@ nMapFunc naSetMap(const coeffs src, const coeffs dst)

BOOLEAN naInitChar(coeffs cf, void * infoStruct)
{
assume( cf != NULL );
assume( infoStruct != NULL );

AlgExtInfo *e = (AlgExtInfo *)infoStruct;
/// first check whether cf->extRing != NULL and delete old ring???
cf->extRing = e->r;
Expand Down
34 changes: 32 additions & 2 deletions libpolys/polys/ext_fields/transext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,41 @@ BOOLEAN ntGreaterZero(number a, const coeffs cf)

void ntCoeffWrite(const coeffs cf)
{
assume( cf != NULL );

const ring A = cf->extRing;

assume( A != NULL );
assume( A->cf != NULL );

n_CoeffWrite(A->cf);

// rWrite(A);

const int P = rVar(A);
assume( P > 0 );

Print("// %d parameter : ", P);

for (int nop=0; nop < P; nop ++)
Print("%s ", rRingVar(nop, A));

assume( A->minideal == NULL );

PrintS("\n// minpoly : 0\n");


/*
PrintS("// Coefficients live in the rational function field\n");
Print("// K(");
for (int i = 0; i < rVar(ntRing); i++)
{
if (i > 0) PrintS(", ");
if (i > 0) PrintS(" ");
Print("%s", rRingVar(i, ntRing));
}
PrintS(") with\n");
PrintS("// K: "); n_CoeffWrite(cf->extRing->cf);
*/
}

number ntAdd(number a, number b, const coeffs cf)
Expand Down Expand Up @@ -1070,7 +1096,11 @@ nMapFunc ntSetMap(const coeffs src, const coeffs dst)
}

BOOLEAN ntInitChar(coeffs cf, void * infoStruct)
{
{

assume( cf != NULL );
assume( infoStruct != NULL );

TransExtInfo *e = (TransExtInfo *)infoStruct;
/// first check whether cf->extRing != NULL and delete old ring???
cf->extRing = e->r;
Expand Down

0 comments on commit a55ef03

Please sign in to comment.