Functions
OPAE.cc File Reference
#include <misc/auxiliary.h>
#include <omalloc/omalloc.h>
#include <factory/factory.h>
#include <misc/mylimits.h>
#include <reporter/reporter.h>
#include "coeffs.h"
#include "numbers.h"
#include "mpr_complex.h"
#include "OPAE.h"
#include "AE.h"
#include <string.h>

Go to the source code of this file.

Functions

BOOLEAN nAECoeffIsEqual (number a, number b, const coeffs r)
 
number nAEMult (number a, number b, const coeffs r)
 
number nAESub (number a, number b, const coeffs r)
 
number nAEAdd (number a, number b, const coeffs r)
 
number nAEDiv (number a, number b, const coeffs r)
 
number nAEIntMod (number a, number b, const coeffs r)
 
number nAEExactDiv (number a, number b, const coeffs r)
 
number nAEInit (long i, const coeffs r)
 
number nAEInitMPZ (mpz_t m, const coeffs r)
 
int nAESize (number a, const coeffs r)
 
long nAEInt (number &a, const coeffs r)
 
number nAEMPZ (number a, const coeffs r)
 
number nAENeg (number c, const coeffs r)
 
number nAECopy (number a, number b, const coeffs r)
 
number nAERePart (number a, number b, const coeffs r)
 
number nAEImPart (number a, number b, const coeffs r)
 
void nAEWriteLong (number a, const coeffs r)
 
void nAEWriteShort (number a, const coeffs r)
 
const char * nAERead (const char *s, number *a, const coeffs r)
 
number nAENormalize (number a, number b, const coeffs r)
 
BOOLEAN nAEGreater (number a, number b, const coeffs r)
 
BOOLEAN nAEEqual (number a, number b, const coeffs r)
 
BOOLEAN nAEIsZero (number a, const coeffs r)
 
BOOLEAN nAEIsOne (number a, const coeffs r)
 
BOOLEAN nAEIsMOne (number a, const coeffs r)
 
BOOLEAN nAEGreaterZero (number a, number b, const coeffs r)
 
void nAEPower (number a, int i, number *result, const coeffs r)
 
number nAEGetDenom (number &a, const coeffs r)
 
number nAEGetNumerator (number &a, const coeffs r)
 
number nAEGcd (number a, number b, const coeffs r)
 
number nAELcm (number a, number b, const coeffs r)
 
void nAEDelete (number *a, const coeffs r)
 
number nAESetMap (number a, const coeffs r)
 
void nAEInpMult (number &a, number b, const coeffs r)
 
void nAECoeffWrite (const coeffs r, BOOLEAN details)
 
BOOLEAN nAEClearContent (number a, const coeffs r)
 
BOOLEAN nAEClearDenominators (number a, const coeffs r)
 
number nAECopy (number c, const coeffs)
 
number nAERePart (number c, const coeffs)
 
number nAEImPart (number c, const coeffs)
 
BOOLEAN nAEGreaterZero (number a, const coeffs r)
 
nMapFunc nAESetMap (const coeffs src, const coeffs dst)
 
static char * n_AECoeffName (const coeffs r)
 
BOOLEAN n_AEInitChar (coeffs r, void *)
 

Function Documentation

static char* n_AECoeffName ( const coeffs  r)
static

Definition at line 331 of file OPAE.cc.

332 {
333  return (char *)"AE";
334 }
BOOLEAN n_AEInitChar ( coeffs  r,
void *   
)

Definition at line 339 of file OPAE.cc.

