Skip to content

Commit 01c1d06

Browse files
Oleksandr Motsakmohamed-barakat
authored andcommitted
FIX: moved P/minpoly/parameters from ring to coeff
1 parent 0b7bf7e commit 01c1d06

10 files changed

Lines changed: 174 additions & 179 deletions

File tree

libpolys/coeffs/coeffs.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ struct n_Procs_s
153153
int char_flag;
154154
int ref;
155155
n_coeffType type;
156-
////-----------------------------------------
157-
char** parameter; /* names of parameters, rInit */
158-
number minpoly; /* for Q_a/Zp_a, rInit */
156+
//-------------------------------------------
157+
char** parameter; //< names of parameters, rInit
158+
short P; //< number of pars, rInit
159+
number minpoly; //< for Q_a/Zp_a, rInit
159160

160161
#ifdef HAVE_RINGS
161162
/* The following members are for representing the ring Z/n,

libpolys/polys/OBSOLETE_pInitContent.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void p_Content(poly ph, const ring r)
4242
p=ph;
4343
}
4444
else if ((rField_is_Extension(r))
45-
&& ((rPar(r)>1)||(r->minpoly==NULL)))
45+
&& ((rPar(r)>1)||(r->cf->minpoly==NULL)))
4646
{
4747
h=pInitContent_a(ph);
4848
p=ph;
@@ -750,7 +750,7 @@ poly pPermPoly (poly p, int * perm, const ring oldRing, nMapFunc nMap,
750750
{
751751
qq = pInit();
752752
number n=nMap(pGetCoeff(p));
753-
if ((currRing->minpoly!=NULL)
753+
if ((currRing->cf->minpoly!=NULL)
754754
&& ((rField_is_Zp_a()) || (rField_is_Q_a())))
755755
{
756756
nNormalize(n);
@@ -762,7 +762,7 @@ poly pPermPoly (poly p, int * perm, const ring oldRing, nMapFunc nMap,
762762
{
763763
qq=pOne();
764764
aq=napPermNumber(pGetCoeff(p),par_perm,OldPar, oldRing);
765-
if ((aq!=NULL) && (currRing->minpoly!=NULL)
765+
if ((aq!=NULL) && (currRing->cf->minpoly!=NULL)
766766
&& ((rField_is_Zp_a()) || (rField_is_Q_a())))
767767
{
768768
pNormalize(aq);
@@ -828,7 +828,7 @@ poly pPermPoly (poly p, int * perm, const ring oldRing, nMapFunc nMap,
828828
}
829829
}
830830
if (mapped_to_par
831-
&& (currRing->minpoly!=NULL))
831+
&& (currRing->cf->minpoly!=NULL))
832832
{
833833
number n=pGetCoeff(qq);
834834
nNormalize(n);

libpolys/polys/kbuckets.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ static BOOLEAN nIsPseudoUnit(number n, ring r)
11541154
{
11551155
if (rField_is_Zp(r))
11561156
return TRUE;
1157-
if (r->parameter==NULL)
1157+
if (r->cf->parameter==NULL)
11581158
{
11591159
return (r->cf->cfSize(n,r->cf)==1);
11601160
}

libpolys/polys/monomials/maps.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ poly maEval(map theMap, poly p,ring preimage_r,nMapFunc nMap, ideal s, const rin
154154
}
155155
omFreeSize((ADDRESS)monoms,l*sizeof(poly));
156156
}
157-
if (dst_r->minpoly!=NULL) result=p_MinPolyNormalize(result, dst_r);
157+
if (dst_r->cf->minpoly!=NULL) result=p_MinPolyNormalize(result, dst_r);
158158
}
159159
return result;
160160
}
@@ -269,9 +269,9 @@ poly maIMap(ring r, poly p, const ring dst_r)
269269
nMapFunc nMap=n_SetMap(r->cf,dst_r->cf);
270270
int *perm=(int *)omAlloc0((r->N+1)*sizeof(int));
271271
//int *par_perm=(int *)omAlloc0(rPar(r)*sizeof(int));
272-
maFindPerm(r->names,r->N, r->parameter, r->P,
273-
dst_r->names,dst_r->N,dst_r->parameter, dst_r->P,
274-
perm,NULL, dst_r->ch);
272+
maFindPerm(r->names, rVar(r), r->cf->parameter, rPar(r),
273+
dst_r->names, rVar(dst_r),dst_r->cf->parameter, rPar(dst_r),
274+
perm,NULL, dst_r->cf->ch);
275275
poly res=p_PermPoly(p,perm,r,dst_r, nMap /*,par_perm,rPar(r)*/);
276276
omFreeSize((ADDRESS)perm,(r->N+1)*sizeof(int));
277277
//omFreeSize((ADDRESS)par_perm,rPar(r)*sizeof(int));

libpolys/polys/monomials/p_polys.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ void p_Content(poly ph, const ring r)
18561856
p=ph;
18571857
}
18581858
else if ((rField_is_Extension(r))
1859-
&& ((rPar(r)>1)||(r->minpoly==NULL)))
1859+
&& ((rPar(r)>1)||(r->cf->minpoly==NULL)))
18601860
{
18611861
h=p_InitContent_a(ph,r);
18621862
p=ph;
@@ -3239,7 +3239,7 @@ poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst,
32393239
{
32403240
qq = p_Init(dst);
32413241
number n=nMap(pGetCoeff(p),oldRing->cf,dst->cf);
3242-
if ((dst->minpoly!=NULL)
3242+
if ((dst->cf->minpoly!=NULL)
32433243
&& ((rField_is_Zp_a(dst)) || (rField_is_Q_a(dst))))
32443244
{
32453245
n_Normalize(n,dst->cf);
@@ -3253,7 +3253,7 @@ poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst,
32533253
WerrorS("longalg missing");
32543254
#if 0
32553255
aq=naPermNumber(pGetCoeff(p),par_perm,OldPar, oldRing);
3256-
if ((dst->minpoly!=NULL)
3256+
if ((dst->cf->minpoly!=NULL)
32573257
&& ((rField_is_Zp_a(dst)) || (rField_is_Q_a(dst))))
32583258
{
32593259
poly tmp=aq;
@@ -3328,7 +3328,7 @@ poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst,
33283328
}
33293329
}
33303330
if (mapped_to_par
3331-
&& (dst->minpoly!=NULL))
3331+
&& (dst->cf->minpoly!=NULL))
33323332
{
33333333
number n=pGetCoeff(qq);
33343334
n_Normalize(n,dst->cf);

0 commit comments

Comments
 (0)