Go to the source code of this file.
|
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) |
|
◆ MIN_CONV_LEN
◆ TRANSEXT_PRIVATES
#define TRANSEXT_PRIVATES |
◆ conv_RecPP()
Definition at line 54 of file clapconv.cc.
55{
56
57 if (
LIKELY(!
f.inCoeffDomain()))
58 {
61 {
64 }
66 }
67 else
68 {
70 number n=
cf->convFactoryNSingN(
f,
cf);
72 {
74 }
75 else
76 {
78
82 }
83 }
84}
static void conv_RecPP(const CanonicalForm &f, int *exp, sBucket_pt result, ring r)
class to iterate through CanonicalForm's
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
gmp_float exp(const gmp_float &a)
The main handler for Singular numbers which are suitable for Singular polynomials.
static void p_SetExpV(poly p, int *ev, const ring r)
static poly p_Init(const ring r, omBin bin)
void sBucket_Merge_m(sBucket_pt bucket, poly p)
◆ convFactoryAPSingAP()
Definition at line 207 of file clapconv.cc.
208{
210}
poly convFactoryAPSingAP_R(const CanonicalForm &f, int par_start, int var_start, const ring r)
static int rPar(const ring r)
(r->cf->P)
◆ convFactoryAPSingAP_R()
Definition at line 196 of file clapconv.cc.
197{
198 if (
f.isZero())
return NULL;
205}
static void convRecAP_R(const CanonicalForm &f, int *exp, poly &result, int par_start, int var_start, const ring r)
#define omFreeSize(addr, size)
static short rVar(const ring r)
#define rVar(r) (r->N)
◆ convFactoryASingA()
Definition at line 307 of file clapconv.cc.
308{
311 {
314 {
316 }
317 else
318 {
319 poly t=
p_Init (r->cf->extRing);
322
324 }
325 }
327 {
328 if( r->cf->extRing !=
NULL )
329 if (r->cf->extRing->qideal->m[0]!=
NULL)
330 {
331 poly
l=r->cf->extRing->qideal->m[0];
334 }
335 }
336 return a;
337}
static number convFactoryNSingAN(const CanonicalForm &f, const ring r)
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...
static poly p_Add_q(poly p, poly q, const ring r)
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
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
◆ convFactoryISingI()
Definition at line 165 of file clapconv.cc.
166{
167 if (!
f.isImm())
WerrorS(
"int overflow in det");
169}
void WerrorS(const char *s)
◆ convFactoryNSingAN()
Definition at line 298 of file clapconv.cc.
299{
303
305}
static FORCE_INLINE number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
◆ convFactoryPSingP()
Definition at line 40 of file clapconv.cc.
41{
42 if (
f.isZero())
return NULL;
44
52}
sBucket_pt sBucketCreate(const ring r)
void sBucketDestroyMerge(sBucket_pt bucket, poly *p, int *length)
◆ convFactoryPSingTrP()
Definition at line 389 of file clapconv.cc.
390{
391 if (
f.isZero())
return NULL;
398}
static void convRecTrP(const CanonicalForm &f, int *exp, poly &result, int offs, const ring r)
◆ convPhalf()
static void convPhalf |
( |
poly | p, |
|
|
int | l, |
|
|
poly & | p1, |
|
|
poly & | p2 ) |
|
inlinestatic |
◆ convPunhalf()
static poly convPunhalf |
( |
poly | p1, |
|
|
poly | p2 ) |
|
inlinestatic |
◆ 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 212 of file clapconv.cc.
213{
214
215 if ( !
f.inCoeffDomain() )
216 {
219 {
222 }
224 }
225 else
226 {
229 {
231
235
236 if (par_start==0)
237 {
238 for (
i = 1;
i <= var_start;
i++ )
239
241 }
242 else
243 {
244 for (
i = par_start+1;
i <= var_start+
rPar(r);
i++ )
245
247 }
251 }
252 }
253}
poly convFactoryASingA(const CanonicalForm &f, const ring r)
static long p_AddExp(poly p, int v, long ee, ring r)
static void p_Setm(poly p, const ring r)
◆ convRecTrP()
Definition at line 401 of file clapconv.cc.
402{
403
404 if (
f.level() > offs )
405 {
408 {
409 exp[
l-offs] =
i.exp();
411 }
413 }
414 else
415 {
417
418 for (
int i =
rVar(r);
i>0;
i-- )
420
424 }
425}
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
number ntInit(long i, const coeffs cf)
◆ convSingAFactoryA()
Definition at line 255 of file clapconv.cc.
256{
258 int e;
259
261 {
264 {
266 }
267 else
268 {
271 else
272 {
274 {
275 mpz_t dummy;
276 mpz_init_set( dummy, (
p_GetCoeff(
p,r->cf->extRing )->z) );
278 }
279 else
280 {
281
287 }
288 }
289 }
290 if ( (e =
p_GetExp(
p, 1, r->cf->extRing )) != 0 )
294 }
296}
static const int SW_RATIONAL
set to 1 for computations over Q
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 ....
CanonicalForm FACTORY_PUBLIC make_cf(const mpz_ptr n)
static BOOLEAN rField_is_Zp_a(const ring r)
◆ convSingAPFactoryAP()
Definition at line 171 of file clapconv.cc.
172{
176
180 {
182 for (
int i = 1;
i <= n;
i++ )
183 {
186 }
189 }
191}
const CanonicalForm CFMap CFMap & N
CanonicalForm convSingAFactoryA(poly p, const Variable &a, const ring r)
factory's class for variables
◆ convSingPFactoryP()
Definition at line 138 of file clapconv.cc.
139{
141 {
144 }
145 else
146 {
150 int e;
152 {
160 }
162 }
163}
static CanonicalForm convSingPFactoryP_intern(poly p, int l, BOOLEAN &setChar, const ring r)
static int pLength(poly a)
◆ convSingPFactoryP_intern()
Definition at line 104 of file clapconv.cc.
105{
109
111 {
112 poly p1,p2;
117 return P;
118 }
123 {
127 for (
int i = 1;
i <=n;
i++ )
128 {
131 }
134 }
136}
static void convPhalf(poly p, int l, poly &p1, poly &p2)
static poly convPunhalf(poly p1, poly p2)
◆ convSingTrP()
Definition at line 375 of file clapconv.cc.
376{
378 {
380
381
385 }
387}
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
static BOOLEAN p_IsConstant(const poly p, const ring r)
◆ convSingTrPFactoryP()
Definition at line 339 of file clapconv.cc.
340{
344
346 {
347
348
349
351 WerrorS(
"conversion error: denominator!= 1");
352
354
355
357 {
362 }
363
364 for (
int i = n;
i > 0;
i-- )
365 {
368 }
371 }
373}
CanonicalForm convSingPFactoryP(poly p, const ring r)
◆ out_cf()
Definition at line 103 of file cf_factor.cc.
104{
105 printf("%s",s1);
106 if (
f.isZero()) printf(
"+0");
107
108 else if (!
f.inBaseDomain() )
109 {
112 {
114 if (
i.coeff().isOne())
115 {
116 printf("+");
117 if (e==0) printf("1");
118 else
119 {
120 printf(
"%c",
'a'+
l-1);
121 if (e!=1) printf("^%d",e);
122 }
123 }
124 else
125 {
127 if (e!=0)
128 {
129 printf(
"*%c",
'a'+
l-1);
130 if (e!=1) printf("^%d",e);
131 }
132 }
133 }
134 }
135 else
136 {
138 {
140 {
143 printf ("+%ld", a);
144 else if ( a == 0L )
145 printf ("+1");
146 else if ( a == 1L )
148 else
149 {
151 printf ("^%ld",a);
152 }
153 }
154 else
155 {
157 if (
l<0) printf(
"%ld",
l);
158 else printf(
"+%ld",
l);
159 }
160 }
161 else
162 {
163 #ifdef NOSTREAMIO
165 {
168 char *
str =
new char[mpz_sizeinbase(
m, 10 ) + 2];
169 str = mpz_get_str( str, 10,
m );
170 puts(str);
173 }
175 {
178 char *
str =
new char[mpz_sizeinbase(
m, 10 ) + 2];
179 str = mpz_get_str( str, 10,
m );
180 while(str[strlen(str)]<
' ') {
str[strlen(str)]=
'\0'; }
181 puts(str);putchar('/');
185 str =
new char[mpz_sizeinbase(
m, 10 ) + 2];
186 str = mpz_get_str( str, 10,
m );
187 while(str[strlen(str)]<
' ') {
str[strlen(str)]=
'\0'; }
188 puts(str);
191 }
192 #else
194 #endif
195 }
196
197
198
199
200
201
202 if (
f.inExtension()) printf(
"E(%d)",
f.level());
203 }
204 printf("%s",s2);
205}
#define GaloisFieldDomain
void out_cf(const char *s1, const CanonicalForm &f, const char *s2)
cf_algorithm.cc - simple mathematical algorithms.
void FACTORY_PUBLIC gmp_numerator(const CanonicalForm &f, mpz_ptr result)
void FACTORY_PUBLIC gmp_denominator(const CanonicalForm &f, mpz_ptr result)
static long imm2int(const InternalCF *const imm)