My Project  UNKNOWN_GIT_VERSION
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 275 of file transext.cc.

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

◆ ntDiff()

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

Definition at line 897 of file transext.cc.

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

◆ ntInitChar()

BOOLEAN ntInitChar ( coeffs  cf,
void *  infoStruct 
)

Initialize the coeffs object.

Definition at line 2515 of file transext.cc.

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

◆ ntIsParam()

int ntIsParam ( number  ,
const  coeffs 
)

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

Definition at line 2212 of file transext.cc.

2214 {
2215  ntTest(m);
2217 
2218  const ring R = cf->extRing;
2219  assume( R != NULL );
2220 
2221  fraction f = (fraction)m;
2222 
2223  if( DEN(f) != NULL )
2224  return 0;
2225 
2226  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 2074 of file transext.cc.

2076 {
2077  /* dst is expected to be a rational function field */
2078  assume(getCoeffType(dst) == n_transExt);
2079 
2080  if( src == dst ) return ndCopyMap;
2081 
2082  int h = 0; /* the height of the extension tower given by dst */
2083  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
2084  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
2085 
2086  /* for the time being, we only provide maps if h = 1 and if b is Q or
2087  some field Z/pZ: */
2088  if (h==0)
2089  {
2090  if ((src->rep==n_rep_gap_rat) && nCoeff_is_Q(bDst))
2091  return ntMap00; /// Q or Z --> Q(T)
2092  if (src->rep==n_rep_gap_gmp)
2093  return ntMapZ0; /// Z --> K(T)
2094  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
2095  return ntMapP0; /// Z/p --> Q(T)
2096  if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
2097  return ntMap0P; /// Q --> Z/p(T)
2098  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2099  {
2100  if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
2101  else return ntMapUP; /// Z/u --> Z/p(T)
2102  }
2103  if (nCoeff_is_Zn(src) && nCoeff_is_Zn(bDst))
2104  {
2105  if (mpz_cmp(src->modNumber,bDst->modNumber)==0) return ntMapPP; /// Z/p --> Z/p(T)
2106  }
2107  }
2108  if (h != 1) return NULL;
2109  //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
2110 
2111  /* Let T denote the sequence of transcendental extension variables, i.e.,
2112  K[t_1, ..., t_s] =: K[T];
2113  Let moreover, for any such sequence T, T' denote any subsequence of T
2114  of the form t_1, ..., t_w with w <= s. */
2115 
2116  if (rVar(src->extRing) > rVar(dst->extRing))
2117  return NULL;
2118 
2119  for (int i = 0; i < rVar(src->extRing); i++)
2120  if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
2121  return NULL;
2122 
2123  if (src->type==n_transExt)
2124  {
2125  if (src->extRing->cf==dst->extRing->cf)
2126  return ntCopyMap; /// K(T') --> K(T)
2127  else
2128  return ntGenMap; /// K(T') --> K'(T)
2129  }
2130  else
2131  {
2132  if (src->extRing->cf==dst->extRing->cf)
2133  return ntCopyAlg; /// K(T') --> K(T)
2134  else
2135  return ntGenAlg; /// K(T') --> K'(T)
2136  }
2137 
2138  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:94
ntGenAlg
static number ntGenAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2003
ntAdd
static number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:954
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:1653
ntGreater
static BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:806
f
FILE * f
Definition: checklibs.c:9
ntMult
static number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:1034
k
int k
Definition: cfEzgcd.cc:92
rCanShortOut
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:575
naCoeffName
char * naCoeffName(const coeffs r)
Definition: algext.cc:1356
ntInvers
static number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1175
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:691
ntMapUP
static number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2052
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
p_Var
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4550
nCoeff_bottom
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:292
cf
CanonicalForm cf
Definition: cfModGcd.cc:4024
ntParDeg
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2181
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:856
ndCopyMap
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:252
ntDiv
static number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1129
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:204
ntConvSingNFactoryN
static CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2172
ntNormalize
static void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1612
ntChineseRemainder
static number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: transext.cc:2475
ntClearContent
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2238
ntCopyAlg
static number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1996
ntGenMap
static number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1917
ntIsOne
static BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:669
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:326
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:798
TransExtInfo::r
ring r
Definition: transext.h:88
rVar
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:581
ntTest
#define ntTest(a)
Definition: transext.cc:76
ntMap0P
static number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2013
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
p_Sub
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1934
res
CanonicalForm res
Definition: facAbsFact.cc:64
ntMapPP
static number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2037
ntClearDenominators
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2331
ntCoeffIsEqual
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1631
ntCopyMap
static number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1888
rRingVar
static char * rRingVar(short i, const ring r)
Definition: ring.h:566
ntRing
#define ntRing
Definition: transext.cc:80
ntSub
static number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:995
h
static Poly * h
Definition: janet.cc:972
coeffs
ntGetNumerator
static number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:506
pp_Mult_qq
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1073
fa
BOOLEAN fa(leftv res, leftv args)
Definition: cohomo.cc:3007
p_Cleardenom
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2779
naCoeffString
char * naCoeffString(const coeffs r)
Definition: algext.cc:1333
ntConvFactoryNSingN
static number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2160
ntGcd
static number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1734
ntIsZero
static BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:306
ntFarey
static number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2505
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:1552
COM
#define COM(f)
Definition: transext.cc:69
ntMapP0
static number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1872
ntInit
number ntInit(long i, const coeffs cf)
Definition: transext.cc:704
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
ntGetDenom
static number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:567
ntDBTest
static BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition: transext.cc:140
DIFF_COMPLEXITY
#define DIFF_COMPLEXITY
complexity increase due to * and /
Definition: transext.cc:63
singclap_gcd_r
poly singclap_gcd_r(poly f, poly g, const ring r)
Definition: clapsing.cc:42
ntDelete
static void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:313
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:2190
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:1241
m
int m
Definition: cfEzgcd.cc:121
ntMap00
static number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1834
assume
#define assume(x)
Definition: mod2.h:384
ntRead
static const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1602
NULL
#define NULL
Definition: omList.c:9
nCoeff_is_Zn
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
Definition: coeffs.h:847
R
#define R
Definition: sirandom.c:26
fractionObjectBin
omBin fractionObjectBin
Definition: transext.cc:89
ntMapZ0
static number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1858
ntInt
static long ntInt(number &a, const coeffs cf)
Definition: transext.cc:773
NUM
Definition: readcf.cc:173
ntKillChar
static void ntKillChar(coeffs cf)
Definition: transext.cc:2155
ntIsMOne
static BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:678
p_Mult_q
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1036
heuristicGcdCancellation
static void heuristicGcdCancellation(number a, const coeffs cf)
forward declarations
Definition: transext.cc:1309
omFreeBin
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:257
ntWriteShort
static void ntWriteShort(number a, const coeffs cf)
Definition: transext.cc:1577
ntGreaterZero
static BOOLEAN ntGreaterZero(number a, const coeffs cf)
Definition: transext.cc:796
ntCopy
static number ntCopy(number a, const coeffs cf)
Definition: transext.cc:372
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:2074
ntSize
static int ntSize(number a, const coeffs cf)
Definition: transext.cc:1807
p_Diff
poly p_Diff(poly a, int k, const ring r)
Definition: p_polys.cc:1842
n_rep_gap_gmp
(), see rinteger.h, new impl.
Definition: coeffs.h:111