11 #include <factory/factory.h> 27 number nAEMult (number
a, number
b,
const coeffs r);
28 number nAESub (number
a, number
b,
const coeffs r);
29 number nAEAdd (number
a, number
b,
const coeffs r);
30 number nAEDiv (number
a, number
b,
const coeffs r);
31 number nAEIntMod (number
a, number
b,
const coeffs r);
32 number nAEExactDiv (number
a, number
b,
const coeffs r);
33 number nAEInit (
long i,
const coeffs r);
34 number nAEInitMPZ (mpz_t
m,
const coeffs r);
35 int nAESize (number
a,
const coeffs r);
36 long nAEInt (number &
a,
const coeffs r);
37 number nAEMPZ (number
a,
const coeffs r);
38 number nAENeg (number c,
const coeffs r);
39 number nAECopy (number
a, number
b,
const coeffs r);
40 number nAERePart (number
a, number
b,
const coeffs r);
41 number nAEImPart (number
a, number
b,
const coeffs r);
43 void nAEWriteLong (number
a,
const coeffs r);
44 void nAEWriteShort (number
a,
const coeffs r);
47 const char * nAERead (
const char *
s, number *
a,
const coeffs r);
48 number nAENormalize (number
a, number
b,
const coeffs r);
56 number nAEGetDenom (number &
a,
const coeffs r);
57 number nAEGetNumerator (number &
a,
const coeffs r);
58 number nAEGcd (number
a, number
b,
const coeffs r);
59 number nAELcm (number
a, number
b,
const coeffs r);
61 void nAEDelete (number *
a,
const coeffs r);
62 number nAESetMap (number
a,
const coeffs r);
63 void nAEInpMult (number &
a ,number
b,
const coeffs r);
74 number nAEAdd(number
a, number
b,
const coeffs)
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;
84 number nAEMult(number a, number b,
const coeffs)
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;
90 res->poly_mult_n_to(*g);
94 number nAESub(number a, number b,
const coeffs)
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;
100 res->poly_sub_to(*g);
105 number nAEDiv(number a, number b,
const coeffs)
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;
111 res->poly_div_to(*res,*f,*g);
116 number nAEIntMod(number a, number,
const coeffs)
121 number nAEExactDiv(number a, number b,
const coeffs)
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;
127 res->poly_div_to(*res,*f,*g);
133 number nAEInit(
long i,
const coeffs)
136 mpz_init_set_ui(m, i);
137 int_poly* res=
new int_poly;
139 number res1=
reinterpret_cast<number
>(
res);
143 number nAEInitMPZ(mpz_t m,
const coeffs)
145 int_poly* res=
new int_poly;
147 number res1=
reinterpret_cast<number
>(
res);
152 int nAESize (number a,
const coeffs)
154 int_poly* f=
reinterpret_cast<int_poly*
> (
a);
158 long nAEInt(number &,
const coeffs)
164 number nAEMPZ(number a,
const coeffs)
170 number nAENeg(number c,
const coeffs)
172 int_poly* f=
reinterpret_cast<int_poly*
> (c);
173 int_poly *res=
new int_poly;
179 number nAECopy(number c,
const coeffs)
184 number nAERePart(number c,
const coeffs)
189 number nAEImPart(number c,
const coeffs)
194 void nAEWriteLong (number a,
const coeffs)
196 int_poly* f=reinterpret_cast <int_poly*>(
a);
201 void nAEWriteShort (number a,
const coeffs)
203 int_poly* f=reinterpret_cast <int_poly*>(
a);
209 const char * nAERead (
const char *, number *,
const coeffs)
216 number nAENormalize (number a, number,
const coeffs)
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;}
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;}
239 int_poly* f=
reinterpret_cast<int_poly*
> (
a);
240 if (f->is_zero() == 1) {
return FALSE;}
246 int_poly* f=
reinterpret_cast<int_poly*
> (
a);
247 if (f->is_one() == 1) {
return FALSE;}
253 int_poly* f=
reinterpret_cast<int_poly*
> (
a);
254 if (f->is_one() == 1) {
return FALSE;}
260 if (nAEIsZero(a, r) ==
FALSE) {
return TRUE; }
261 else {
return FALSE; }
264 void nAEPower (number,
int, number *,
const coeffs)
269 number nAEGetDenom (number &,
const coeffs)
274 number nAEGetNumerator (number &a,
const coeffs)
279 number nAEGcd (number a, number b,
const coeffs)
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);
288 number nAELcm (number a, number b,
const coeffs)
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);
300 void nAEDelete (number *,
const coeffs)
311 void nAEInpMult (number &, number,
const coeffs)
331 static char * n_AECoeffName(
const coeffs r)
333 return (
char*)(
"AE");
336 static char * nAECoeffString(
const coeffs r)
354 r->cfIntMod= nAEIntMod;
355 r->cfExactDiv= nAEExactDiv;
359 r->cfCoeffName = n_AECoeffName;
367 r->cfInpNeg = nAENeg;
372 r->cfWriteLong = nAEWriteLong;
375 r->cfGreater = nAEGreater;
376 r->cfEqual = nAEEqual;
377 r->cfIsZero = nAEIsZero;
378 r->cfIsOne = nAEIsOne;
379 r->cfIsMOne = nAEIsOne;
380 r->cfGreaterZero = nAEGreaterZero;
381 r->cfPower = nAEPower;
382 r->cfGetDenom = nAEGetDenom;
383 r->cfGetNumerator = nAEGetNumerator;
386 r->cfDelete= nAEDelete;
387 r->cfCoeffString=nAECoeffString;
389 r->cfSetMap = nAESetMap;
391 r->cfInpMult=nAEInpMult;
392 r->cfCoeffWrite=nAECoeffWrite;
396 r->nNULL = (number) 0;
399 r->has_simple_Alloc=
TRUE;
400 r->has_simple_Inverse=
TRUE;
const CanonicalForm int s
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Coefficient rings, fields and other domains suitable for Singular polynomials.
The main handler for Singular numbers which are suitable for Singular polynomials.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst