Loading...
Searching...
No Matches
transext.h File Reference
`#include "coeffs/coeffs.h"`
`#include "polys/monomials/ring.h"`

Go to the source code of this file.

## Data Structures

struct | TransExtInfo
| struct for passing initialization parameters to naInitChar More...

## Functions

nMapFunc | ntSetMap (const coeffs src, const coeffs dst)
| Get a mapping function from src into the domain of this type (n_transExt).
BOOLEAN | ntInitChar (coeffs cf, void *infoStruct)
| Initialize the coeffs object.
number | ntDiff (number a, number d, const coeffs cf)
int | ntIsParam (number, const coeffs)
| if m == var(i)/1 => return i,
poly | gcd_over_Q (poly f, poly g, const ring r)
| helper routine for calling singclap_gcd_r

## Data Structure Documentation

## TransExtInfo

struct TransExtInfo

struct for passing initialization parameters to naInitChar

Definition at line 88 of file transext.h.

Data Fields
ring | r |

## Function Documentation

## gcd_over_Q()

poly gcd_over_Q | ( | poly | f,
|  | poly | g,
|  | const ring | r )

helper routine for calling singclap_gcd_r

Definition at line 275 of file transext.cc.

{
poly res;
f=p_Copy(f,r);
p_Cleardenom(f, r);
g=p_Copy(g,r);
p_Cleardenom(g, r);
res=singclap_gcd_r(f,g,r);
p_Delete(&f, r);
p_Delete(&g, r);
return res;
}
g
g
Definition cfModGcd.cc:4098
f
FILE * f
Definition checklibs.c:9
singclap_gcd_r
poly singclap_gcd_r(poly f, poly g, const ring r)
Definition clapsing.cc:70
res
CanonicalForm res
Definition facAbsFact.cc:60
p_Cleardenom
poly p_Cleardenom(poly p, const ring r)
Definition p_polys.cc:2893
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848

## ntDiff()

number ntDiff | ( | number | a,
|  | number | d,
|  | const coeffs | cf )

Definition at line 897 of file transext.cc.

{
//check_N(a,cf);
//check_N(d,cf);
ntTest(a);
ntTest(d);
if (IS0(d))
{
WerrorS("ringvar expected");
return NULL;
}
fraction t = (fraction) d;
if (!DENIS1(t))
{
WerrorS("expected differentiation by a variable");
return NULL;
}
int k=p_Var(NUM(t),ntRing);
if (k==0)
{
WerrorS("expected differentiation by a variable");
return NULL;
}
if (IS0(a)) return ntCopy(a, cf);
fraction fa = (fraction)a;
fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
if (DENIS1(fa))
{
NUM(result) = p_Diff(NUM(fa),k,ntRing);
//DEN(result) = NULL; // done by ..Alloc0..
if (NUM(result)==NULL)
{
omFreeBin((ADDRESS)result, fractionObjectBin);
return(NULL);
}
COM(result) = COM(fa)+DIFF_COMPLEXITY;
//check_N((number)result,cf);
ntTest((number)result);
return (number)result;
}
poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing);
poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing);
NUM(result) = p_Sub(fg,gf,ntRing);
if (NUM(result)==NULL) return(NULL);
DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing);
COM(result) = COM(fa) + COM(fa) + DIFF_COMPLEXITY;
heuristicGcdCancellation((number)result, cf);
//check_N((number)result,cf);
ntTest((number)result);
return (number)result;
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
k
int k
Definition cfEzgcd.cc:99
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
fa
static BOOLEAN fa(leftv res, leftv args)
Definition cohomo.cc:3814
result
return result
Definition facAbsBiFact.cc:76
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition omAllocDecl.h:206
omFreeBin
#define omFreeBin(addr, bin)
Definition omAllocDecl.h:259
NULL
#define NULL
Definition omList.c:12
p_Diff
poly p_Diff(poly a, int k, const ring r)
Definition p_polys.cc:1902
p_Var
int p_Var(poly m, const ring r)
Definition p_polys.cc:4810
p_Sub
poly p_Sub(poly p1, poly p2, const ring r)
Definition p_polys.cc:1994
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition p_polys.h:1125
pp_Mult_qq
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition p_polys.h:1167
NUM
#define NUM
Definition readcf.cc:180
heuristicGcdCancellation
static void heuristicGcdCancellation(number a, const coeffs cf)
forward declarations
Definition transext.cc:1398
ntRing
#define ntRing
Definition transext.cc:80
COM
#define COM(f)
Definition transext.cc:69
ntCopy
static number ntCopy(number a, const coeffs cf)
Definition transext.cc:372
ntTest
#define ntTest(a)
Definition transext.cc:76
fractionObjectBin
VAR omBin fractionObjectBin
Definition transext.cc:89
DIFF_COMPLEXITY
#define DIFF_COMPLEXITY
complexity increase due to diff
Definition transext.cc:63

