Data Structures | Functions
transext.h File Reference
#include <coeffs/coeffs.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...
 

Data Structure Documentation

struct TransExtInfo

struct for passing initialization parameters to naInitChar

Definition at line 92 of file transext.h.

Data Fields
ring r

Function Documentation

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

Definition at line 759 of file transext.cc.

760 {
761  //check_N(a,cf);
762  //check_N(d,cf);
763  ntTest(a);
764  ntTest(d);
765 
766  if (IS0(d))
767  {
768  WerrorS("ringvar expected");
769  return NULL;
770  }
771  fraction t = (fraction) d;
772  if (!DENIS1(t))
773  {
774  WerrorS("expected differentiation by a variable");
775  return NULL;
776  }
777  int k=p_Var(NUM(t),ntRing);
778  if (k==0)
779  {
780  WerrorS("expected differentiation by a variable");
781  return NULL;
782  }
783 
784  if (IS0(a)) return ntCopy(a, cf);
785 
786  fraction fa = (fraction)a;
787  fraction result = (fraction)omAlloc0Bin(fractionObjectBin);
788  if (DENIS1(fa))
789  {
790  NUM(result) = p_Diff(NUM(fa),k,ntRing);
791  //DEN(result) = NULL; // done by ..Alloc0..
792  if (NUM(result)==NULL)
793  {
795  return(NULL);
796  }
797  COM(result) = COM(fa);
798  //check_N((number)result,cf);
799  return (number)result;
800  }
801 
802  poly fg = p_Mult_q(p_Copy(DEN(fa),ntRing),p_Diff(NUM(fa),k,ntRing),ntRing);
803  poly gf = p_Mult_q(p_Copy(NUM(fa),ntRing),p_Diff(DEN(fa),k,ntRing),ntRing);
804  NUM(result) = p_Sub(fg,gf,ntRing);
805  if (NUM(result)==NULL) return(NULL);
806  DEN(result) = pp_Mult_qq(DEN(fa), DEN(fa), ntRing);
807  COM(result) = COM(fa) + COM(fa) + DIFF_COMPLEXITY;
808  heuristicGcdCancellation((number)result, cf);
809 
810  //check_N((number)result,cf);
811  return (number)result;
812 }
poly p_Diff(poly a, int k, const ring r)
Definition: p_polys.cc:1809
const poly a
Definition: syzextra.cc:212
#define DIFF_COMPLEXITY
complexity increase due to * and /
Definition: transext.cc:66
#define ntTest(a)
Definition: transext.cc:76
#define COM(f)
Definition: transext.cc:72
void * ADDRESS
Definition: auxiliary.h:161
void WerrorS(const char *s)
Definition: feFopen.cc:23
int k
Definition: cfEzgcd.cc:93
poly p_Sub(poly p1, poly p2, const ring r)
Definition: p_polys.cc:1901
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:811
polyrec * poly
Definition: hilb.h:10
static poly pp_Mult_qq(poly p, poly q, const ring r)
Definition: p_polys.h:1075
number ntCopy(number a, const coeffs cf)
Definition: transext.cc:341
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
void heuristicGcdCancellation(number a, const coeffs cf)
Definition: transext.cc:1193
#define NULL
Definition: omList.c:10
#define ntRing
Definition: transext.cc:87
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4432
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
return result
Definition: facAbsBiFact.cc:76
omBin fractionObjectBin
Definition: transext.cc:96
BOOLEAN ntInitChar ( coeffs  cf,
void *  infoStruct 
)

Initialize the coeffs object.

Definition at line 2370 of file transext.cc.

