My Project  debian-1:4.1.2-p1+ds-2
Data Structures | Functions
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) More...
 
BOOLEAN ntInitChar (coeffs cf, void *infoStruct)
 Initialize the coeffs object. More...
 
number ntDiff (number a, number d, const coeffs cf)
 
int ntIsParam (number, const coeffs)
 if m == var(i)/1 => return i, More...
 
poly gcd_over_Q (poly f, poly g, const ring r)
 helper routine for calling singclap_gcd_r More...
 

Data Structure Documentation

◆ TransExtInfo

struct TransExtInfo

struct for passing initialization parameters to naInitChar

Definition at line 87 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 274 of file transext.cc.

276 {
277  poly res;
278  f=p_Copy(f,r);
279  p_Cleardenom(f, r);
280  g=p_Copy(g,r);
281  p_Cleardenom(g, r);
282  res=singclap_gcd_r(f,g,r);
283  p_Delete(&f, r);
284  p_Delete(&g, r);
285  return res;

◆ ntDiff()

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

Definition at line 896 of file transext.cc.

898 {
899  //check_N(a,cf);
900  //check_N(d,cf);
901  ntTest(a);
902  ntTest(d);
903 
904  if (IS0(d))
905  {
906  WerrorS("ringvar expected");
907  return NULL;
908  }
909  fraction t = (fraction) d;
910  if (!DENIS1(t))
911  {
912  WerrorS("expected differentiation by a variable");
913  return NULL;
914  }
915  int k=p_Var(NUM(t),ntRing);
916  if (k==0)
917  {
918  WerrorS("expected differentiation by a variable");
919  return NULL;
920  }
921 
922  if (IS0(a)) return ntCopy(a, cf);
923 
924  fraction fa = (fraction)a;
925  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
926  if (DENIS1(fa))
927  {
928  NUM(result) = p_Diff(NUM(fa),k,ntRing);
929  //DEN(result) = NULL; // done by ..Alloc0..
930  if (NUM(result)==NULL)
931  {
933  return(NULL);
934  }
936  //check_N((number)result,cf);
937  ntTest((number)result);
938  return (number)result;
939  }
940 
941  poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing);
942  poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing);
943  NUM(result) = p_Sub(fg,gf,ntRing);
944  if (NUM(result)==NULL) return(NULL);
945  DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing);
946  COM(result) = COM(fa) + COM(fa) + DIFF_COMPLEXITY;
948 
949  //check_N((number)result,cf);
950  ntTest((number)result);
951  return (number)result;

◆ ntInitChar()

BOOLEAN ntInitChar ( coeffs  cf,
void *  infoStruct 
)

Initialize the coeffs object.

Definition at line 2511 of file transext.cc.

