My Project
Macros | Functions
clapconv.cc File Reference
#include "misc/auxiliary.h"
#include "factory/factory.h"
#include "coeffs/coeffs.h"
#include "coeffs/longrat.h"
#include "polys/monomials/p_polys.h"
#include "polys/sbuckets.h"
#include "polys/clapconv.h"
#include "simpleideals.h"
#include "polys/ext_fields/transext.h"

Go to the source code of this file.

Macros

#define TRANSEXT_PRIVATES
 
#define MIN_CONV_LEN   7
 

Functions

void out_cf (const char *s1, const CanonicalForm &f, const char *s2)
 
static void conv_RecPP (const CanonicalForm &f, int *exp, sBucket_pt result, ring r)
 
static void convRecTrP (const CanonicalForm &f, int *exp, poly &result, int offs, const ring r)
 
static number convFactoryNSingAN (const CanonicalForm &f, const ring r)
 
poly convFactoryPSingP (const CanonicalForm &f, const ring r)
 
static void convPhalf (poly p, int l, poly &p1, poly &p2)
 
static poly convPunhalf (poly p1, poly p2)
 
static CanonicalForm convSingPFactoryP_intern (poly p, int l, BOOLEAN &setChar, const ring r)
 
CanonicalForm convSingPFactoryP (poly p, const ring r)
 
int convFactoryISingI (const CanonicalForm &f)
 
CanonicalForm convSingAPFactoryAP (poly p, const Variable &a, const ring r)
 
static void convRecAP_R (const CanonicalForm &f, int *exp, poly &result, int par_start, int var_start, const ring r)
 
poly convFactoryAPSingAP_R (const CanonicalForm &f, int par_start, int var_start, const ring r)
 
poly convFactoryAPSingAP (const CanonicalForm &f, const ring r)
 
CanonicalForm convSingAFactoryA (poly p, const Variable &a, const ring r)
 
poly convFactoryASingA (const CanonicalForm &f, const ring r)
 
CanonicalForm convSingTrPFactoryP (poly p, const ring r)
 
BOOLEAN convSingTrP (poly p, const ring r)
 
poly convFactoryPSingTrP (const CanonicalForm &f, const ring r)
 

Macro Definition Documentation

◆ MIN_CONV_LEN

#define MIN_CONV_LEN   7

Definition at line 102 of file clapconv.cc.

◆ TRANSEXT_PRIVATES

#define TRANSEXT_PRIVATES

Definition at line 27 of file clapconv.cc.

Function Documentation

◆ conv_RecPP()

static void conv_RecPP ( const CanonicalForm f,
int *  exp,
sBucket_pt  result,
ring  r 
)
static

Definition at line 54 of file clapconv.cc.

55 {
56  // assume f!=0
57  if ( ! f.inCoeffDomain() )
58  {
59  int l = f.level();
60  for ( CFIterator i = f; i.hasTerms(); i++ )
61  {
62  exp[l] = i.exp();
63  conv_RecPP( i.coeff(), exp, result, r );
64  }
65  exp[l] = 0;
66  }
67  else
68  {
69  number n=r->cf->convFactoryNSingN(f, r->cf);
70  if ( n_IsZero(n, r->cf) )
71  {
72  n_Delete(&n,r->cf);
73  }
74  else
75  {
76  poly term = p_Init(r);
77  //pNext( term ) = NULL; // done by p_Init
78  pGetCoeff(term)=n;
79  p_SetExpV(term,exp,r);
81  }
82  }
83 }
int l
Definition: cfEzgcd.cc:100
int i
Definition: cfEzgcd.cc:132
FILE * f
Definition: checklibs.c:9
static void conv_RecPP(const CanonicalForm &f, int *exp, sBucket_pt result, ring r)
Definition: clapconv.cc:54
class to iterate through CanonicalForm's
Definition: cf_iter.h:44
Definition: int_poly.h:33
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:465
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:456
return result
Definition: facAbsBiFact.cc:75
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:44
gmp_float exp(const gmp_float &a)
Definition: mpr_complex.cc:357
static void p_SetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1504
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1280
void sBucket_Merge_m(sBucket_pt bucket, poly p)
Definition: sbuckets.cc:127

◆ convFactoryAPSingAP()