340 {
341  // r->is_field, r->is_domain?
342  r->ch = 0;
343  //r->cfKillChar = ndKillChar; /* dummy */
344  //r->nCoeffIsEqual=ndCoeffIsEqual;
345  r->cfMult = nAEMult;
346  r->cfSub = nAESub;
347  r->cfAdd = nAEAdd;
348  r->cfDiv = nAEDiv;
349  r->cfIntMod= nAEIntMod;
350  r->cfExactDiv= nAEExactDiv;
351  r->cfInit = nAEInit;
352  r->cfSize = nAESize;
353  r->cfInt = nAEInt;
354  r->cfCoeffName = n_AECoeffName;
355 #ifdef HAVE_RINGS
356  //r->cfDivComp = NULL; // only for ring stuff
357  //r->cfIsUnit = NULL; // only for ring stuff
358  //r->cfGetUnit = NULL; // only for ring stuff
359  //r->cfExtGcd = NULL; // only for ring stuff
360  // r->cfDivBy = NULL; // only for ring stuff
361 #endif
362  r->cfInpNeg = nAENeg;
363  r->cfInvers= NULL;
364  //r->cfCopy = ndCopy;
365  //r->cfRePart = ndCopy;
366  //r->cfImPart = ndReturn0;
367  r->cfWriteLong = nAEWriteLong;
368  r->cfRead = nAERead;
369  //r->cfNormalize=ndNormalize;
370  r->cfGreater = nAEGreater;
371  r->cfEqual = nAEEqual;
372  r->cfIsZero = nAEIsZero;
373  r->cfIsOne = nAEIsOne;
374  r->cfIsMOne = nAEIsOne;
375  r->cfGreaterZero = nAEGreaterZero;
376  r->cfPower = nAEPower; // ZU BEARBEITEN
377  r->cfGetDenom = nAEGetDenom;
378  r->cfGetNumerator = nAEGetNumerator;
379  r->cfGcd = nAEGcd;
380  r->cfLcm = nAELcm; // ZU BEARBEITEN
381  r->cfDelete= nAEDelete;
382 
383  r->cfSetMap = nAESetMap;
384 
385  r->cfInpMult=nAEInpMult; //????
386  r->cfCoeffWrite=nAECoeffWrite; //????
387 
388 
389  // the variables:
390  r->nNULL = (number) 0;
391  //r->type = n_AE;
392  r->ch = 0;
393  r->has_simple_Alloc=TRUE;
394  r->has_simple_Inverse=TRUE;
395  return FALSE;
396 }
number nAEGcd(number a, number b, const coeffs r)
Definition: OPAE.cc:279
BOOLEAN nAEGreater(number a, number b, const coeffs r)
Definition: OPAE.cc:221
const char * nAERead(const char *s, number *a, const coeffs r)
Definition: OPAE.cc:209
#define FALSE
Definition: auxiliary.h:140
void nAEDelete(number *a, const coeffs r)
Definition: OPAE.cc:300
BOOLEAN nAEIsZero(number a, const coeffs r)
Definition: OPAE.cc:237
BOOLEAN nAEIsOne(number a, const coeffs r)
Definition: OPAE.cc:244
long nAEInt(number &a, const coeffs r)
Definition: OPAE.cc:158
#define TRUE
Definition: auxiliary.h:144
number nAESetMap(number a, const coeffs r)
number nAELcm(number a, number b, const coeffs r)
Definition: OPAE.cc:288
void nAEPower(number a, int i, number *result, const coeffs r)
Definition: OPAE.cc:264
BOOLEAN nAEEqual(number a, number b, const coeffs r)
Definition: OPAE.cc:229
number nAENeg(number c, const coeffs r)
Definition: OPAE.cc:170
number nAEIntMod(number a, number b, const coeffs r)
Definition: OPAE.cc:116
void nAEInpMult(number &a, number b, const coeffs r)
Definition: OPAE.cc:311
number nAEGetDenom(number &a, const coeffs r)
Definition: OPAE.cc:269
number nAEInit(long i, const coeffs r)
Definition: OPAE.cc:133
number nAEAdd(number a, number b, const coeffs r)
Definition: OPAE.cc:74
number nAEGetNumerator(number &a, const coeffs r)
Definition: OPAE.cc:274
int nAESize(number a, const coeffs r)
Definition: OPAE.cc:152
static char * n_AECoeffName(const coeffs r)
Definition: OPAE.cc:331
#define NULL
Definition: omList.c:10
number nAESub(number a, number b, const coeffs r)
Definition: OPAE.cc:94
number nAEDiv(number a, number b, const coeffs r)
Definition: OPAE.cc:105
number nAEExactDiv(number a, number b, const coeffs r)
Definition: OPAE.cc:121
void nAEWriteLong(number a, const coeffs r)
Definition: OPAE.cc:194
BOOLEAN nAEGreaterZero(number a, number b, const coeffs r)
number nAEMult(number a, number b, const coeffs r)
Definition: OPAE.cc:84
void nAECoeffWrite(const coeffs r, BOOLEAN details)
Definition: OPAE.cc:316
number nAEAdd ( number  a,
number  b,
const coeffs  r 
)

Definition at line 74 of file OPAE.cc.

75 {
76  int_poly* f=reinterpret_cast<int_poly*> (a);
77  int_poly* g=reinterpret_cast<int_poly*> (b);
78  int_poly *res=new int_poly;
79  res->poly_set(*f);
80  res->poly_add_to(*g);
81  return (number) res;
82 }
const poly a
Definition: syzextra.cc:212
g
Definition: cfModGcd.cc:4031
poly res
Definition: myNF.cc:322
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
FILE * f
Definition: checklibs.c:7
const poly b
Definition: syzextra.cc:213
void poly_add_to(const int_poly)
Definition: AE.cc:83
BOOLEAN nAEClearContent ( number  a,
const coeffs  r 
)