2513 {
2514 
2515  assume( infoStruct != NULL );
2516 
2517  TransExtInfo *e = (TransExtInfo *)infoStruct;
2518 
2519  assume( e->r != NULL); // extRing;
2520  assume( e->r->cf != NULL); // extRing->cf;
2521  assume( e->r->qideal == NULL );
2522 
2523  assume( cf != NULL );
2524  assume(getCoeffType(cf) == n_transExt); // coeff type;
2525 
2526  ring R = e->r;
2527  assume(R != NULL);
2528 
2529  R->ref ++; // increase the ref.counter for the ground poly. ring!
2530 
2531  cf->extRing = R;
2532  /* propagate characteristic up so that it becomes
2533  directly accessible in cf: */
2534  cf->ch = R->cf->ch;
2535 
2536  cf->is_field=TRUE;
2537  cf->is_domain=TRUE;
2538  cf->rep=n_rep_rat_fct;
2539 
2540  cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
2541 
2542  cf->cfCoeffString = naCoeffString; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2543  cf->cfCoeffName = naCoeffName; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2544 
2545  cf->cfGreaterZero = ntGreaterZero;
2546  cf->cfGreater = ntGreater;
2547  cf->cfEqual = ntEqual;
2548  cf->cfIsZero = ntIsZero;
2549  cf->cfIsOne = ntIsOne;
2550  cf->cfIsMOne = ntIsMOne;
2551  cf->cfInit = ntInit;
2552  cf->cfFarey = ntFarey;
2553  cf->cfChineseRemainder = ntChineseRemainder;
2554  cf->cfInt = ntInt;
2555  cf->cfAdd = ntAdd;
2556  cf->cfInpNeg = ntNeg;
2557  cf->cfSub = ntSub;
2558  cf->cfMult = ntMult;
2559  cf->cfDiv = ntDiv;
2560  cf->cfExactDiv = ntDiv;
2561  cf->cfPower = ntPower;
2562  cf->cfCopy = ntCopy;
2563  cf->cfWriteLong = ntWriteLong;
2564  cf->cfRead = ntRead;
2565  cf->cfNormalize = ntNormalize;
2566  cf->cfDelete = ntDelete;
2567  cf->cfSetMap = ntSetMap;
2568  cf->cfGetDenom = ntGetDenom;
2569  cf->cfGetNumerator = ntGetNumerator;
2570  //cf->cfRePart = ntCopy;
2571  //cf->cfImPart = ntImPart;
2572  cf->cfCoeffWrite = ntCoeffWrite;
2573 #ifdef LDEBUG
2574  cf->cfDBTest = ntDBTest;
2575 #endif
2576  //cf->cfGcd = ntGcd_dummy;
2577  cf->cfSubringGcd = ntGcd;
2578  cf->cfNormalizeHelper = ntNormalizeHelper;
2579  cf->cfSize = ntSize;
2580  cf->nCoeffIsEqual = ntCoeffIsEqual;
2581  cf->cfInvers = ntInvers;
2582  cf->cfKillChar = ntKillChar;
2583 
2584  if( rCanShortOut(ntRing) )
2585  cf->cfWriteShort = ntWriteShort;
2586  else
2587  cf->cfWriteShort = ntWriteLong;
2588 
2589  cf->convFactoryNSingN =ntConvFactoryNSingN;
2590  cf->convSingNFactoryN =ntConvSingNFactoryN;
2591  cf->cfParDeg = ntParDeg;
2592 
2593  cf->iNumberOfParameters = rVar(R);
2594  cf->pParameterNames = (const char**)R->names;
2595  cf->cfParameter = ntParameter;
2596  cf->has_simple_Inverse= FALSE;
2597  /* cf->has_simple_Alloc= FALSE; */
2598 
2599 
2600  if( nCoeff_is_Q(R->cf) )
2601  cf->cfClearContent = ntClearContent;
2602 
2603  cf->cfClearDenominators = ntClearDenominators;
2604 
2605  return FALSE;

◆ ntIsParam()

int ntIsParam ( number  ,
const  coeffs 
)

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

Definition at line 2208 of file transext.cc.

2210 {
2211  ntTest(m);
2213 
2214  const ring R = cf->extRing;
2215  assume( R != NULL );
2216 
2217  fraction f = (fraction)m;
2218 
2219  if( DEN(f) != NULL )
2220  return 0;
2221 
2222  return p_Var( NUM(f), R );

◆ 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 2070 of file transext.cc.

2072 {
2073  /* dst is expected to be a rational function field */
2074  assume(getCoeffType(dst) == n_transExt);
2075 
2076  if( src == dst ) return ndCopyMap;
2077 
2078  int h = 0; /* the height of the extension tower given by dst */
2079  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
2080  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
2081 
2082  /* for the time being, we only provide maps if h = 1 and if b is Q or
2083  some field Z/pZ: */
2084  if (h==0)
2085  {
2086  if ((src->rep==n_rep_gap_rat) && nCoeff_is_Q(bDst))
2087  return ntMap00; /// Q or Z --> Q(T)
2088  if (src->rep==n_rep_gap_gmp)
2089  return ntMapZ0; /// Z --> K(T)
2090  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
2091  return ntMapP0; /// Z/p --> Q(T)
2092  if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
2093  return ntMap0P; /// Q --> Z/p(T)
2094  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2095  {
2096  if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
2097  else return ntMapUP; /// Z/u --> Z/p(T)
2098  }
2099  if (nCoeff_is_Zn(src) && nCoeff_is_Zn(bDst))
2100  {
2101  if (mpz_cmp(src->modNumber,bDst->modNumber)==0) return ntMapPP; /// Z/p --> Z/p(T)
2102  }
2103  }
2104  if (h != 1) return NULL;
2105  //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
2106 
2107  /* Let T denote the sequence of transcendental extension variables, i.e.,
2108  K[t_1, ..., t_s] =: K[T];
2109  Let moreover, for any such sequence T, T' denote any subsequence of T
2110  of the form t_1, ..., t_w with w <= s. */
2111 
2112  if (rVar(src->extRing) > rVar(dst->extRing))
2113  return NULL;
2114 
2115  for (int i = 0; i < rVar(src->extRing); i++)
2116  if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
2117  return NULL;
2118 
2119  if (src->type==n_transExt)
2120  {
2121  if (src->extRing->cf==dst->extRing->cf)
2122  return ntCopyMap; /// K(T') --> K(T)
2123  else
2124  return ntGenMap; /// K(T') --> K'(T)
2125  }
2126  else
2127  {
2128  if (src->extRing->cf==dst->extRing->cf)
2129  return ntCopyAlg; /// K(T') --> K(T)
2130  else
2131  return ntGenAlg; /// K(T') --> K'(T)
2132  }
2133 
2134  return NULL; /// default
getCoeffType
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:420
n_rep_gap_rat
(number), see longrat.h
Definition: coeffs.h:110
FALSE
#define FALSE
Definition: auxiliary.h:96
ntGenAlg
static number ntGenAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1999
ntAdd
static number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:953
nCoeff_is_Zp
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:821
TransExtInfo
struct for passing initialization parameters to naInitChar
Definition: transext.h:87
ntNormalizeHelper
static number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition: transext.cc:1649
ntGreater
static BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:805
f
FILE * f
Definition: checklibs.c:9
ntMult
static number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:1033
k
int k
Definition: cfEzgcd.cc:92
rCanShortOut
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:580
naCoeffName
char * naCoeffName(const coeffs r)
Definition: algext.cc:1354
ntInvers
static number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1171
result
return result
Definition: facAbsBiFact.cc:76
ntNeg
static number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: transext.cc:690
ntMapUP
static number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2048
ADDRESS
void * ADDRESS
Definition: auxiliary.h:135
p_Var
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4558
nCoeff_bottom
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:291
h
STATIC_VAR Poly * h
Definition: janet.cc:971
cf
CanonicalForm cf
Definition: cfModGcd.cc:4024
fractionObjectBin
VAR omBin fractionObjectBin
Definition: transext.cc:88
ntParDeg
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2177
g
g
Definition: cfModGcd.cc:4031
nCoeff_is_Q_or_BI
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
Definition: coeffs.h:850
ntCoeffWrite
static void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: transext.cc:855
ndCopyMap
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:251
ntDiv
static number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1125
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:204
ntConvSingNFactoryN
static CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2168
ntNormalize
static void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1608
ntChineseRemainder
static number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: transext.cc:2471
ntClearContent
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2234
ntCopyAlg
static number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1992
ntGenMap
static number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1913
ntIsOne
static BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:668
nCoeff_is_Q
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:827
n_rep_rat_fct
(fraction), see transext.h
Definition: coeffs.h:113
ntEqual
static BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition: transext.cc:325
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:796
TransExtInfo::r
ring r
Definition: transext.h:88
rVar
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:586
ntTest
#define ntTest(a)
Definition: transext.cc:75
ntMap0P
static number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2009
TRUE
#define TRUE
Definition: auxiliary.h:100
i
int i
Definition: cfEzgcd.cc:125
p_Sub
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1962
res
CanonicalForm res
Definition: facAbsFact.cc:64
ntMapPP
static number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2033
ntClearDenominators
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2327
ntCoeffIsEqual
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1627
ntCopyMap
static number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1884
rRingVar
static char * rRingVar(short i, const ring r)
Definition: ring.h:571
ntRing
#define ntRing
Definition: transext.cc:79
ntSub
static number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:994
coeffs
ntGetNumerator
static number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:505
pp_Mult_qq
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1075
fa
BOOLEAN fa(leftv res, leftv args)
Definition: cohomo.cc:4392
p_Cleardenom
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2788
naCoeffString
char * naCoeffString(const coeffs r)
Definition: algext.cc:1331
ntConvFactoryNSingN
static number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2156
ntGcd
static number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1730
ntIsZero
static BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:305
ntFarey
static number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2501
n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:38
ntWriteLong
static void ntWriteLong(number a, const coeffs cf)
Definition: transext.cc:1548
COM
#define COM(f)
Definition: transext.cc:68
ntMapP0
static number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1868
ntInit
number ntInit(long i, const coeffs cf)
Definition: transext.cc:703
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:845
ntGetDenom
static number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:566
ntDBTest
static BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition: transext.cc:139
DIFF_COMPLEXITY
#define DIFF_COMPLEXITY
complexity increase due to diff
Definition: transext.cc:62
singclap_gcd_r
poly singclap_gcd_r(poly f, poly g, const ring r)
Definition: clapsing.cc:41
ntDelete
static void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:312
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:2186
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
ntPower
static void ntPower(number a, int exp, number *b, const coeffs cf)
Definition: transext.cc:1237
m
int m
Definition: cfEzgcd.cc:121
ntMap00
static number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1830
assume
#define assume(x)
Definition: mod2.h:384
ntRead
static const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1598
NULL
#define NULL
Definition: omList.c:11
nCoeff_is_Zn
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
Definition: coeffs.h:847
R
#define R
Definition: sirandom.c:27
ntMapZ0
static number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1854
ntInt
static long ntInt(number &a, const coeffs cf)
Definition: transext.cc:772
ntKillChar
static void ntKillChar(coeffs cf)
Definition: transext.cc:2151
ntIsMOne
static BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:677
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1038
heuristicGcdCancellation
static void heuristicGcdCancellation(number a, const coeffs cf)
forward declarations
Definition: transext.cc:1305
omFreeBin
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:257
ntWriteShort
static void ntWriteShort(number a, const coeffs cf)
Definition: transext.cc:1573
ntGreaterZero
static BOOLEAN ntGreaterZero(number a, const coeffs cf)
Definition: transext.cc:795
ntCopy
static number ntCopy(number a, const coeffs cf)
Definition: transext.cc:371
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:2070
ntSize
static int ntSize(number a, const coeffs cf)
Definition: transext.cc:1803
p_Diff
poly p_Diff(poly a, int k, const ring r)
Definition: p_polys.cc:1870
n_rep_gap_gmp
(), see rinteger.h, new impl.
Definition: coeffs.h:111