poly convFactoryAPSingAP ( const CanonicalForm f,
const ring  r 
)

Definition at line 184 of file clapconv.cc.

185 {
186  return convFactoryAPSingAP_R(f,0,rPar(r),r);
187 }
poly convFactoryAPSingAP_R(const CanonicalForm &f, int par_start, int var_start, const ring r)
Definition: clapconv.cc:173
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:601

◆ convFactoryAPSingAP_R()

poly convFactoryAPSingAP_R ( const CanonicalForm f,
int  par_start,
int  var_start,
const ring  r 
)

Definition at line 173 of file clapconv.cc.

174 {
175  if (f.isZero()) return NULL;
176  int n = rVar(r)+rPar(r)+1;
177  int * exp = (int *)omAlloc0(n*sizeof(int));
178  poly result = NULL;
179  convRecAP_R( f, exp, result,par_start, var_start, r );
180  omFreeSize((ADDRESS)exp,n*sizeof(int));
181  return result;
182 }
void * ADDRESS
Definition: auxiliary.h:119
static void convRecAP_R(const CanonicalForm &f, int *exp, poly &result, int par_start, int var_start, const ring r)
Definition: clapconv.cc:189
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define NULL
Definition: omList.c:12
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:594

◆ convFactoryASingA()

poly convFactoryASingA ( const CanonicalForm f,
const ring  r 
)

Definition at line 284 of file clapconv.cc.

285 {
286  poly a=NULL;
287  for( CFIterator i=f; i.hasTerms(); i++)
288  {
289  number n= convFactoryNSingAN( i.coeff(), r );
290  if (n_IsZero(n,r->cf->extRing->cf))
291  {
292  n_Delete(&n,r->cf->extRing->cf);
293  }
294  else
295  {
296  poly t= p_Init (r->cf->extRing);
297  pGetCoeff(t)=n;
298  p_SetExp(t,1,i.exp(),r->cf->extRing);
299  //p_Setm(t,r->cf->extRing);// not needed for rings with 1 variable
300  a=p_Add_q(a,t,r->cf->extRing);
301  }
302  }
303  if (a!=NULL)
304  {
305  if( r->cf->extRing != NULL )
306  if (r->cf->extRing->qideal->m[0]!=NULL)
307  {
308  poly l=r->cf->extRing->qideal->m[0];
309  if (p_GetExp(a,1,r->cf->extRing) >= p_GetExp(l,1,r->cf->extRing))
310  a = p_PolyDiv (a, l, FALSE, r->cf->extRing); // ???
311  }
312  }
313  return a;
314 }
#define FALSE
Definition: auxiliary.h:96
static number convFactoryNSingAN(const CanonicalForm &f, const ring r)
Definition: clapconv.cc:275
poly p_PolyDiv(poly &p, const poly divisor, const BOOLEAN needResult, const ring r)
assumes that p and divisor are univariate polynomials in r, mentioning the same variable; assumes div...
Definition: p_polys.cc:1857
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:896
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:488
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:469

◆ convFactoryISingI()

int convFactoryISingI ( const CanonicalForm f)

Definition at line 142 of file clapconv.cc.

143 {
144  if (!f.isImm()) WerrorS("int overflow in det");
145  return f.intval();
146 }
void WerrorS(const char *s)
Definition: feFopen.cc:24

◆ convFactoryNSingAN()

static number convFactoryNSingAN ( const CanonicalForm f,
const ring  r 
)
static

Definition at line 275 of file clapconv.cc.

276 {
277  assume (r != NULL);
278  assume (r->cf != NULL);
279  assume (r->cf->extRing != NULL);
280  // r->cf->extRing->cf has to be Q or Z/p (the supported types of factory)
281  return n_convFactoryNSingN( f, r->cf->extRing->cf );
282 }
number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
Definition: numbers.cc:637
#define assume(x)
Definition: mod2.h:387

◆ convFactoryPSingP()

poly convFactoryPSingP ( const CanonicalForm f,
const ring  r 
)

Definition at line 40 of file clapconv.cc.

