My Project
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 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.

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;
286 }
g
Definition: cfModGcd.cc:4090
FILE * f
Definition: checklibs.c:9
poly singclap_gcd_r(poly f, poly g, const ring r)
Definition: clapsing.cc:68
CanonicalForm res
Definition: facAbsFact.cc:60
poly p_Cleardenom(poly p, const ring r)
Definition: p_polys.cc:2910
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:901
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:846

◆ ntDiff()

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

Definition at line 897 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;
952 }
void * ADDRESS
Definition: auxiliary.h:119
int k
Definition: cfEzgcd.cc:99
CanonicalForm cf
Definition: cfModGcd.cc:4083
BOOLEAN fa(leftv res, leftv args)
Definition: cohomo.cc:4390
return result
Definition: facAbsBiFact.cc:75
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
#define NULL
Definition: omList.c:12
poly p_Diff(poly a, int k, const ring r)
Definition: p_polys.cc:1894
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4721
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1986
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1114
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1151
@ NUM
Definition: readcf.cc:170
static void heuristicGcdCancellation(number a, const coeffs cf)
forward declarations
Definition: transext.cc:1306
#define ntRing
Definition: transext.cc:80
#define COM(f)
Definition: transext.cc:69
static number ntCopy(number a, const coeffs cf)
Definition: transext.cc:372
#define ntTest(a)
Definition: transext.cc:76
VAR omBin fractionObjectBin
Definition: transext.cc:89
#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 2544 of file transext.cc.

2545 {
2546 
2547  assume( infoStruct != NULL );
2548 
2549  TransExtInfo *e = (TransExtInfo *)infoStruct;
2550 
2551  assume( e->r != NULL); // extRing;
2552  assume( e->r->cf != NULL); // extRing->cf;
2553  assume( e->r->qideal == NULL );
2554 
2555  assume( cf != NULL );
2556  assume(getCoeffType(cf) == n_transExt); // coeff type;
2557 
2558  ring R = e->r;
2559  assume(R != NULL);
2560 
2561  rIncRefCnt(R); // increase the ref.counter for the ground poly. ring!
2562 
2563  cf->extRing = R;
2564  /* propagate characteristic up so that it becomes
2565  directly accessible in cf: */
2566  cf->ch = R->cf->ch;
2567 
2568  cf->is_field=TRUE;
2569  cf->is_domain=TRUE;
2570  cf->rep=n_rep_rat_fct;
2571 
2572  cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
2573 
2574  cf->cfCoeffName = naCoeffName; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2575 
2576  cf->cfGreaterZero = ntGreaterZero;
2577  cf->cfGreater = ntGreater;
2578  cf->cfEqual = ntEqual;
2579  cf->cfIsZero = ntIsZero;
2580  cf->cfIsOne = ntIsOne;
2581  cf->cfIsMOne = ntIsMOne;
2582  cf->cfInit = ntInit;
2583  cf->cfFarey = ntFarey;
2584  cf->cfChineseRemainder = ntChineseRemainder;
2585  cf->cfInt = ntInt;
2586  cf->cfAdd = ntAdd;
2587  cf->cfInpNeg = ntNeg;
2588  cf->cfSub = ntSub;
2589  cf->cfMult = ntMult;
2590  cf->cfDiv = ntDiv;
2591  cf->cfExactDiv = ntExactDiv;
2592  cf->cfPower = ntPower;
2593  cf->cfCopy = ntCopy;
2594  cf->cfWriteLong = ntWriteLong;
2595  cf->cfRead = ntRead;
2596  cf->cfNormalize = ntNormalize;
2597  cf->cfDelete = ntDelete;
2598  cf->cfSetMap = ntSetMap;
2599  cf->cfGetDenom = ntGetDenom;
2600  cf->cfGetNumerator = ntGetNumerator;
2601  //cf->cfRePart = ntCopy;
2602  //cf->cfImPart = ntImPart;
2603  cf->cfCoeffWrite = ntCoeffWrite;
2604 #ifdef LDEBUG
2605  cf->cfDBTest = ntDBTest;
2606 #endif
2607  //cf->cfGcd = ntGcd_dummy;
2608  cf->cfSubringGcd = ntGcd;
2609  cf->cfNormalizeHelper = ntNormalizeHelper;
2610  cf->cfSize = ntSize;
2611  cf->nCoeffIsEqual = ntCoeffIsEqual;
2612  cf->cfInvers = ntInvers;
2613  cf->cfKillChar = ntKillChar;
2614  cf->cfInitMPZ = ntInitMPZ;
2615  cf->cfMPZ = ntMPZ;
2616 
2617  if( rCanShortOut(ntRing) )
2618  cf->cfWriteShort = ntWriteShort;
2619  else
2620  cf->cfWriteShort = ntWriteLong;
2621 
2622  cf->convFactoryNSingN =ntConvFactoryNSingN;
2623  cf->convSingNFactoryN =ntConvSingNFactoryN;
2624  cf->cfParDeg = ntParDeg;
2625 
2626  cf->iNumberOfParameters = rVar(R);
2627  cf->pParameterNames = (const char**)R->names;
2628  cf->cfParameter = ntParameter;
2629  cf->has_simple_Inverse= FALSE;
2630  /* cf->has_simple_Alloc= FALSE; */
2631 
2632 
2633  if( nCoeff_is_Q(R->cf) )
2634  cf->cfClearContent = ntClearContent;
2635 
2636  cf->cfClearDenominators = ntClearDenominators;
2637 
2638  return FALSE;
2639 }
char * naCoeffName(const coeffs r)
Definition: algext.cc:1335
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:38
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:806
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
@ n_rep_rat_fct
(fraction), see transext.h
Definition: coeffs.h:114
#define assume(x)
Definition: mod2.h:387
static ring rIncRefCnt(ring r)
Definition: ring.h:843
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:587
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:593
#define R
Definition: sirandom.c:27
static int ntSize(number a, const coeffs cf)
Definition: transext.cc:1811
static BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition: transext.cc:140
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
Definition: transext.cc:2194
static void ntWriteLong(number a, const coeffs cf)
Definition: transext.cc:1549
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1635
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:2078
static number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:995
static long ntInt(number &a, const coeffs cf)
Definition: transext.cc:773
static void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:313
static BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:669
static BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:306
static number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:506
static CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2176
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2335
static BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:678
static void ntMPZ(mpz_t m, number &n, const coeffs r)
Definition: transext.cc:2527
static void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: transext.cc:856
static number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1738
static number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2164
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2242
static number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1172
static number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition: transext.cc:1657
static void ntPower(number a, int exp, number *b, const coeffs cf)
Definition: transext.cc:1238
number ntInit(long i, const coeffs cf)
Definition: transext.cc:704
static number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:567
static const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1599
static void ntKillChar(coeffs cf)
Definition: transext.cc:2158
static void ntWriteShort(number a, const coeffs cf)
Definition: transext.cc:1574
static number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1126
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2185
static BOOLEAN ntGreaterZero(number a, const coeffs cf)
Definition: transext.cc:796
static number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN, CFArray &inv_cache, const coeffs cf)
Definition: transext.cc:2479
static number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:1034
static number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: transext.cc:691
static number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:954
static number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2509
static void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1609
static BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition: transext.cc:326
static BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:806
static number ntExactDiv(number a, number b, const coeffs cf)
Definition: transext.cc:1627
static number ntInitMPZ(mpz_t m, const coeffs r)
Definition: transext.cc:2519
struct for passing initialization parameters to naInitChar
Definition: transext.h:88