## ntInitChar()

BOOLEAN ntInitChar | ( | coeffs | cf,
|  | void * | infoStruct )

Initialize the coeffs object.

Definition at line 2636 of file transext.cc.

{
assume( infoStruct != NULL );
TransExtInfo *e = (TransExtInfo *)infoStruct;
assume( e->r != NULL); // extRing;
assume( e->r->cf != NULL); // extRing->cf;
assume( e->r->qideal == NULL );
assume( cf != NULL );
assume(getCoeffType(cf) == n_transExt); // coeff type;
ring R = e->r;
assume(R != NULL);
rIncRefCnt(R); // increase the ref.counter for the ground poly. ring!
cf->extRing = R;
/* propagate characteristic up so that it becomes
directly accessible in cf: */
cf->ch = R->cf->ch;
cf->is_field=TRUE;
cf->is_domain=TRUE;
cf->rep=n_rep_rat_fct;
cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
cf->cfCoeffName = naCoeffName; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
cf->cfGreaterZero = ntGreaterZero;
cf->cfGreater = ntGreater;
cf->cfEqual = ntEqual;
cf->cfIsZero = ntIsZero;
cf->cfIsOne = ntIsOne;
cf->cfIsMOne = ntIsMOne;
cf->cfInit = ntInit;
cf->cfFarey = ntFarey;
cf->cfChineseRemainder = ntChineseRemainder;
cf->cfInt = ntInt;
cf->cfAdd = ntAdd;
cf->cfInpAdd = ntInpAdd;
cf->cfInpNeg = ntNeg;
cf->cfSub = ntSub;
cf->cfMult = ntMult;
cf->cfInpMult = ntInpMult;
cf->cfDiv = ntDiv;
cf->cfExactDiv = ntExactDiv;
cf->cfPower = ntPower;
cf->cfCopy = ntCopy;
cf->cfWriteLong = ntWriteLong;
cf->cfRead = ntRead;
cf->cfNormalize = ntNormalize;
cf->cfDelete = ntDelete;
cf->cfSetMap = ntSetMap;
cf->cfGetDenom = ntGetDenom;
cf->cfGetNumerator = ntGetNumerator;
//cf->cfRePart = ntCopy;
//cf->cfImPart = ntImPart;
cf->cfCoeffWrite = ntCoeffWrite;
#ifdef LDEBUG
cf->cfDBTest = ntDBTest;
#endif
//cf->cfGcd = ntGcd_dummy;
cf->cfSubringGcd = ntGcd;
cf->cfNormalizeHelper = ntNormalizeHelper;
cf->cfSize = ntSize;
cf->nCoeffIsEqual = ntCoeffIsEqual;
cf->cfInvers = ntInvers;
cf->cfKillChar = ntKillChar;
cf->cfInitMPZ = ntInitMPZ;
cf->cfMPZ = ntMPZ;
if( rCanShortOut(ntRing) )
cf->cfWriteShort = ntWriteShort;
else
cf->cfWriteShort = ntWriteLong;
cf->convFactoryNSingN =ntConvFactoryNSingN;
cf->convSingNFactoryN =ntConvSingNFactoryN;
cf->cfParDeg = ntParDeg;
cf->iNumberOfParameters = rVar(R);
cf->pParameterNames = (const char**)R->names;
cf->cfParameter = ntParameter;
cf->has_simple_Inverse= FALSE;
/* cf->has_simple_Alloc= FALSE; */
if( nCoeff_is_Q(R->cf) )
cf->cfClearContent = ntClearContent;
cf->cfClearDenominators = ntClearDenominators;
return FALSE;
}
naCoeffName
char * naCoeffName(const coeffs r)
Definition algext.cc:1390
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
n_transExt
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition coeffs.h:38
nCoeff_is_Q
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition coeffs.h:801
getCoeffType
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition coeffs.h:431
n_rep_rat_fct
@ n_rep_rat_fct
(fraction), see transext.h
Definition coeffs.h:121
assume
#define assume(x)
Definition mod2.h:389
rIncRefCnt
static ring rIncRefCnt(ring r)
Definition ring.h:849
rCanShortOut
static BOOLEAN rCanShortOut(const ring r)
Definition ring.h:592
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598
R
#define R
Definition sirandom.c:27
ntSize
static int ntSize(number a, const coeffs cf)
Definition transext.cc:1903
ntDBTest
static BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition transext.cc:140
ntParameter
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
Definition transext.cc:2286
ntWriteLong
static void ntWriteLong(number a, const coeffs cf)
Definition transext.cc:1641
ntCoeffIsEqual
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition transext.cc:1727
ntRead
static const char * ntRead(const char *s, number *a, const coeffs cf)
Definition transext.cc:1691
ntSetMap
nMapFunc ntSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type (n_transExt).
Definition transext.cc:2170
ntSub
static number ntSub(number a, number b, const coeffs cf)
Definition transext.cc:1034
ntInt
static long ntInt(number &a, const coeffs cf)
Definition transext.cc:773
ntDelete
static void ntDelete(number *a, const coeffs cf)
Definition transext.cc:313
ntIsOne
static BOOLEAN ntIsOne(number a, const coeffs cf)
Definition transext.cc:669
ntIsZero
static BOOLEAN ntIsZero(number a, const coeffs cf)
Definition transext.cc:306
ntGetNumerator
static number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition transext.cc:506
ntConvSingNFactoryN
static CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition transext.cc:2268
ntClearDenominators
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition transext.cc:2427
ntIsMOne
static BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition transext.cc:678
ntMPZ
static void ntMPZ(mpz_t m, number &n, const coeffs r)
Definition transext.cc:2619
ntCoeffWrite
static void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition transext.cc:856
ntGcd
static number ntGcd(number a, number b, const coeffs cf)
Definition transext.cc:1830
ntConvFactoryNSingN
static number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition transext.cc:2256
ntClearContent
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition transext.cc:2334
ntInvers
static number ntInvers(number a, const coeffs cf)
Definition transext.cc:1270
ntNormalizeHelper
static number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition transext.cc:1749
ntPower
static void ntPower(number a, int exp, number *b, const coeffs cf)
Definition transext.cc:1336
ntInit
number ntInit(long i, const coeffs cf)
Definition transext.cc:704
ntGetDenom
static number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition transext.cc:567
ntInpMult
static void ntInpMult(number &a, number b, const coeffs cf)
Definition transext.cc:1141
ntKillChar
static void ntKillChar(coeffs cf)
Definition transext.cc:2250
ntInpAdd
static void ntInpAdd(number &a, number b, const coeffs cf)
Definition transext.cc:995
ntWriteShort
static void ntWriteShort(number a, const coeffs cf)
Definition transext.cc:1666
ntDiv
static number ntDiv(number a, number b, const coeffs cf)
Definition transext.cc:1224
ntParDeg
static int ntParDeg(number a, const coeffs cf)
Definition transext.cc:2277
ntGreaterZero
static BOOLEAN ntGreaterZero(number a, const coeffs cf)
Definition transext.cc:796
ntChineseRemainder
static number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition transext.cc:2571
ntMult
static number ntMult(number a, number b, const coeffs cf)
Definition transext.cc:1073
ntNeg
static number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition transext.cc:691
ntAdd
static number ntAdd(number a, number b, const coeffs cf)
Definition transext.cc:954
ntFarey
static number ntFarey(number p, number n, const coeffs cf)
Definition transext.cc:2601
ntNormalize
static void ntNormalize(number &a, const coeffs cf)
Definition transext.cc:1701
ntEqual
static BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition transext.cc:326
ntGreater
static BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition transext.cc:806
ntExactDiv
static number ntExactDiv(number a, number b, const coeffs cf)
Definition transext.cc:1719
ntInitMPZ
static number ntInitMPZ(mpz_t m, const coeffs r)
Definition transext.cc:2611
TransExtInfo::r
ring r
Definition transext.h:88
TransExtInfo
struct for passing initialization parameters to naInitChar
Definition transext.h:88