2371 {
2372 
2373  assume( infoStruct != NULL );
2374 
2375  TransExtInfo *e = (TransExtInfo *)infoStruct;
2376 
2377  assume( e->r != NULL); // extRing;
2378  assume( e->r->cf != NULL); // extRing->cf;
2379  assume( e->r->qideal == NULL );
2380 
2381  assume( cf != NULL );
2382  assume(getCoeffType(cf) == ID); // coeff type;
2383 
2384  ring R = e->r;
2385  assume(R != NULL);
2386 
2387  R->ref ++; // increase the ref.counter for the ground poly. ring!
2388 
2389  cf->extRing = R;
2390  /* propagate characteristic up so that it becomes
2391  directly accessible in cf: */
2392  cf->ch = R->cf->ch;
2393 
2394  cf->is_field=TRUE;
2395  cf->is_domain=TRUE;
2396  cf->rep=n_rep_rat_fct;
2397 
2398  cf->factoryVarOffset = R->cf->factoryVarOffset + rVar(R);
2399 
2400  cf->cfCoeffString = naCoeffString; // FIXME? TODO? // extern char* naCoeffString(const coeffs r);
2401 
2402  cf->cfGreaterZero = ntGreaterZero;
2403  cf->cfGreater = ntGreater;
2404  cf->cfEqual = ntEqual;
2405  cf->cfIsZero = ntIsZero;
2406  cf->cfIsOne = ntIsOne;
2407  cf->cfIsMOne = ntIsMOne;
2408  cf->cfInit = ntInit;
2409  cf->cfFarey = ntFarey;
2410  cf->cfChineseRemainder = ntChineseRemainder;
2411  cf->cfInt = ntInt;
2412  cf->cfInpNeg = ntNeg;
2413  cf->cfAdd = ntAdd;
2414  cf->cfSub = ntSub;
2415  cf->cfMult = ntMult;
2416  cf->cfDiv = ntDiv;
2417  cf->cfExactDiv = ntDiv;
2418  cf->cfPower = ntPower;
2419  cf->cfCopy = ntCopy;
2420  cf->cfWriteLong = ntWriteLong;
2421  cf->cfRead = ntRead;
2422  cf->cfNormalize = ntNormalize;
2423  cf->cfDelete = ntDelete;
2424  cf->cfSetMap = ntSetMap;
2425  cf->cfGetDenom = ntGetDenom;
2426  cf->cfGetNumerator = ntGetNumerator;
2427  cf->cfRePart = ntCopy;
2428  cf->cfImPart = ntImPart;
2429  cf->cfCoeffWrite = ntCoeffWrite;
2430 #ifdef LDEBUG
2431  cf->cfDBTest = ntDBTest;
2432 #endif
2433  //cf->cfGcd = ntGcd_dummy;
2434  cf->cfSubringGcd = ntGcd;
2435  cf->cfNormalizeHelper = ntNormalizeHelper;
2436  cf->cfSize = ntSize;
2437  cf->nCoeffIsEqual = ntCoeffIsEqual;
2438  cf->cfInvers = ntInvers;
2439  cf->cfKillChar = ntKillChar;
2440 
2441  if( rCanShortOut(ntRing) )
2442  cf->cfWriteShort = ntWriteShort;
2443  else
2444  cf->cfWriteShort = ntWriteLong;
2445 
2446  cf->convFactoryNSingN =ntConvFactoryNSingN;
2447  cf->convSingNFactoryN =ntConvSingNFactoryN;
2448  cf->cfParDeg = ntParDeg;
2449 
2450  cf->iNumberOfParameters = rVar(R);
2451  cf->pParameterNames = (const char**)R->names;
2452  cf->cfParameter = ntParameter;
2453  cf->has_simple_Inverse= FALSE;
2454  /* cf->has_simple_Alloc= FALSE; */
2455 
2456 
2457  if( nCoeff_is_Q(R->cf) )
2458  cf->cfClearContent = ntClearContent;
2459 
2460  cf->cfClearDenominators = ntClearDenominators;
2461 
2462  return FALSE;
2463 }
long ntInt(number &a, const coeffs cf)
Definition: transext.cc:630
number ntNormalizeHelper(number a, number b, const coeffs cf)
Definition: transext.cc:1493
number ntImPart(number a, const coeffs cf)
Definition: transext.cc:556
void ntDelete(number *a, const coeffs cf)
Definition: transext.cc:283
#define FALSE
Definition: auxiliary.h:140
number ntDiv(number a, number b, const coeffs cf)
Definition: transext.cc:963
number ntChineseRemainder(number *x, number *q, int rl, BOOLEAN sym, const coeffs cf)
Definition: transext.cc:2333
BOOLEAN ntIsMOne(number a, const coeffs cf)
Definition: transext.cc:530
number ntMult(number a, number b, const coeffs cf)
Definition: transext.cc:893
number ntSub(number a, number b, const coeffs cf)
Definition: transext.cc:855
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
void ntWriteLong(number &a, const coeffs cf)
Definition: transext.cc:1393
void ntWriteShort(number &a, const coeffs cf)
Definition: transext.cc:1420
#define TRUE
Definition: auxiliary.h:144
int ntSize(number a, const coeffs cf)
Definition: transext.cc:1657
BOOLEAN ntIsZero(number a, const coeffs cf)
Definition: transext.cc:276
BOOLEAN ntDBTest(number a, const char *f, const int l, const coeffs r)
Definition: transext.cc:178
(fraction), see transext.h
Definition: coeffs.h:112
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:1940
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:822
char * naCoeffString(const coeffs r)
Definition: algext.cc:1346
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:525
BOOLEAN ntIsOne(number a, const coeffs cf)
Definition: transext.cc:521
void ntNormalize(number &a, const coeffs cf)
Definition: transext.cc:1455
number ntInvers(number a, const coeffs cf)
Definition: transext.cc:1696
BOOLEAN ntGreater(number a, number b, const coeffs cf)
Definition: transext.cc:658
static int ntParDeg(number a, const coeffs cf)
Definition: transext.cc:2043
const char * ntRead(const char *s, number *a, const coeffs cf)
Definition: transext.cc:1446
static void ntClearDenominators(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2189
CanonicalForm ntConvSingNFactoryN(number n, BOOLEAN, const coeffs cf)
Definition: transext.cc:2034
number ntInit(long i, const coeffs cf)
Definition: transext.cc:562
#define assume(x)
Definition: mod2.h:405
number ntFarey(number p, number n, const coeffs cf)
Definition: transext.cc:2361
number ntGetDenom(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:419
static const n_coeffType ID
Our own type!
Definition: transext.cc:83
number ntNeg(number a, const coeffs cf)
this is in-place, modifies a
Definition: transext.cc:543
static BOOLEAN ntCoeffIsEqual(const coeffs cf, n_coeffType n, void *param)
Definition: transext.cc:1471
struct for passing initialization parameters to naInitChar
Definition: transext.h:92
BOOLEAN ntGreaterZero(number a, const coeffs cf)
forward declarations
Definition: transext.cc:711
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
number ntCopy(number a, const coeffs cf)
Definition: transext.cc:341
static void ntClearContent(ICoeffsEnumerator &numberCollectionEnumerator, number &c, const coeffs cf)
Definition: transext.cc:2100
#define NULL
Definition: omList.c:10
number ntAdd(number a, number b, const coeffs cf)
Definition: transext.cc:815
static number ntParameter(const int iParameter, const coeffs cf)
return the specified parameter as a number in the given trans.ext.
Definition: transext.cc:2052
BOOLEAN ntEqual(number a, number b, const coeffs cf)
Definition: transext.cc:295
#define R
Definition: sirandom.c:26
void ntPower(number a, int exp, number *b, const coeffs cf)
Definition: transext.cc:1010
void ntKillChar(coeffs cf)
Definition: transext.cc:2017
number ntConvFactoryNSingN(const CanonicalForm n, const coeffs cf)
Definition: transext.cc:2022
number ntGetNumerator(number &a, const coeffs cf)
TODO: normalization of a!?
Definition: transext.cc:358
#define ntRing
Definition: transext.cc:87
number ntGcd(number a, number b, const coeffs cf)
Definition: transext.cc:1581
void ntCoeffWrite(const coeffs cf, BOOLEAN details)
Definition: transext.cc:721
int ntIsParam ( number  ,
const coeffs   
)

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

Definition at line 2074 of file transext.cc.

2075 {
2076  ntTest(m);
2077  assume(getCoeffType(cf) == ID);
2078 
2079  const ring R = cf->extRing;
2080  assume( R != NULL );
2081 
2082  fraction f = (fraction)m;
2083 
2084  if( DEN(f) != NULL )
2085  return 0;
2086 
2087  return p_Var( NUM(f), R );
2088 }
f
Definition: cfModGcd.cc:4022
#define ntTest(a)
Definition: transext.cc:76
#define assume(x)
Definition: mod2.h:405
static const n_coeffType ID
Our own type!
Definition: transext.cc:83
int m
Definition: cfEzgcd.cc:119
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
#define R
Definition: sirandom.c:26
int p_Var(poly m, const ring r)
Definition: p_polys.cc:4432
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)

K(T') –> K(T)

K(T') –> K'(T)

K(T') –> K(T)

K(T') –> K'(T)

default

Definition at line 1940 of file transext.cc.

1941 {
1942  /* dst is expected to be a rational function field */
1943  assume(getCoeffType(dst) == ID);
1944 
1945  if( src == dst ) return ndCopyMap;
1946 
1947  int h = 0; /* the height of the extension tower given by dst */
1948  coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */
1949  coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */
1950 
1951  /* for the time being, we only provide maps if h = 1 and if b is Q or
1952  some field Z/pZ: */
1953  if (h==0)
1954  {
1955  if ((src->rep==n_rep_gap_rat) && nCoeff_is_Q(bDst))
1956  return ntMap00; /// Q or Z --> Q(T)
1957  if (src->rep==n_rep_gap_gmp)
1958  return ntMapZ0; /// Z --> K(T)
1959  if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst))
1960  return ntMapP0; /// Z/p --> Q(T)
1961  if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst))
1962  return ntMap0P; /// Q --> Z/p(T)
1963  if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst))
1964  {
1965  if (src->ch == dst->ch) return ntMapPP; /// Z/p --> Z/p(T)
1966  else return ntMapUP; /// Z/u --> Z/p(T)
1967  }
1968  }
1969  if (h != 1) return NULL;
1970  //if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL;
1971 
1972  /* Let T denote the sequence of transcendental extension variables, i.e.,
1973  K[t_1, ..., t_s] =: K[T];
1974  Let moreover, for any such sequence T, T' denote any subsequence of T
1975  of the form t_1, ..., t_w with w <= s. */
1976 
1977  if (rVar(src->extRing) > rVar(dst->extRing))
1978  return NULL;
1979 
1980  for (int i = 0; i < rVar(src->extRing); i++)
1981  if (strcmp(rRingVar(i, src->extRing), rRingVar(i, dst->extRing)) != 0)
1982  return NULL;
1983 
1984  if (src->type==n_transExt)
1985  {
1986  if (src->extRing->cf==dst->extRing->cf)
1987  return ntCopyMap; /// K(T') --> K(T)
1988  else
1989  return ntGenMap; /// K(T') --> K'(T)
1990  }
1991  else
1992  {
1993  if (src->extRing->cf==dst->extRing->cf)
1994  return ntCopyAlg; /// K(T') --> K(T)
1995  else
1996  return ntGenAlg; /// K(T') --> K'(T)
1997  }
1998 
1999  return NULL; /// default
2000 }
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:816
number ntMap00(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1754
number ntMapUP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1918
number ntGenMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1835
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
Definition: coeffs.h:37
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:228
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
(), see rinteger.h, new impl.
Definition: coeffs.h:110
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:822
static coeffs nCoeff_bottom(const coeffs r, int &height)
Definition: transext.cc:262
number ntCopyMap(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1806
number ntMapPP(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1903
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
number ntGenAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1869
number ntMapP0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1790
static const n_coeffType ID
Our own type!
Definition: transext.cc:83
int i
Definition: cfEzgcd.cc:123
static char * rRingVar(short i, const ring r)
Definition: ring.h:516
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
(number), see longrat.h
Definition: coeffs.h:109
#define NULL
Definition: omList.c:10
number ntMapZ0(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1776
number ntMap0P(number a, const coeffs src, const coeffs dst)
Definition: transext.cc:1879
static Poly * h
Definition: janet.cc:978
number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
Definition: transext.cc:1862