◆ ntIsParam()

int ntIsParam ( number  m,
const  coeffs 
)

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

Definition at line 2216 of file transext.cc.

2217 {
2218  ntTest(m);
2220 
2221  const ring R = cf->extRing;
2222  assume( R != NULL );
2223 
2224  fraction f = (fraction)m;
2225 
2226  if( DEN(f) != NULL )
2227  return 0;
2228 
2229  return p_Var( NUM(f), R );
2230 }
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 2078 of file transext.cc.

2079 {
2080  /* dst is expected to be a rational function field */
2081  assume(getCoeffType(dst) == n_transExt);
2082 
2083  int h = 0; /* the height of the extension tower given by dst */
2084  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
2085  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
2086 
2087  /* for the time being, we only provide maps if h = 1 and if b is Q or
2088  some field Z/pZ: */
2089  if (h==0)
2090  {
2091  if (((src->rep==n_rep_gap_rat) || (src->rep==n_rep_gap_gmp))
2092  && (nCoeff_is_Q(dst->extRing->cf) || nCoeff_is_Z(dst->extRing->cf)))
2093  return ntMap00; /// Q or Z --> Q(T)
2094  if (src->rep==n_rep_gmp)
2095  return ntMapZ0; /// Z --> K(T)
2096  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
2097  return ntMapP0; /// Z/p --> Q(T)
2098  if (nCoeff_is_Q_or_BI(src) && nCoeff_is_Zp(bDst))
2099  return ntMap0P; /// Q --> Z/p(T)
2100  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
2101  {
2102  if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
2103  else return ntMapUP; /// Z/u --> Z/p(T)
2104  }
2105  if (nCoeff_is_Zn(src) && nCoeff_is_Zn(bDst))
2106  {
2107  if (mpz_cmp(src->modNumber,bDst->modNumber)==0) return ntMapPP; /// Z/p --> Z/p(T)
2108  }
2109  }
2110  if (h != 1) return NULL;
2111  //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
2112 
2113  /* Let T denote the sequence of transcendental extension variables, i.e.,
2114  K[t_1, ..., t_s] =: K[T];
2115  Let moreover, for any such sequence T, T' denote any subsequence of T
2116  of the form t_1, ..., t_w with w <= s. */
2117 
2118  if (rVar(src->extRing) > rVar(dst->extRing))
2119  return NULL;
2120 
2121  for (int i = 0; i < rVar(src->extRing); i++)
2122  if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
2123  return NULL;
2124 
2125  if (src->type==n_transExt)
2126  {
2127  if (src->extRing->cf==dst->extRing->cf)
2128  return ntCopyMap; /// K(T') --> K(T)
2129  else
2130  return ntGenMap; /// K(T') --> K'(T)
2131  }
2132  else
2133  {
2134  if (src->extRing->cf==dst->extRing->cf)
2135  return ntCopyAlg; /// K(T') --> K(T)
2136  else
2137  return ntGenAlg; /// K(T') --> K'(T)
2138  }
2139 
2140  return NULL; /// default
2141 }
int i
Definition: cfEzgcd.cc:132
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
Definition: coeffs.h:816
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
Definition: coeffs.h:829
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
Definition: coeffs.h:826
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:800
@ n_rep_gap_rat
(number), see longrat.h
Definition: coeffs.h:111
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
Definition: coeffs.h:112
@ n_rep_gmp
(mpz_ptr), see rmodulon,h
Definition: coeffs.h:115
STATIC_VAR Poly * h
Definition: janet.cc:971
The main handler for Singular numbers which are suitable for Singular polynomials.
static char * rRingVar(short i, const ring r)
Definition: ring.h:578
static number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2000
static number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2041
static number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1862
static number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2017
static number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1876
static number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:2056
static number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1921
static number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1838
static number ntGenAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:2007
static number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1892
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:292