41 {
42  if (f.isZero()) return NULL;
43  int n = rVar(r)+1;
44  /* ASSERT( level( f ) <= pVariables, "illegal number of variables" ); */
45  int * exp = (int*)omAlloc0(n*sizeof(int));
46  sBucket_pt result_bucket=sBucketCreate(r);
47  conv_RecPP( f, exp, result_bucket, r );
48  poly result; int dummy;
49  sBucketDestroyMerge(result_bucket,&result,&dummy);
50  omFreeSize((ADDRESS)exp,n*sizeof(int));
51  return result;
52 }
sBucket_pt sBucketCreate(const ring r)
Definition: sbuckets.cc:96
void sBucketDestroyMerge(sBucket_pt bucket, poly *p, int *length)
Definition: sbuckets.h:61

◆ convFactoryPSingTrP()

poly convFactoryPSingTrP ( const CanonicalForm f,
const ring  r 
)

Definition at line 366 of file clapconv.cc.

367 {
368  if (f.isZero()) return NULL;
369  int n = rVar(r)+1;
370  int * exp = (int*)omAlloc0(n*sizeof(int));
371  poly result = NULL;
372  convRecTrP( f, exp, result , rPar(r), r );
373  omFreeSize((ADDRESS)exp,n*sizeof(int));
374  return result;
375 }
static void convRecTrP(const CanonicalForm &f, int *exp, poly &result, int offs, const ring r)
Definition: clapconv.cc:378

◆ convPhalf()

static void convPhalf ( poly  p,
int  l,
poly &  p1,
poly &  p2 
)
inlinestatic

Definition at line 85 of file clapconv.cc.

86 {
87  p1=p;
88  l=l/2;
89  while(l>1) { p=pNext(p); l--; }
90  p2=pNext(p);
91  pNext(p)=NULL;
92 }
int p
Definition: cfModGcd.cc:4080
#define pNext(p)
Definition: monomials.h:36

◆ convPunhalf()

static poly convPunhalf ( poly  p1,
poly  p2 
)
inlinestatic

Definition at line 94 of file clapconv.cc.

95 {
96  poly p=p1;
97  while(pNext(p1)!=NULL) { p1=pNext(p1);}
98  pNext(p1)=p2;
99  return p;
100 }

◆ convRecAP_R()

static void convRecAP_R ( const CanonicalForm f,
int *  exp,
poly &  result,
int  par_start,
int  var_start,
const ring  r 
)
static

Definition at line 189 of file clapconv.cc.

190 {
191  // assume f!=0
192  if ( ! f.inCoeffDomain() )
193  {
194  int l = f.level();
195  for ( CFIterator i = f; i.hasTerms(); i++ )
196  {
197  exp[l] = i.exp();
198  convRecAP_R( i.coeff(), exp, result, par_start, var_start, r);
199  }
200  exp[l] = 0;
201  }
202  else
203  {
204  poly z=(poly)convFactoryASingA( f,r );
205  if (z!=NULL)
206  {
207  poly term = p_Init(r);
208  //pNext( term ) = NULL; // done by p_Init
209  int i;
210  for ( i = rVar(r); i>0 ; i-- )
211  p_SetExp( term, i , exp[i+var_start],r);
212  //if (rRing_has_Comp(currRing->extRing)) p_SetComp(term, 0, currRing->extRing); // done by pInit
213  if (par_start==0)
214  {
215  for ( i = 1; i <= var_start; i++ )
216  //z->e[i-1]+=exp[i];
217  p_AddExp(z,i,exp[i],r->cf->extRing);
218  }
219  else
220  {
221  for ( i = par_start+1; i <= var_start+rPar(r); i++ )
222  //z->e[i-1]+=exp[i];
223  p_AddExp(z,i,exp[i-par_start],r->cf->extRing);
224  }
225  p_GetCoeff(term, r->cf->extRing)=(number) z;
226  p_Setm( term,r );
227  result = p_Add_q( result, term, r );
228  }
229  }
230 }
poly convFactoryASingA(const CanonicalForm &f, const ring r)
Definition: clapconv.cc:284
#define p_GetCoeff(p, r)
Definition: monomials.h:50
static long p_AddExp(poly p, int v, long ee, ring r)
Definition: p_polys.h:606
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:233

◆ convRecTrP()

static void convRecTrP ( const CanonicalForm f,
int *  exp,
poly &  result,
int  offs,
const ring  r 
)
static

