27#define TRANSEXT_PRIVATES
42 if (
f.isZero())
return NULL;
57 if (
LIKELY(!
f.inCoeffDomain()))
70 number n=
cf->convFactoryNSingN(
f,
cf);
77 poly
term = p_Init(r);
103#define MIN_CONV_LEN 7
127 for (
int i = 1;
i <=n;
i++ )
129 if (
LIKELY( (e = p_GetExp(
p,
i, r)) != 0 ))
156 if (
LIKELY( (e = p_GetExp(
p, 1, r)) != 0 ))
167 if (!
f.isImm())
WerrorS(
"int overflow in det");
177 if (!rField_is_Zp_a(r))
182 for (
int i = 1;
i <= n;
i++ )
184 if ( (e = p_GetExp(
p,
i, r )) != 0 )
198 if (
f.isZero())
return NULL;
199 int n = rVar(r)+rPar(r)+1;
215 if ( !
f.inCoeffDomain() )
230 poly
term = p_Init(r);
233 for (
i = rVar(r);
i>0 ;
i-- )
238 for (
i = 1;
i <= var_start;
i++ )
240 p_AddExp(z,
i,
exp[
i],r->cf->extRing);
244 for (
i = par_start+1;
i <= var_start+rPar(r);
i++ )
246 p_AddExp(z,
i,
exp[
i-par_start],r->cf->extRing);
263 if ( rField_is_Zp_a(r) )
276 mpz_init_set( dummy, (
p_GetCoeff(
p,r->cf->extRing )->z) );
290 if ( (e = p_GetExp(
p, 1, r->cf->extRing )) != 0 )
313 if (n_IsZero(n,r->cf->extRing->cf))
315 n_Delete(&n,r->cf->extRing->cf);
319 poly t= p_Init (r->cf->extRing);
321 p_SetExp(t,1,
i.exp(),r->cf->extRing);
323 a=p_Add_q(a,t,r->cf->extRing);
328 if( r->cf->extRing !=
NULL )
329 if (r->cf->extRing->qideal->m[0]!=
NULL)
331 poly
l=r->cf->extRing->qideal->m[0];
332 if (p_GetExp(a,1,r->cf->extRing) >= p_GetExp(
l,1,r->cf->extRing))
351 WerrorS(
"conversion error: denominator!= 1");
364 for (
int i = n;
i > 0;
i-- )
366 if ( (e = p_GetExp(
p,
i,r )) != 0 )
382 if (!p_IsConstant(DEN ((fraction)
p_GetCoeff (
p,r)),r->cf->extRing))
391 if (
f.isZero())
return NULL;
404 if (
f.level() > offs )
409 exp[
l-offs] =
i.exp();
416 poly
term = p_Init(r);
418 for (
int i = rVar(r);
i>0;
i-- )
429convSingGFFactoryGF( poly
p )
432 int e, n = pVariables;
440 for (
int i = 1;
i <= n;
i++ )
455 int n = pVariables+1;
469 if ( !
f.inCoeffDomain() )
483 for (
int i = 1;
i <= pVariables;
i++ )
const CanonicalForm CFMap CFMap & N
CanonicalForm convSingPFactoryP(poly p, const ring r)
BOOLEAN convSingTrP(poly p, const ring r)
poly convFactoryPSingTrP(const CanonicalForm &f, const ring r)
poly convFactoryAPSingAP(const CanonicalForm &f, const ring r)
static CanonicalForm convSingPFactoryP_intern(poly p, int l, BOOLEAN &setChar, const ring r)
CanonicalForm convSingAFactoryA(poly p, const Variable &a, const ring r)
static void convPhalf(poly p, int l, poly &p1, poly &p2)
CanonicalForm convSingAPFactoryAP(poly p, const Variable &a, const ring r)
poly convFactoryASingA(const CanonicalForm &f, const ring r)
poly convFactoryPSingP(const CanonicalForm &f, const ring r)
static number convFactoryNSingAN(const CanonicalForm &f, const ring r)
int convFactoryISingI(const CanonicalForm &f)
static void convRecTrP(const CanonicalForm &f, int *exp, poly &result, int offs, const ring r)
static void conv_RecPP(const CanonicalForm &f, int *exp, sBucket_pt result, ring r)
void out_cf(const char *s1, const CanonicalForm &f, const char *s2)
CanonicalForm convSingTrPFactoryP(poly p, const ring r)
static void convRecAP_R(const CanonicalForm &f, int *exp, poly &result, int par_start, int var_start, const ring r)
static poly convPunhalf(poly p1, poly p2)
poly convFactoryAPSingAP_R(const CanonicalForm &f, int par_start, int var_start, const ring r)
class to iterate through CanonicalForm's
factory's class for variables
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_convFactoryNSingN(const CanonicalForm n, const coeffs r)
factory.h' is the user interface to Factory.
CanonicalForm FACTORY_PUBLIC make_cf(const mpz_ptr n)
CanonicalForm make_cf_from_gf(const int z)
int gf_value(const CanonicalForm &f)
void WerrorS(const char *s)
gmp_float exp(const gmp_float &a)
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omFreeSize(addr, size)
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...
#define pGetExp(p, i)
Exponent.
#define pInit()
allocates a new monomial and initializes everything to 0
sBucket_pt sBucketCreate(const ring r)
void sBucket_Merge_m(sBucket_pt bucket, poly p)
void sBucketDestroyMerge(sBucket_pt bucket, poly *p, int *length)
number ntInit(long i, const coeffs cf)