## ntIsParam()

int ntIsParam | ( | number | m,
|  | const coeffs | cf )

if m == var(i)/1 => return i,

Definition at line 2308 of file transext.cc.

{
ntTest(m);
assume(getCoeffType(cf) == n_transExt);
const ring R = cf->extRing;
assume( R != NULL );
fraction f = (fraction)m;
if( DEN(f) != NULL )
return 0;
return p_Var( NUM(f), R );
}
m
int m
Definition cfEzgcd.cc:128

## ntSetMap()

nMapFunc ntSetMap | ( | const coeffs | src,
|  | const coeffs | dst )

Get a mapping function from src into the domain of this type (n_transExt).

Q or Z --> Q(T)

Z --> K(T)

Z/p --> Q(T)

Q --> Z/p(T)

Z/p --> Z/p(T)

Z/u --> Z/p(T)

Z/p --> Z/p(T)

K(T') --> K(T)

K(T') --> K'(T)

K(T') --> K(T)

K(T') --> K'(T)

default

Definition at line 2170 of file transext.cc.

{
/* dst is expected to be a rational function field */
assume(getCoeffType(dst) == n_transExt);
int h = 0; /* the height of the extension tower given by dst */
coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
/* for the time being, we only provide maps if h = 1 and if b is Q or
some field Z/pZ: */
if (h==0)
{
if (((src->rep==n_rep_gap_rat) || (src->rep==n_rep_gap_gmp))
&& (nCoeff_is_Q(dst->extRing->cf) || nCoeff_is_Z(dst->extRing->cf)))
return ntMap00; /// Q or Z --> Q(T)
if (src->rep==n_rep_gmp)
return ntMapZ0; /// Z --> K(T)
if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
return ntMapP0; /// Z/p --> Q(T)
if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
return ntMap0P; /// Q --> Z/p(T)
if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
{
if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
else return ntMapUP; /// Z/u --> Z/p(T)
}
if (nCoeff_is_Zn(src) && nCoeff_is_Zn(bDst))
{
if (mpz_cmp(src->modNumber,bDst->modNumber)==0) return ntMapPP; /// Z/p --> Z/p(T)
}
}
if (h != 1) return NULL;
//if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
/* Let T denote the sequence of transcendental extension variables, i.e.,
K[t_1, ..., t_s] =: K[T];
Let moreover, for any such sequence T, T' denote any subsequence of T
of the form t_1, ..., t_w with w <= s. */
if (rVar(src->extRing) > rVar(dst->extRing))
return NULL;
for (int i = 0; i < rVar(src->extRing); i++)
if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
return NULL;
if (src->type==n_transExt)
{
if (src->extRing->cf==dst->extRing->cf)
return ntCopyMap; /// K(T') --> K(T)
else
return ntGenMap; /// K(T') --> K'(T)
}
else
{
if (src->extRing->cf==dst->extRing->cf)
return ntCopyAlg; /// K(T') --> K(T)
else
return ntGenAlg; /// K(T') --> K'(T)
}
return NULL; /// default
}
i
int i
Definition cfEzgcd.cc:132
nCoeff_is_Z
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
Definition coeffs.h:811
nCoeff_is_Q_or_BI
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
Definition coeffs.h:824
nCoeff_is_Zn
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
Definition coeffs.h:821
nCoeff_is_Zp
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition coeffs.h:795
n_rep_gap_rat
@ n_rep_gap_rat
(number), see longrat.h
Definition coeffs.h:118
n_rep_gap_gmp
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
Definition coeffs.h:119
n_rep_gmp
@ n_rep_gmp
(mpz_ptr), see rmodulon,h
Definition coeffs.h:122
h
STATIC_VAR Poly * h
Definition janet.cc:971
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
rRingVar
static char * rRingVar(short i, const ring r)
Definition ring.h:583
ntCopyAlg
static number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition transext.cc:2092
ntMapPP
static number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition transext.cc:2133
ntMapZ0
static number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition transext.cc:1954
ntMap0P
static number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition transext.cc:2109
ntMapP0
static number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition transext.cc:1968
ntMapUP
static number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition transext.cc:2148
ntGenMap
static number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition transext.cc:2013
ntMap00
static number ntMap00(number a, const coeffs src, const coeffs dst)
Definition transext.cc:1930
ntGenAlg
static number ntGenAlg(number a, const coeffs cf, const coeffs dst)
Definition transext.cc:2099
ntCopyMap
static number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition transext.cc:1984
nCoeff_bottom
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition transext.cc:292