Definition at line 378 of file clapconv.cc.

379 {
380  // assume f!= 0
381  if ( f.level() > offs )
382  {
383  int l = f.level();
384  for ( CFIterator i = f; i.hasTerms(); i++ )
385  {
386  exp[l-offs] = i.exp();
387  convRecTrP( i.coeff(), exp, result, offs, r );
388  }
389  exp[l-offs] = 0;
390  }
391  else
392  {
393  poly term = p_Init(r);
394  //pNext( term ) = NULL; // done by p_Init
395  for ( int i = rVar(r); i>0; i-- )
396  p_SetExp( term, i ,exp[i], r);
397  //if (rRing_has_Comp(currRing)) p_SetComp(term, 0, currRing); // done by pInit
398  pGetCoeff(term)=ntInit(convFactoryPSingP( f, r->cf->extRing ), r->cf);
399  p_Setm( term,r );
400  result = p_Add_q( result, term,r );
401  }
402 }
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
Definition: clapconv.cc:40
number ntInit(long i, const coeffs cf)
Definition: transext.cc:704

◆ convSingAFactoryA()

CanonicalForm convSingAFactoryA ( poly  p,
const Variable a,
const ring  r 
)

Definition at line 232 of file clapconv.cc.

233 {
234  CanonicalForm result = 0;
235  int e;
236 
237  while ( p!=NULL )
238  {
240  if ( rField_is_Zp_a(r) )
241  {
242  term = n_Int( p_GetCoeff( p, r->cf->extRing ), r->cf->extRing->cf );
243  }
244  else
245  {
246  if ( SR_HDL(p_GetCoeff( p, r->cf->extRing )) & SR_INT )
247  term = SR_TO_INT(p_GetCoeff( p, r->cf->extRing )) ;
248  else
249  {
250  if ( p_GetCoeff( p, r->cf->extRing )->s == 3 )
251  {
252  mpz_t dummy;
253  mpz_init_set( dummy, (p_GetCoeff( p,r->cf->extRing )->z) );
254  term = make_cf( dummy );
255  }
256  else
257  {
258  // assume s==0 or s==1
259  mpz_t num, den;
260  On(SW_RATIONAL);
261  mpz_init_set( num, (p_GetCoeff( p, r->cf->extRing )->z) );
262  mpz_init_set( den, (p_GetCoeff( p, r->cf->extRing )->n) );
263  term = make_cf( num, den, ( p_GetCoeff( p, r->cf->extRing )->s != 1 ));
264  }
265  }
266  }
267  if ( (e = p_GetExp( p, 1, r->cf->extRing )) != 0 )
268  term *= power( a , e );
269  result += term;
270  p = pNext( p );
271  }
272  return result;
273 }
void On(int sw)
switches
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
CanonicalForm num(const CanonicalForm &f)
CanonicalForm den(const CanonicalForm &f)
static const int SW_RATIONAL
set to 1 for computations over Q
Definition: cf_defs.h:30
factory's main class
Definition: canonicalform.h:86
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition: coeffs.h:548
CanonicalForm FACTORY_PUBLIC make_cf(const mpz_ptr n)
Definition: singext.cc:66
#define SR_INT
Definition: longrat.h:67
#define SR_TO_INT(SR)
Definition: longrat.h:69
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:531
#define SR_HDL(A)
Definition: tgb.cc:35

◆ convSingAPFactoryAP()

CanonicalForm convSingAPFactoryAP ( poly  p,
const Variable a,
const ring  r 
)

Definition at line 148 of file clapconv.cc.

149 {
150  CanonicalForm result = 0;
151  int e, n = r-> N;
152  int off=rPar(r);
153 
154  if (!rField_is_Zp_a(r))
155  On(SW_RATIONAL);
156  while ( p!=NULL)
157  {
158  CanonicalForm term=convSingAFactoryA(((poly)p_GetCoeff(p, r->cf->extRing)),a, r);
159  for ( int i = 1; i <= n; i++ )
160  {
161  if ( (e = p_GetExp( p, i, r )) != 0 )
162  term *= CanonicalForm( Variable( i + off), e );
163  }
164  result += term;
165  pIter( p );
166  }
167  return result;
168 }
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:56
CanonicalForm convSingAFactoryA(poly p, const Variable &a, const ring r)
Definition: clapconv.cc:232
factory's class for variables
Definition: factory.h:134
#define pIter(p)
Definition: monomials.h:37