Definition at line 321 of file OPAE.cc.

322 {
323  return FALSE;
324 }
#define FALSE
Definition: auxiliary.h:140
BOOLEAN nAEClearDenominators ( number  a,
const coeffs  r 
)

Definition at line 326 of file OPAE.cc.

327 {
328  return FALSE;
329 }
#define FALSE
Definition: auxiliary.h:140
BOOLEAN nAECoeffIsEqual ( number  a,
number  b,
const coeffs  r 
)
void nAECoeffWrite ( const coeffs  r,
BOOLEAN  details 
)

Definition at line 316 of file OPAE.cc.

317 {
318  return;
319 }
number nAECopy ( number  a,
number  b,
const coeffs  r 
)
number nAECopy ( number  c,
const coeffs   
)

Definition at line 179 of file OPAE.cc.

180 {
181  return (number) c;
182 }
void nAEDelete ( number *  a,
const coeffs  r 
)

Definition at line 300 of file OPAE.cc.

301 {
302  return;
303 }
number nAEDiv ( number  a,
number  b,
const coeffs  r 
)

Definition at line 105 of file OPAE.cc.

106 {
107  int_poly* f=reinterpret_cast<int_poly*> (a);
108  int_poly* g=reinterpret_cast<int_poly*> (b);
109  int_poly *res=new int_poly;
110  res->poly_set(*f);
111  res->poly_div_to(*res,*f,*g);
112  return (number) res;
113 }
const poly a
Definition: syzextra.cc:212
g
Definition: cfModGcd.cc:4031
poly res
Definition: myNF.cc:322
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
FILE * f
Definition: checklibs.c:7
void poly_div_to(int_poly &, int_poly &, const int_poly)
Definition: AE.cc:579
const poly b
Definition: syzextra.cc:213
BOOLEAN nAEEqual ( number  a,
number  b,
const coeffs  r 
)

Definition at line 229 of file OPAE.cc.