◆ convSingPFactoryP()

CanonicalForm convSingPFactoryP ( poly  p,
const ring  r 
)

Definition at line 136 of file clapconv.cc.

137 {
138  BOOLEAN setChar=TRUE;
139  return convSingPFactoryP_intern(p,pLength(p),setChar,r);
140 }
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
static CanonicalForm convSingPFactoryP_intern(poly p, int l, BOOLEAN &setChar, const ring r)
Definition: clapconv.cc:103
static unsigned pLength(poly a)
Definition: p_polys.h:191

◆ convSingPFactoryP_intern()

static CanonicalForm convSingPFactoryP_intern ( poly  p,
int  l,
BOOLEAN setChar,
const ring  r 
)
static

Definition at line 103 of file clapconv.cc.

104 {
105  CanonicalForm result = 0;
106  int e, n = rVar(r);
107  assume(l==pLength(p));
108 
109  if (l>MIN_CONV_LEN)
110  {
111  poly p1,p2;
112  convPhalf(p,l,p1,p2);
113  CanonicalForm P=convSingPFactoryP_intern(p1,l/2,setChar,r);
114  P+=convSingPFactoryP_intern(p2,l-l/2,setChar,r);
115  convPunhalf(p1,p2);
116  return P;
117  }
118  BOOLEAN setChar_loc=setChar;
119  setChar=FALSE;
120  while ( p!=NULL )
121  {
122  CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar_loc, r->cf);
123  if (errorreported) break;
124  setChar_loc=FALSE;
125  for ( int i = 1; i <=n; i++ )
126  {
127  if ( (e = p_GetExp( p, i, r)) != 0 )
128  term *= CanonicalForm( Variable( i ), e );
129  }
130  result += term;
131  pIter( p );
132  }
133  return result;
134 }
static void convPhalf(poly p, int l, poly &p1, poly &p2)
Definition: clapconv.cc:85
#define MIN_CONV_LEN
Definition: clapconv.cc:102
static poly convPunhalf(poly p1, poly p2)
Definition: clapconv.cc:94
VAR short errorreported
Definition: feFopen.cc:23

◆ convSingTrP()

BOOLEAN convSingTrP ( poly  p,
const ring  r 
)

Definition at line 352 of file clapconv.cc.

353 {
354  while ( p!=NULL )
355  {
356  n_Normalize(p_GetCoeff(p, r), r->cf);
357 
358  // test if denominator is constant
359  if (!p_IsConstant(DEN ((fraction)p_GetCoeff (p,r)),r->cf->extRing))
360  return FALSE;
361  pIter(p);
362  }
363  return TRUE;
364 }
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:579
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1971

◆ convSingTrPFactoryP()

CanonicalForm convSingTrPFactoryP ( poly  p,
const ring  r 
)

Definition at line 316 of file clapconv.cc.

317 {
318  CanonicalForm result = 0;
319  int e, n = rVar(r);
320  int offs = rPar(r);
321 
322  while ( p!=NULL )
323  {
324  //n_Normalize(p_GetCoeff(p, r), r->cf);
325 
326  // test if denominator is constant
327  if (!errorreported && !p_IsConstant(DEN ((fraction)p_GetCoeff (p,r)),r->cf->extRing))
328  WerrorS("conversion error: denominator!= 1");
329 
330  CanonicalForm term=convSingPFactoryP(NUM ((fraction)p_GetCoeff(p, r)),r->cf->extRing);
331 
332  // if denominator is not NULL it should be a constant at this point
333  if (DEN ((fraction)p_GetCoeff(p,r)) != NULL)
334  {
335  CanonicalForm den= convSingPFactoryP(DEN ((fraction)p_GetCoeff(p, r)),r->cf->extRing);
336  if (rChar (r) == 0)
337  On (SW_RATIONAL);
338  term /= den;
339  }
340 
341  for ( int i = n; i > 0; i-- )
342  {
343  if ( (e = p_GetExp( p, i,r )) != 0 )
344  term = term * power( Variable( i + offs ), e );
345  }
346  result += term;
347  p = pNext( p );
348  }
349  return result;
350 }
CanonicalForm convSingPFactoryP(poly p, const ring r)
Definition: clapconv.cc:136
@ NUM
Definition: readcf.cc:170
int rChar(ring r)
Definition: ring.cc:711

◆ out_cf()

void out_cf ( const char *  s1,
const CanonicalForm f,
const char *  s2 
)

Definition at line 99 of file cf_factor.cc.

100 {
101  printf("%s",s1);
102  if (f.isZero()) printf("+0");
103  //else if (! f.inCoeffDomain() )
104  else if (! f.inBaseDomain() )
105  {
106  int l = f.level();
107  for ( CFIterator i = f; i.hasTerms(); i++ )
108  {
109  int e=i.exp();
110  if (i.coeff().isOne())
111  {
112  printf("+");
113  if (e==0) printf("1");
114  else
115  {
116  printf("%c",'a'+l-1);
117  if (e!=1) printf("^%d",e);
118  }
119  }
120  else
121  {
122  out_cf("+(",i.coeff(),")");
123  if (e!=0)
124  {
125  printf("*%c",'a'+l-1);
126  if (e!=1) printf("^%d",e);
127  }
128  }
129  }
130  }
131  else
132  {
133  if ( f.isImm() )
134  {
136  {
137  long a= imm2int (f.getval());
138  if ( a == gf_q )
139  printf ("+%ld", a);
140  else if ( a == 0L )
141  printf ("+1");
142  else if ( a == 1L )
143  printf ("+%c",gf_name);
144  else
145  {
146  printf ("+%c",gf_name);
147  printf ("^%ld",a);
148  }
149  }
150  else
151  {
152  long l=f.intval();
153  if (l<0) printf("%ld",l);
154  else printf("+%ld",l);
155  }
156  }
157  else
158  {
159  #ifdef NOSTREAMIO
160  if (f.inZ())
161  {
162  mpz_t m;
163  gmp_numerator(f,m);
164  char * str = new char[mpz_sizeinbase( m, 10 ) + 2];
165  str = mpz_get_str( str, 10, m );
166  puts(str);
167  delete[] str;
168  mpz_clear(m);
169  }
170  else if (f.inQ())
171  {
172  mpz_t m;
173  gmp_numerator(f,m);
174  char * str = new char[mpz_sizeinbase( m, 10 ) + 2];
175  str = mpz_get_str( str, 10, m );
176  while(str[strlen(str)]<' ') { str[strlen(str)]='\0'; }
177  puts(str);putchar('/');
178  delete[] str;
179  mpz_clear(m);
181  str = new char[mpz_sizeinbase( m, 10 ) + 2];
182  str = mpz_get_str( str, 10, m );
183  while(str[strlen(str)]<' ') { str[strlen(str)]='\0'; }
184  puts(str);
185  delete[] str;
186  mpz_clear(m);
187  }
188  #else
189  std::cout << f;
190  #endif
191  }
192  //if (f.inZ()) printf("(Z)");
193  //else if (f.inQ()) printf("(Q)");
194  //else if (f.inFF()) printf("(FF)");
195  //else if (f.inPP()) printf("(PP)");
196  //else if (f.inGF()) printf("(PP)");
197  //else
198  if (f.inExtension()) printf("E(%d)",f.level());
199  }
200  printf("%s",s2);
201 }
int m
Definition: cfEzgcd.cc:128
#define GaloisFieldDomain
Definition: cf_defs.h:24
void out_cf(const char *s1, const CanonicalForm &f, const char *s2)
cf_algorithm.cc - simple mathematical algorithms.
Definition: cf_factor.cc:99
static int gettype()
Definition: cf_factory.h:28
void FACTORY_PUBLIC gmp_numerator(const CanonicalForm &f, mpz_ptr result)
Definition: singext.cc:20
void FACTORY_PUBLIC gmp_denominator(const CanonicalForm &f, mpz_ptr result)
Definition: singext.cc:40
VAR int gf_q
Definition: gfops.cc:47
VAR char gf_name
Definition: gfops.cc:52
static long imm2int(const InternalCF *const imm)
Definition: imm.h:70
char * str(leftv arg)
Definition: shared.cc:704