230 {
231  int_poly* f=reinterpret_cast<int_poly*> (a);
232  int_poly* g=reinterpret_cast<int_poly*> (b);
233  if (f->is_equal(*g) == 1) {return FALSE;}
234  else {return TRUE;}
235 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
g
Definition: cfModGcd.cc:4031
Definition: AE.h:9
int is_equal(const int_poly) const
Definition: AE.cc:823
FILE * f
Definition: checklibs.c:7
const poly b
Definition: syzextra.cc:213
number nAEExactDiv ( number  a,
number  b,
const coeffs  r 
)

Definition at line 121 of file OPAE.cc.

122 {
123  int_poly* f=reinterpret_cast<int_poly*> (a);
124  int_poly* g=reinterpret_cast<int_poly*> (b);
125  int_poly *res=new int_poly;
126  res->poly_set(*f);
127  res->poly_div_to(*res,*f,*g);
128  return (number) res;
129 }
const poly a
Definition: syzextra.cc:212
g
Definition: cfModGcd.cc:4031
poly res
Definition: myNF.cc:322
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
FILE * f
Definition: checklibs.c:7
void poly_div_to(int_poly &, int_poly &, const int_poly)
Definition: AE.cc:579
const poly b
Definition: syzextra.cc:213
number nAEGcd ( number  a,
number  b,
const coeffs  r 
)

Definition at line 279 of file OPAE.cc.

280 {
281  int_poly* f=reinterpret_cast<int_poly*> (a);
282  int_poly* g=reinterpret_cast<int_poly*> (b);
283  int_poly *res=new int_poly;
284  res->poly_gcd(*f,*g);
285  return (number) res;
286 }
void poly_gcd(int_poly, int_poly)
Definition: AE.cc:868
const poly a
Definition: syzextra.cc:212
g
Definition: cfModGcd.cc:4031
poly res
Definition: myNF.cc:322
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
const poly b
Definition: syzextra.cc:213
number nAEGetDenom ( number &  a,
const coeffs  r 
)

Definition at line 269 of file OPAE.cc.

270 {
271  return (number) 1;
272 }
number nAEGetNumerator ( number &  a,
const coeffs  r 
)

Definition at line 274 of file OPAE.cc.

275 {
276  return a;
277 }
const poly a
Definition: syzextra.cc:212
BOOLEAN nAEGreater ( number  a,
number  b,
const coeffs  r 
)

Definition at line 221 of file OPAE.cc.

222 {
223  int_poly* f=reinterpret_cast<int_poly*> (a);
224  int_poly* g=reinterpret_cast<int_poly*> (b);
225  if (f->deg > g->deg) {return FALSE;}
226  else {return TRUE;}
227 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
int deg
Definition: AE.h:15
#define TRUE
Definition: auxiliary.h:144
g
Definition: cfModGcd.cc:4031
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
const poly b
Definition: syzextra.cc:213
BOOLEAN nAEGreaterZero ( number  a,
number  b,
const coeffs  r 
)
BOOLEAN nAEGreaterZero ( number  a,
const coeffs  r 
)

Definition at line 258 of file OPAE.cc.

259 {
260  if (nAEIsZero(a, r) == FALSE) { return TRUE; }
261  else { return FALSE; }
262 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
BOOLEAN nAEIsZero(number a, const coeffs r)
Definition: OPAE.cc:237
#define TRUE
Definition: auxiliary.h:144
number nAEImPart ( number  a,
number  b,
const coeffs  r 
)
number nAEImPart ( number  c,
const coeffs   
)

Definition at line 189 of file OPAE.cc.

190 {
191  return (number) c;
192 }
number nAEInit ( long  i,
const coeffs  r 
)

Definition at line 133 of file OPAE.cc.

134 {
135  mpz_t m;
136  mpz_init_set_ui(m, i);
137  int_poly* res=new int_poly;
138  res->poly_set(m);
139  number res1=reinterpret_cast<number>(res);
140  return res1;
141 }
poly res
Definition: myNF.cc:322
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
number nAEInitMPZ ( mpz_t  m,
const coeffs  r 
)

Definition at line 143 of file OPAE.cc.

144 {
145  int_poly* res=new int_poly;
146  res->poly_set(m);
147  number res1=reinterpret_cast<number>(res);
148  return res1;
149 }
poly res
Definition: myNF.cc:322
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
int m
Definition: cfEzgcd.cc:119
void nAEInpMult ( number &  a,
number  b,
const coeffs  r 
)

Definition at line 311 of file OPAE.cc.

312 {
313  return ;
314 }
return
Definition: syzextra.cc:280
long nAEInt ( number &  a,
const coeffs  r 
)

Definition at line 158 of file OPAE.cc.

159 {
160  return 1;
161 }
number nAEIntMod ( number  a,
number  b,
const coeffs  r 
)

Definition at line 116 of file OPAE.cc.

117 {
118  return a;
119 }
const poly a
Definition: syzextra.cc:212
BOOLEAN nAEIsMOne ( number  a,
const coeffs  r 
)

Definition at line 251 of file OPAE.cc.

252 {
253  int_poly* f=reinterpret_cast<int_poly*> (a);
254  if (f->is_one() == 1) {return FALSE;}
255  else {return TRUE;}
256 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
int is_one() const
Definition: AE.cc:848
BOOLEAN nAEIsOne ( number  a,
const coeffs  r 
)

Definition at line 244 of file OPAE.cc.

245 {
246  int_poly* f=reinterpret_cast<int_poly*> (a);
247  if (f->is_one() == 1) {return FALSE;}
248  else {return TRUE;}
249 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
int is_one() const
Definition: AE.cc:848
BOOLEAN nAEIsZero ( number  a,
const coeffs  r 
)

Definition at line 237 of file OPAE.cc.

238 {
239  int_poly* f=reinterpret_cast<int_poly*> (a);
240  if (f->is_zero() == 1) {return FALSE;}
241  else {return TRUE;}
242 }
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
Definition: AE.h:9
int is_zero() const
Definition: AE.cc:839
FILE * f
Definition: checklibs.c:7
number nAELcm ( number  a,
number  b,
const coeffs  r 
)

Definition at line 288 of file OPAE.cc.

289 {
290  int_poly* f=reinterpret_cast<int_poly*> (a);
291  int_poly* g=reinterpret_cast<int_poly*> (b);
292  int_poly *gcd=new int_poly;
293  int_poly *res=new int_poly;
294  gcd->poly_gcd(*f,*g);
295  res->poly_mult_n(*f,*g);
296  res->poly_div_to(*res,*f,*gcd);
297  return (number) res;
298 }
void poly_gcd(int_poly, int_poly)
Definition: AE.cc:868
const poly a
Definition: syzextra.cc:212
void poly_mult_n(int_poly, int_poly)
Definition: AE.cc:383
g
Definition: cfModGcd.cc:4031
poly res
Definition: myNF.cc:322
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
void poly_div_to(int_poly &, int_poly &, const int_poly)
Definition: AE.cc:579
int gcd(int a, int b)
Definition: walkSupport.cc:839
const poly b
Definition: syzextra.cc:213
number nAEMPZ ( number  a,
const coeffs  r 
)

Definition at line 164 of file OPAE.cc.

165 {
166  return a;
167 }
const poly a
Definition: syzextra.cc:212
number nAEMult ( number  a,
number  b,
const coeffs  r 
)

Definition at line 84 of file OPAE.cc.

85 {
86  int_poly* f=reinterpret_cast<int_poly*> (a);
87  int_poly* g=reinterpret_cast<int_poly*> (b);
88  int_poly *res=new int_poly;
89  res->poly_set(*f);
90  res->poly_mult_n_to(*g);
91  return (number) res;
92 }
const poly a
Definition: syzextra.cc:212
g
Definition: cfModGcd.cc:4031
poly res
Definition: myNF.cc:322
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
FILE * f
Definition: checklibs.c:7
void poly_mult_n_to(const int_poly)
Definition: AE.cc:427
const poly b
Definition: syzextra.cc:213
number nAENeg ( number  c,
const coeffs  r 
)

Definition at line 170 of file OPAE.cc.

171 {
172  int_poly* f=reinterpret_cast<int_poly*> (c);
173  int_poly *res=new int_poly;
174  res->poly_set(*f);
175  res->poly_neg();
176  return (number) res;
177 }
poly res
Definition: myNF.cc:322
void poly_neg()
Definition: AE.cc:374
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
FILE * f
Definition: checklibs.c:7
number nAENormalize ( number  a,
number  b,
const coeffs  r 
)

Definition at line 216 of file OPAE.cc.

217 {
218  return a;
219 }
const poly a
Definition: syzextra.cc:212
void nAEPower ( number  a,
int  i,
number *  result,
const coeffs  r 
)

Definition at line 264 of file OPAE.cc.

265 {
266  return;
267 }
const char * nAERead ( const char *  s,
number *  a,
const coeffs  r 
)

Definition at line 209 of file OPAE.cc.

210 {
211  char* c=new char;
212  *c='c';
213  return c;
214 }
number nAERePart ( number  a,
number  b,
const coeffs  r 
)
number nAERePart ( number  c,
const coeffs   
)

Definition at line 184 of file OPAE.cc.

185 {
186  return (number) c;
187 }
number nAESetMap ( number  a,
const coeffs  r 
)
nMapFunc nAESetMap ( const coeffs  src,
const coeffs  dst 
)

Definition at line 305 of file OPAE.cc.

306 {
307  if (src==dst) return ndCopyMap; // UNDEFINED: nAECopyMap; // BUG :(
308  else return NULL;
309 }
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:239
#define NULL
Definition: omList.c:10
int nAESize ( number  a,
const coeffs  r 
)

Definition at line 152 of file OPAE.cc.

153 {
154  int_poly* f=reinterpret_cast<int_poly*> (a);
155  return f->deg;
156 }
const poly a
Definition: syzextra.cc:212
int deg
Definition: AE.h:15
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
number nAESub ( number  a,
number  b,
const coeffs  r 
)

Definition at line 94 of file OPAE.cc.

95 {
96  int_poly* f=reinterpret_cast<int_poly*> (a);
97  int_poly* g=reinterpret_cast<int_poly*> (b);
98  int_poly *res=new int_poly;
99  res->poly_set(*f);
100  res->poly_sub_to(*g);
101  return (number) res;
102 }
const poly a
Definition: syzextra.cc:212
void poly_sub_to(const int_poly)
Definition: AE.cc:198
g
Definition: cfModGcd.cc:4031
poly res
Definition: myNF.cc:322
Definition: AE.h:9
void poly_set(const int_poly)
Definition: AE.cc:796
FILE * f
Definition: checklibs.c:7
const poly b
Definition: syzextra.cc:213
void nAEWriteLong ( number  a,
const coeffs  r 
)

Definition at line 194 of file OPAE.cc.

195 {
196  int_poly* f=reinterpret_cast <int_poly*>(a);
197  f->poly_print();
198  return ;
199 }
const poly a
Definition: syzextra.cc:212
return
Definition: syzextra.cc:280
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
void poly_print()
Definition: AE.cc:1263
void nAEWriteShort ( number  a,
const coeffs  r 
)

Definition at line 201 of file OPAE.cc.

202 {
203  int_poly* f=reinterpret_cast <int_poly*>(a);
204  f->poly_print();
205  return ;
206 }
const poly a
Definition: syzextra.cc:212
return
Definition: syzextra.cc:280
Definition: AE.h:9
FILE * f
Definition: checklibs.c:7
void poly_print()
Definition: AE.cc:1263